Skip to content
Snippets Groups Projects
Commit 1adfdcd3 authored by David Trattnig's avatar David Trattnig
Browse files

Fixed schedule fallback assignment. #50

parent 8cef76cb
No related branches found
No related tags found
No related merge requests found
...@@ -141,22 +141,13 @@ class AuraCalendarService(threading.Thread): ...@@ -141,22 +141,13 @@ class AuraCalendarService(threading.Thread):
# Store playlists to play # Store playlists to play
self.store_playlist(timeslot_db, timeslot_db.playlist_id, timeslot["playlist"]) self.store_playlist(timeslot_db, timeslot_db.playlist_id, timeslot["playlist"])
if timeslot_db.timeslot_fallback_id: if timeslot_db.schedule_fallback_id:
self.store_playlist(timeslot_db, timeslot_db.timeslot_fallback_id, timeslot["timeslot_fallback"]) self.store_playlist(timeslot_db, timeslot_db.schedule_fallback_id, timeslot["schedule_fallback"])
if timeslot_db.show_fallback_id: if timeslot_db.show_fallback_id:
self.store_playlist(timeslot_db, timeslot_db.show_fallback_id, timeslot["show_fallback"]) self.store_playlist(timeslot_db, timeslot_db.show_fallback_id, timeslot["show_fallback"])
if timeslot_db.station_fallback_id: if timeslot_db.station_fallback_id:
self.store_playlist(timeslot_db, timeslot_db.station_fallback_id, timeslot["station_fallback"]) self.store_playlist(timeslot_db, timeslot_db.station_fallback_id, timeslot["station_fallback"])
# self.store_playlist(timeslot_db, timeslot_db.playlist_id, timeslot["playlist"], PlaylistType.DEFAULT.id)
# if timeslot_db.timeslot_fallback_id:
# self.store_playlist(timeslot_db, timeslot_db.timeslot_fallback_id, timeslot["timeslot_fallback"], PlaylistType.TIMESLOT.id)
# if timeslot_db.show_fallback_id:
# self.store_playlist(timeslot_db, timeslot_db.show_fallback_id, timeslot["show_fallback"], PlaylistType.SHOW.id)
# if timeslot_db.station_fallback_id:
# self.store_playlist(timeslot_db, timeslot_db.station_fallback_id, timeslot["station_fallback"], PlaylistType.STATION.id)
result.append(timeslot_db) result.append(timeslot_db)
# Release the mutex # Release the mutex
...@@ -202,7 +193,7 @@ class AuraCalendarService(threading.Thread): ...@@ -202,7 +193,7 @@ class AuraCalendarService(threading.Thread):
timeslot_db.musicfocus = timeslot["show_musicfocus"] timeslot_db.musicfocus = timeslot["show_musicfocus"]
timeslot_db.playlist_id = timeslot["playlist_id"] timeslot_db.playlist_id = timeslot["playlist_id"]
timeslot_db.timeslot_fallback_id = timeslot["timeslot_fallback_id"] timeslot_db.schedule_fallback_id = timeslot["schedule_fallback_id"]
timeslot_db.show_fallback_id = timeslot["show_fallback_id"] timeslot_db.show_fallback_id = timeslot["show_fallback_id"]
timeslot_db.station_fallback_id = timeslot["station_fallback_id"] timeslot_db.station_fallback_id = timeslot["station_fallback_id"]
...@@ -219,7 +210,6 @@ class AuraCalendarService(threading.Thread): ...@@ -219,7 +210,6 @@ class AuraCalendarService(threading.Thread):
""" """
if not playlist_id or not fetched_playlist: if not playlist_id or not fetched_playlist:
self.logger.debug(f"Playlist ID#{playlist_id} is not available!") self.logger.debug(f"Playlist ID#{playlist_id} is not available!")
# self.logger.debug("Playlist type %s with ID '%s' is not available!" % (fallbackplaylist_type, playlist_id))
return return
playlist_db = Playlist.select_playlist_for_timeslot(timeslot_db.timeslot_start, playlist_id) playlist_db = Playlist.select_playlist_for_timeslot(timeslot_db.timeslot_start, playlist_id)
...@@ -233,7 +223,6 @@ class AuraCalendarService(threading.Thread): ...@@ -233,7 +223,6 @@ class AuraCalendarService(threading.Thread):
playlist_db.playlist_id = playlist_id playlist_db.playlist_id = playlist_id
playlist_db.timeslot_start = timeslot_db.timeslot_start playlist_db.timeslot_start = timeslot_db.timeslot_start
playlist_db.show_name = timeslot_db.show_name playlist_db.show_name = timeslot_db.show_name
# playlist_db.fallback_type = fallbackplaylist_type
if "entries" in fetched_playlist: if "entries" in fetched_playlist:
playlist_db.entry_count = len(fetched_playlist["entries"]) playlist_db.entry_count = len(fetched_playlist["entries"])
else: else:
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment