feat: Implement playlist management routes and integrate with music player service
This commit is contained in:
@@ -538,6 +538,7 @@ class StreamProcessingService:
|
||||
"""Add a sound to the main playlist."""
|
||||
try:
|
||||
from app.models.playlist import Playlist
|
||||
from app.services.music_player_service import music_player_service
|
||||
|
||||
# Find the main playlist
|
||||
main_playlist = Playlist.find_main_playlist()
|
||||
@@ -546,6 +547,9 @@ class StreamProcessingService:
|
||||
# Add sound to the main playlist
|
||||
main_playlist.add_sound(sound.id, commit=True)
|
||||
logger.info(f"Added sound {sound.id} to main playlist")
|
||||
|
||||
# Reload the playlist in music player if it's the current one
|
||||
music_player_service.reload_current_playlist_if_modified(main_playlist.id)
|
||||
else:
|
||||
logger.warning("Main playlist not found - sound not added to any playlist")
|
||||
|
||||
|
||||
Reference in New Issue
Block a user