refactored to music package
This commit is contained in:
parent
2a16f2b476
commit
77a7583913
2
main.py
2
main.py
@ -1,4 +1,4 @@
|
|||||||
from spotify import app
|
from music import app
|
||||||
|
|
||||||
app = app
|
app = app
|
||||||
|
|
||||||
|
@ -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,
|
@ -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__)
|
||||||
|
|
@ -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__)
|
@ -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
|
@ -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
|
@ -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
|
@ -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__)
|
||||||
|
|
@ -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()
|
||||||
|
|
@ -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()
|
@ -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()
|
||||||
|
|
@ -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()
|
||||||
|
|
@ -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()
|
||||||
|
|
@ -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()
|
||||||
|
|
Loading…
Reference in New Issue
Block a user