mirror of
https://github.com/Dvorinka/swingmusic-extended.git
synced 2026-06-03 20:13:02 +00:00
try to fix os.path.join None error
+ remove original thumbnails folder
This commit is contained in:
@@ -26,7 +26,7 @@ migrations: list[list[Migration]] = [
|
||||
v1_3_0.RemoveAllTracks,
|
||||
v1_3_0.UpdateAppSettingsTable,
|
||||
],
|
||||
[v1_4_9.AddTimestampToFavoritesTable],
|
||||
[v1_4_9.AddTimestampToFavoritesTable, v1_4_9.DeleteOriginalThumbnails],
|
||||
]
|
||||
|
||||
|
||||
@@ -46,6 +46,8 @@ def apply_migrations():
|
||||
log.info("Applied migration: %s", m.__name__)
|
||||
except:
|
||||
log.error("Failed to run migration: %s", m.__name__)
|
||||
|
||||
|
||||
print("Migrations applied successfully.")
|
||||
print("Current migration version: ", len(migrations))
|
||||
# bump migration version
|
||||
MigrationManager.set_version(len(migrations))
|
||||
|
||||
@@ -1,5 +1,8 @@
|
||||
import os
|
||||
import shutil
|
||||
from app.db.sqlite.utils import SQLiteManager
|
||||
from app.migrations.base import Migration
|
||||
from app.settings import Paths
|
||||
|
||||
|
||||
class AddTimestampToFavoritesTable(Migration):
|
||||
@@ -45,5 +48,13 @@ class DeleteOriginalThumbnails(Migration):
|
||||
"""
|
||||
Original thumbnails are too large and are not needed.
|
||||
"""
|
||||
|
||||
# TODO: Implement this migration
|
||||
pass
|
||||
|
||||
@staticmethod
|
||||
def migrate():
|
||||
imgpath = Paths.get_thumbs_path()
|
||||
og_imgpath = os.path.join(imgpath, "original")
|
||||
|
||||
if os.path.exists(og_imgpath):
|
||||
shutil.rmtree(og_imgpath)
|
||||
|
||||
+1
-1
@@ -29,7 +29,7 @@ class Paths:
|
||||
|
||||
@classmethod
|
||||
def get_config_dir(cls):
|
||||
return cls.XDG_CONFIG_DIR
|
||||
return cls.XDG_CONFIG_DIR or os.path.realpath(".")
|
||||
|
||||
@classmethod
|
||||
def get_config_folder(cls):
|
||||
|
||||
Reference in New Issue
Block a user