misc
This commit is contained in:
@ -382,7 +382,8 @@ class RadioUtil:
|
||||
"file_path": r["file_path"],
|
||||
"duration": r["duration"],
|
||||
}
|
||||
for r in results if r not in self.active_playlist
|
||||
for r in results
|
||||
if r not in self.active_playlist
|
||||
]
|
||||
logging.info(
|
||||
"Populated active playlists with %s items",
|
||||
@ -390,13 +391,13 @@ class RadioUtil:
|
||||
)
|
||||
|
||||
random.shuffle(self.active_playlist)
|
||||
|
||||
|
||||
"""Dedupe"""
|
||||
logging.info("Removing duplicate tracks...")
|
||||
dedupe_processed = []
|
||||
for item in self.active_playlist:
|
||||
artistsongabc: str = non_alnum.sub('', item.get('artistsong', None))
|
||||
if not artistsongabc:
|
||||
artistsongabc: str = non_alnum.sub("", item.get("artistsong", None))
|
||||
if not artistsongabc:
|
||||
logging.info("Missing artistsong: %s", item)
|
||||
continue
|
||||
if artistsongabc in dedupe_processed:
|
||||
@ -405,9 +406,13 @@ class RadioUtil:
|
||||
|
||||
logging.info(
|
||||
"Duplicates removed." "New playlist size: %s",
|
||||
len(self.active_playlist))
|
||||
|
||||
logging.info("Playlist: %s", [str(a.get('artistsong', '')) for a in self.active_playlist])
|
||||
len(self.active_playlist),
|
||||
)
|
||||
|
||||
logging.info(
|
||||
"Playlist: %s",
|
||||
[str(a.get("artistsong", "")) for a in self.active_playlist],
|
||||
)
|
||||
|
||||
if self.playback_genres:
|
||||
new_playlist: list[dict] = []
|
||||
|
Reference in New Issue
Block a user