save track logs to logged in user

+ rewrite migration collection
+ prevent logging invalid track logs
+ add jsoni
This commit is contained in:
cwilvx
2024-05-18 17:16:07 +03:00
parent f8f07c2116
commit 30768dd5d6
10 changed files with 160 additions and 42 deletions
+7 -7
View File
@@ -23,7 +23,7 @@ from app.utils.hashing import create_hash
# 6: trackhashes
class RemoveSmallThumbnailFolder(Migration):
class m1_RemoveSmallThumbnailFolder(Migration):
"""
Removes the small thumbnail folder.
@@ -45,7 +45,7 @@ class RemoveSmallThumbnailFolder(Migration):
os.makedirs(path, exist_ok=True)
class RemovePlaylistArtistHashes(Migration):
class m2_RemovePlaylistArtistHashes(Migration):
"""
removes the artisthashes column from the playlists table.
"""
@@ -64,7 +64,7 @@ class RemovePlaylistArtistHashes(Migration):
cur.close()
class AddSettingsToPlaylistTable(Migration):
class m3_AddSettingsToPlaylistTable(Migration):
"""
adds the settings column and removes the banner_pos and has_gif columns
to the playlists table.
@@ -141,7 +141,7 @@ class AddSettingsToPlaylistTable(Migration):
cur.close()
class AddLastUpdatedToTrackTable(Migration):
class m4_AddLastUpdatedToTrackTable(Migration):
"""
adds the last modified column to the tracks table.
"""
@@ -161,7 +161,7 @@ class AddLastUpdatedToTrackTable(Migration):
cur.close()
class MovePlaylistsAndFavoritesTo10BitHashes(Migration):
class m5_MovePlaylistsAndFavoritesTo10BitHashes(Migration):
"""
moves the playlists and favorites to 10 bit hashes.
"""
@@ -268,7 +268,7 @@ class MovePlaylistsAndFavoritesTo10BitHashes(Migration):
cur.close()
class RemoveAllTracks(Migration):
class m6_RemoveAllTracks(Migration):
"""
removes all tracks from the tracks table.
"""
@@ -282,7 +282,7 @@ class RemoveAllTracks(Migration):
cur.close()
class UpdateAppSettingsTable(Migration):
class m7_UpdateAppSettingsTable(Migration):
@staticmethod
def migrate():
drop_table_sql = "DROP TABLE settings"