refactor: Improve code readability and structure across TTS modules
Some checks failed
Backend CI / lint (push) Failing after 10s
Backend CI / test (push) Failing after 1m36s

This commit is contained in:
JSC
2025-09-21 19:07:32 +02:00
parent 35b857fd0d
commit acdf191a5a
8 changed files with 106 additions and 56 deletions

View File

@@ -244,7 +244,10 @@ class PlaylistService:
if was_current:
main_playlist = await self.get_main_playlist()
await self.playlist_repo.update(main_playlist, {"is_current": True})
logger.info("Set main playlist as current after deleting current playlist %s", playlist_id)
logger.info(
"Set main playlist as current after deleting current playlist %s",
playlist_id,
)
# Reload player to reflect the change
await _reload_player_playlist()
@@ -562,7 +565,11 @@ class PlaylistService:
await self.session.delete(playlist_sound)
await self.session.commit()
logger.info("Deleted %d playlist_sound records for playlist %s", len(playlist_sounds), playlist_id)
logger.info(
"Deleted %d playlist_sound records for playlist %s",
len(playlist_sounds),
playlist_id,
)
async def _unset_current_playlist(self) -> None:
"""Unset any current playlist globally."""