mirror of
https://github.com/Dvorinka/swingmusic-extended.git
synced 2026-06-04 12:33:03 +00:00
Integrate nav
- other minor refactors
This commit is contained in:
@@ -16,8 +16,8 @@ class Albums(db.Mongo):
|
||||
"""
|
||||
|
||||
def __init__(self):
|
||||
super(Albums, self).__init__("ALBUMS")
|
||||
self.collection = self.db["ALBUMS"]
|
||||
super(Albums, self).__init__("ALICE_ALBUMS")
|
||||
self.collection = self.db["ALL_ALBUMS"]
|
||||
|
||||
def insert_album(self, album: dict) -> None:
|
||||
"""
|
||||
|
||||
@@ -12,8 +12,8 @@ class Artists(db.Mongo):
|
||||
"""
|
||||
|
||||
def __init__(self):
|
||||
super(Artists, self).__init__("ALL_ARTISTS")
|
||||
self.collection = self.db["THEM_ARTISTS"]
|
||||
super(Artists, self).__init__("ALICE_ARTISTS")
|
||||
self.collection = self.db["ALL_ARTISTS"]
|
||||
|
||||
def insert_artist(self, artist_obj: dict) -> None:
|
||||
"""
|
||||
|
||||
@@ -15,8 +15,8 @@ class Playlists(db.Mongo):
|
||||
"""
|
||||
|
||||
def __init__(self):
|
||||
super(Playlists, self).__init__("PLAYLISTS")
|
||||
self.collection = self.db["PLAYLISTS"]
|
||||
super(Playlists, self).__init__("ALICE_PLAYLISTS")
|
||||
self.collection = self.db["ALL_PLAYLISTS"]
|
||||
|
||||
def insert_playlist(self, playlist: dict) -> None:
|
||||
"""
|
||||
|
||||
@@ -11,7 +11,7 @@ class TrackColors(db.Mongo):
|
||||
"""
|
||||
|
||||
def __init__(self):
|
||||
super(TrackColors, self).__init__("TRACK_COLORS")
|
||||
super(TrackColors, self).__init__("ALICE_TRACK_COLORS")
|
||||
self.collection = self.db["TRACK_COLORS"]
|
||||
|
||||
def insert_track_color(self, track_color: dict) -> None:
|
||||
|
||||
@@ -15,8 +15,8 @@ class AllSongs(db.Mongo):
|
||||
"""
|
||||
|
||||
def __init__(self):
|
||||
super(AllSongs, self).__init__("ALL_SONGS")
|
||||
self.collection = self.db["ALL_SONGS"]
|
||||
super(AllSongs, self).__init__("ALICE_MUSIC_TRACKS")
|
||||
self.collection = self.db["ALL_TRACKS"]
|
||||
|
||||
# def drop_db(self):
|
||||
# self.collection.drop()
|
||||
@@ -67,7 +67,6 @@ class AllSongs(db.Mongo):
|
||||
"""
|
||||
Finds all the tracks matching the title in the query params.
|
||||
"""
|
||||
self.collection.create_index([("title", db.pymongo.TEXT)])
|
||||
song = self.collection.find({"title": {"$regex": query, "$options": "i"}})
|
||||
return convert_many(song)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user