mirror of
https://github.com/Dvorinka/swingmusic-extended.git
synced 2026-06-03 20:13:02 +00:00
prevent running migrations if is_fresh_install
+ fix: sqlite3.ProgrammingError: Cannot operate on a closed cursor on ProcessAlbumColors() + move processing artist images from periodic_scans to Populate + bump hash string limit from 7 to 10 + add last_mod property to database + fix: TypeError: '<' not supported between instances of 'int' and 'str' on album page
This commit is contained in:
+9
-1
@@ -34,7 +34,11 @@ def get_image_colors(image: str, count=1) -> list[str]:
|
||||
|
||||
|
||||
def process_color(item_hash: str, is_album=True):
|
||||
path = settings.Paths.get_sm_thumb_path() if is_album else settings.Paths.get_artist_img_sm_path()
|
||||
path = (
|
||||
settings.Paths.get_sm_thumb_path()
|
||||
if is_album
|
||||
else settings.Paths.get_artist_img_sm_path()
|
||||
)
|
||||
path = Path(path) / (item_hash + ".webp")
|
||||
|
||||
if not path.exists():
|
||||
@@ -69,6 +73,8 @@ class ProcessAlbumColors:
|
||||
color_str = json.dumps(colors)
|
||||
db.insert_one_album(cur, album.albumhash, color_str)
|
||||
|
||||
cur.close()
|
||||
|
||||
|
||||
class ProcessArtistColors:
|
||||
"""
|
||||
@@ -95,3 +101,5 @@ class ProcessArtistColors:
|
||||
|
||||
artist.set_colors(colors)
|
||||
adb.insert_one_artist(cur, artist.artisthash, colors)
|
||||
|
||||
cur.close()
|
||||
|
||||
Reference in New Issue
Block a user