Integrate nav

- other minor refactors
This commit is contained in:
geoffrey45
2022-04-14 11:30:19 +03:00
parent 90d646d674
commit 85c59b4cba
28 changed files with 266 additions and 141 deletions
+2 -2
View File
@@ -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:
"""
+2 -2
View File
@@ -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:
"""
+2 -2
View File
@@ -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:
"""
+1 -1
View File
@@ -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:
+2 -3
View File
@@ -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)