fix migrations deleting all playlists

This commit is contained in:
mungai-njoroge
2024-03-11 11:33:59 +03:00
committed by Mungai Njoroge
parent ae031014a9
commit 99ec11565c
4 changed files with 18 additions and 10 deletions
+1 -2
View File
@@ -26,12 +26,11 @@ api = APIBlueprint("playlists", __name__, url_prefix="/playlists", abp_tags=[tag
PL = SQLitePlaylistMethods
class SendAllPlaylistsQuery(BaseModel):
no_images: bool = Field(False, description="Whether to include images")
@api.get("", methods=["GET"])
@api.get("")
def send_all_playlists(query: SendAllPlaylistsQuery):
"""
Gets all the playlists.
+1 -2
View File
@@ -138,9 +138,8 @@ def get_top_results(query: TopResultsQuery):
Returns the top results for the given query.
"""
query = query.q
limit = query.limit
query = query.q
in_quotes = query_in_quotes(query)
+3 -6
View File
@@ -10,7 +10,6 @@ ONLY MODIFY OLD MIGRATIONS FOR BUG FIXES OR ENHANCEMENTS ONLY
PS: Fuck that! Do what you want.
"""
from app.db.sqlite.migrations import MigrationManager
from app.logger import log
from app.migrations import v1_3_0, v1_4_9
@@ -27,9 +26,7 @@ migrations: list[list[Migration]] = [
v1_3_0.RemoveAllTracks,
v1_3_0.UpdateAppSettingsTable,
],
[
v1_4_9.AddTimestampToFavoritesTable
]
[v1_4_9.AddTimestampToFavoritesTable],
]
@@ -41,8 +38,8 @@ def apply_migrations():
version = MigrationManager.get_version()
if version != len(migrations):
# run migrations after the previous migration version
for migration in migrations[(version - 1) :]:
# INFO: Apply new migrations
for migration in migrations[version:]:
for m in migration:
try:
m.migrate()