Skip to content

Commit 77cc8b7

Browse files
committed
Github copilot review
1 parent 0247b38 commit 77cc8b7

2 files changed

Lines changed: 5 additions & 6 deletions

File tree

tasks/clustering.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,8 +25,7 @@
2525
from error.error_dictionary import ERR_CLUSTERING_FAILED
2626

2727
# Import AI naming function and prompt template
28-
from tasks.ai.api import get_ai_playlist_name
29-
from tasks.ai.prompts import creative_prompt_template
28+
# (used by clustering_helper._try_ai_name_playlist, imported there)
3029
# Import media server functions
3130
from .mediaserver import create_playlist, delete_automatic_playlists
3231
# Import refactored clustering helpers

tasks/clustering_helper.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ def _shuffle_playlist_songs(songs, playlist_name):
5151
final_songs = songs.copy()
5252
n = len(final_songs)
5353
if n <= 1:
54-
logger.info(f"FINAL: '{playlist_name}' has only {n} songs - no shuffling needed")
54+
logger.info("FINAL: '%s' has only %d songs - no shuffling needed", playlist_name, n)
5555
return final_songs
5656

5757
current_time_seed = int(time.time() * 1000000) % 1000000
@@ -60,8 +60,8 @@ def _shuffle_playlist_songs(songs, playlist_name):
6060
final_songs[i], final_songs[j] = final_songs[j], final_songs[i]
6161
current_time_seed = (current_time_seed * 1103515245 + 12345) % (2 ** 31)
6262

63-
logger.info(f"FINAL FISHER-YATES SHUFFLE applied to '{playlist_name}': {len(final_songs)} songs")
64-
logger.info(f"FINAL ORDER: First song = '{final_songs[0][1]}', Last song = '{final_songs[-1][1]}'")
63+
logger.info("FINAL FISHER-YATES SHUFFLE applied to '%s': %d songs", playlist_name, len(final_songs))
64+
logger.info("FINAL ORDER: First song = '%s', Last song = '%s'", final_songs[0][1], final_songs[-1][1])
6565
return final_songs
6666

6767

@@ -94,7 +94,7 @@ def _try_ai_name_playlist(original_name, songs, centroids, ai_provider,
9494
)
9595
if ai_name and "Error" not in ai_name:
9696
return ai_name.strip().replace("\n", " ")
97-
logger.warning(f"AI naming failed for '{original_name}': {ai_name}. Using original name.")
97+
logger.warning("AI naming failed for '%s': %s. Using original name.", original_name, ai_name)
9898
return original_name
9999

100100

0 commit comments

Comments
 (0)