refactored to music package

This commit is contained in:
aj 2019-10-19 17:14:11 +01:00
parent 2a16f2b476
commit 77a7583913
25 changed files with 25 additions and 25 deletions

View File

@ -1,4 +1,4 @@
from spotify import app from music import app
app = app app = app

View File

@ -10,11 +10,11 @@ from google.cloud import tasks_v2
from google.protobuf import timestamp_pb2 from google.protobuf import timestamp_pb2
from werkzeug.security import check_password_hash, generate_password_hash from werkzeug.security import check_password_hash, generate_password_hash
from spotify.api.decorators import login_required, login_or_basic_auth, admin_required, gae_cron, cloud_task from music.api.decorators import login_required, login_or_basic_auth, admin_required, gae_cron, cloud_task
from spotify.tasks.run_user_playlist import run_user_playlist as run_user_playlist from music.tasks.run_user_playlist import run_user_playlist as run_user_playlist
from spotify.tasks.play_user_playlist import play_user_playlist as play_user_playlist from music.tasks.play_user_playlist import play_user_playlist as play_user_playlist
import spotify.db.database as database import music.db.database as database
blueprint = Blueprint('api', __name__) blueprint = Blueprint('api', __name__)
db = firestore.Client() db = firestore.Client()
@ -130,7 +130,7 @@ def playlist(username=None):
# if playlist_id is None or playlist_shuffle is None: # if playlist_id is None or playlist_shuffle is None:
# return jsonify({'error': 'parts and id required'}), 400 # return jsonify({'error': 'parts and id required'}), 400
from spotify.tasks.create_playlist import create_playlist as create_playlist from music.tasks.create_playlist import create_playlist as create_playlist
to_add = { to_add = {
'name': playlist_name, 'name': playlist_name,

View File

@ -3,7 +3,7 @@ import logging
from flask import session, request, jsonify from flask import session, request, jsonify
from spotify.db import database as database from music.db import database as database
logger = logging.getLogger(__name__) logger = logging.getLogger(__name__)

View File

@ -2,9 +2,9 @@ from flask import Blueprint, jsonify
from datetime import date from datetime import date
import logging import logging
from spotify.api.decorators import login_or_basic_auth, lastfm_username_required from music.api.decorators import login_or_basic_auth, lastfm_username_required
import spotify.db.database as database import music.db.database as database
blueprint = Blueprint('fm-api', __name__) blueprint = Blueprint('fm-api', __name__)
logger = logging.getLogger(__name__) logger = logging.getLogger(__name__)

View File

@ -2,8 +2,8 @@ from flask import Blueprint, request, jsonify
import logging import logging
from spotify.api.decorators import login_or_basic_auth, spotify_link_required from music.api.decorators import login_or_basic_auth, spotify_link_required
import spotify.db.database as database import music.db.database as database
from spotframework.model.track import SpotifyTrack from spotframework.model.track import SpotifyTrack
from spotframework.model.uri import Uri from spotframework.model.uri import Uri

View File

@ -1,8 +1,8 @@
from flask import Blueprint, jsonify, request from flask import Blueprint, jsonify, request
import logging import logging
from spotify.api.decorators import login_or_basic_auth, lastfm_username_required, spotify_link_required from music.api.decorators import login_or_basic_auth, lastfm_username_required, spotify_link_required
import spotify.db.database as database import music.db.database as database
from spotfm.maths.counter import Counter from spotfm.maths.counter import Counter
from spotframework.model.uri import Uri from spotframework.model.uri import Uri

View File

@ -1,8 +1,8 @@
from flask import Blueprint, request, jsonify from flask import Blueprint, request, jsonify
import logging import logging
from spotify.api.decorators import login_or_basic_auth, spotify_link_required from music.api.decorators import login_or_basic_auth, spotify_link_required
import spotify.db.database as database import music.db.database as database
from spotframework.engine.playlistengine import PlaylistEngine from spotframework.engine.playlistengine import PlaylistEngine
from spotframework.model.uri import Uri from spotframework.model.uri import Uri

View File

@ -8,7 +8,7 @@ import logging
from base64 import b64encode from base64 import b64encode
import requests import requests
import spotify.db.database as database import music.db.database as database
blueprint = Blueprint('authapi', __name__) blueprint = Blueprint('authapi', __name__)

View File

@ -6,7 +6,7 @@ from werkzeug.security import check_password_hash
from spotframework.net.network import Network as SpotifyNetwork from spotframework.net.network import Network as SpotifyNetwork
from fmframework.net.network import Network as FmNetwork from fmframework.net.network import Network as FmNetwork
from spotify.db.user import DatabaseUser from music.db.user import DatabaseUser
db = firestore.Client() db = firestore.Client()

View File

@ -1,5 +1,5 @@
from google.cloud import firestore from google.cloud import firestore
import spotify.db.database as database import music.db.database as database
import logging import logging
db = firestore.Client() db = firestore.Client()

View File

@ -3,8 +3,8 @@ from google.cloud import firestore
import os import os
from spotify.auth import auth_blueprint from music.auth import auth_blueprint
from spotify.api import api_blueprint, player_blueprint, fm_blueprint, spotfm_blueprint, spotify_blueprint from music.api import api_blueprint, player_blueprint, fm_blueprint, spotfm_blueprint, spotify_blueprint
db = firestore.Client() db = firestore.Client()

View File

@ -2,7 +2,7 @@ from google.cloud import firestore
import logging import logging
import spotify.db.database as database import music.db.database as database
db = firestore.Client() db = firestore.Client()

View File

@ -9,8 +9,8 @@ from spotframework.engine.processor.sort import SortReleaseDate
from spotframework.engine.processor.deduplicate import DeduplicateByID from spotframework.engine.processor.deduplicate import DeduplicateByID
from spotframework.player.player import Player from spotframework.player.player import Player
import spotify.db.database as database import music.db.database as database
from spotify.db.part_generator import PartGenerator from music.db.part_generator import PartGenerator
db = firestore.Client() db = firestore.Client()

View File

@ -10,8 +10,8 @@ from spotframework.engine.processor.deduplicate import DeduplicateByID
from spotframework.model.uri import Uri from spotframework.model.uri import Uri
import spotify.db.database as database import music.db.database as database
from spotify.db.part_generator import PartGenerator from music.db.part_generator import PartGenerator
db = firestore.Client() db = firestore.Client()