client: implement queuing

This commit is contained in:
geoffrey45
2021-12-21 13:42:06 +03:00
parent 8a744ce0be
commit 36999d8061
17 changed files with 240 additions and 179 deletions
+4 -2
View File
@@ -51,8 +51,7 @@ class AllSongs(Mongo):
def insert_song(self, song_obj):
self.collection.update_one(
{'filepath': song_obj['filepath']}, { "$set": song_obj}, upsert=True)
# self.collection.insert_one(song_obj)
{'filepath': song_obj['filepath']}, {"$set": song_obj}, upsert=True)
def find_song_by_title(self, query):
self.collection.create_index([('title', pymongo.TEXT)])
@@ -71,6 +70,9 @@ class AllSongs(Mongo):
else:
return self.collection.find({'folder': query, '_id': {'$gt': ObjectId(last_id)}}).limit(limit)
def find_songs_by_folder_og(self, query):
return self.collection.find({'folder': query})
def find_songs_by_artist(self, query):
return self.collection.find({'artists': {'$regex': query, '$options': 'i'}})