mirror of
https://github.com/Dvorinka/swingmusic-extended.git
synced 2026-06-04 20:43:04 +00:00
rewrite db stuff with scalars and generators
+ dump mixes with less than x=4 artists + try: disable pragma mmap_size
This commit is contained in:
+9
-3
@@ -33,16 +33,22 @@ def map_scrobble_data():
|
||||
if track is None:
|
||||
continue
|
||||
|
||||
track.increment_playcount(data["playduration"], data["lastplayed"], data["playcount"])
|
||||
track.increment_playcount(
|
||||
data["playduration"], data["lastplayed"], data["playcount"]
|
||||
)
|
||||
|
||||
album = AlbumStore.albummap.get(track.tracks[0].albumhash)
|
||||
if album:
|
||||
album.increment_playcount(data["playduration"], data["lastplayed"], data["playcount"])
|
||||
album.increment_playcount(
|
||||
data["playduration"], data["lastplayed"], data["playcount"]
|
||||
)
|
||||
|
||||
for artisthash in track.tracks[0].artisthashes:
|
||||
artist = ArtistStore.artistmap.get(artisthash)
|
||||
if artist:
|
||||
artist.increment_playcount(data["playduration"], data["lastplayed"], data["playcount"])
|
||||
artist.increment_playcount(
|
||||
data["playduration"], data["lastplayed"], data["playcount"]
|
||||
)
|
||||
|
||||
|
||||
def map_favorites():
|
||||
|
||||
@@ -28,7 +28,7 @@ def create_thumbnail(image: Any, img_path: str) -> str:
|
||||
|
||||
new_w = round(250 * aspect_ratio)
|
||||
|
||||
thumb = image.resize((new_w, 250), Image.ANTIALIAS)
|
||||
thumb = image.resize((new_w, 250), Image.Resampling.LANCZOS)
|
||||
thumb.save(full_thumb_path, "webp")
|
||||
|
||||
return thumb_path
|
||||
@@ -50,7 +50,7 @@ def create_gif_thumbnail(image: Any, img_path: str):
|
||||
|
||||
new_w = round(250 * aspect_ratio)
|
||||
|
||||
thumb = frame.resize((new_w, 250), Image.ANTIALIAS)
|
||||
thumb = frame.resize((new_w, 250), Image.Resampling.LANCZOS)
|
||||
frames.append(thumb)
|
||||
|
||||
frames[0].save(full_thumb_path, save_all=True, append_images=frames[1:])
|
||||
|
||||
+1
-2
@@ -169,8 +169,7 @@ class FetchSimilarArtistsLastFM:
|
||||
|
||||
def __init__(self, instance_key: str) -> None:
|
||||
# read all artists from db
|
||||
processed = SimilarArtistTable.get_all()
|
||||
processed = ".".join(a for a in processed)
|
||||
processed = set(a.artisthash for a in SimilarArtistTable.get_all())
|
||||
|
||||
# filter out artists that already have similar artists
|
||||
artists = filter(
|
||||
|
||||
Reference in New Issue
Block a user