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:
geoffrey45
2021-12-19 02:31:17 +03:00
parent 457180ecaf
commit 831b8e7ee2
11 changed files with 65 additions and 79 deletions
+3 -2
View File
@@ -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)])