mirror of
https://github.com/Dvorinka/swingmusic-extended.git
synced 2026-06-04 04:23:01 +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:
@@ -33,6 +33,7 @@ class MixAlreadyExists(Exception):
|
||||
class MixesPlugin(Plugin):
|
||||
MAX_TRACKS_TO_FETCH = 5
|
||||
MIN_TRACK_MIX_LENGTH = 15
|
||||
MIN_ARTISTS_PER_MIX = 4
|
||||
MIX_TRACKS_LENGTH = 40
|
||||
|
||||
MIN_DAY_LISTEN_DURATION = 3 * 60 # 3 minutes
|
||||
@@ -291,6 +292,10 @@ class MixesPlugin(Plugin):
|
||||
if len(mix_tracks) < self.MIN_TRACK_MIX_LENGTH:
|
||||
return None
|
||||
|
||||
# INFO: Dump mixes with no variety
|
||||
if len(set(t.artisthashes[0] for t in mix_tracks)) < self.MIN_ARTISTS_PER_MIX:
|
||||
return None
|
||||
|
||||
# try downloading artist image
|
||||
mix_image = {"image": _artist.artist.image, "color": _artist.artist.color}
|
||||
image = self.download_artist_image(_artist.artist)
|
||||
|
||||
Reference in New Issue
Block a user