mirror of
https://github.com/Dvorinka/swingmusic-extended.git
synced 2026-06-03 20:13:02 +00:00
remove regex in album songs query
This commit is contained in:
@@ -14,7 +14,8 @@ class Artists(Mongo):
|
|||||||
self.collection = self.db['THEM_ARTISTS']
|
self.collection = self.db['THEM_ARTISTS']
|
||||||
|
|
||||||
def insert_artist(self, artist_obj):
|
def insert_artist(self, artist_obj):
|
||||||
self.collection.update_one(artist_obj, {'$set': artist_obj}, upsert=True)
|
self.collection.update_one(
|
||||||
|
artist_obj, {'$set': artist_obj}, upsert=True)
|
||||||
|
|
||||||
def get_all_artists(self):
|
def get_all_artists(self):
|
||||||
return self.collection.find()
|
return self.collection.find()
|
||||||
@@ -46,7 +47,7 @@ class AllSongs(Mongo):
|
|||||||
return self.collection.find({'title': {'$regex': query, '$options': 'i'}})
|
return self.collection.find({'title': {'$regex': query, '$options': 'i'}})
|
||||||
|
|
||||||
def find_songs_by_album(self, query):
|
def find_songs_by_album(self, query):
|
||||||
return self.collection.find({'album': {'$regex': query, '$options': 'i'}})
|
return self.collection.find({'album': query})
|
||||||
|
|
||||||
def get_all_songs(self):
|
def get_all_songs(self):
|
||||||
return self.collection.find().limit(25)
|
return self.collection.find().limit(25)
|
||||||
|
|||||||
Reference in New Issue
Block a user