mirror of
https://github.com/Dvorinka/swingmusic-extended.git
synced 2026-06-03 20:13:02 +00:00
major changes:
- resize images to 150x150 - convert them to webp - use $set to update database - remove comments in py code - a whole lot more
This commit is contained in:
@@ -50,8 +50,9 @@ class AllSongs(Mongo):
|
||||
return self.collection.find_one({'_id': ObjectId(file_id)})
|
||||
|
||||
def insert_song(self, song_obj):
|
||||
self.collection.update(
|
||||
{'filepath': song_obj['filepath']}, song_obj, upsert=True)
|
||||
self.collection.update_one(
|
||||
{'filepath': song_obj['filepath']}, { "$set": song_obj}, upsert=True)
|
||||
# self.collection.insert_one(song_obj)
|
||||
|
||||
def find_song_by_title(self, query):
|
||||
self.collection.create_index([('title', pymongo.TEXT)])
|
||||
|
||||
Reference in New Issue
Block a user