From 1adfdcd3dfc8db96165e3dc3457f97f3ce9c8bcc Mon Sep 17 00:00:00 2001 From: David Trattnig <david.trattnig@o94.at> Date: Thu, 29 Oct 2020 20:23:49 +0100 Subject: [PATCH] Fixed schedule fallback assignment. #50 --- src/scheduling/calendar.py | 17 +++-------------- 1 file changed, 3 insertions(+), 14 deletions(-) diff --git a/src/scheduling/calendar.py b/src/scheduling/calendar.py index dd27b6a9..cffa0961 100644 --- a/src/scheduling/calendar.py +++ b/src/scheduling/calendar.py @@ -141,22 +141,13 @@ class AuraCalendarService(threading.Thread): # Store playlists to play self.store_playlist(timeslot_db, timeslot_db.playlist_id, timeslot["playlist"]) - if timeslot_db.timeslot_fallback_id: - self.store_playlist(timeslot_db, timeslot_db.timeslot_fallback_id, timeslot["timeslot_fallback"]) + if timeslot_db.schedule_fallback_id: + self.store_playlist(timeslot_db, timeslot_db.schedule_fallback_id, timeslot["schedule_fallback"]) if timeslot_db.show_fallback_id: self.store_playlist(timeslot_db, timeslot_db.show_fallback_id, timeslot["show_fallback"]) 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.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) # Release the mutex @@ -202,7 +193,7 @@ class AuraCalendarService(threading.Thread): timeslot_db.musicfocus = timeslot["show_musicfocus"] 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.station_fallback_id = timeslot["station_fallback_id"] @@ -219,7 +210,6 @@ class AuraCalendarService(threading.Thread): """ if not playlist_id or not fetched_playlist: 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 playlist_db = Playlist.select_playlist_for_timeslot(timeslot_db.timeslot_start, playlist_id) @@ -233,7 +223,6 @@ class AuraCalendarService(threading.Thread): playlist_db.playlist_id = playlist_id playlist_db.timeslot_start = timeslot_db.timeslot_start playlist_db.show_name = timeslot_db.show_name - # playlist_db.fallback_type = fallbackplaylist_type if "entries" in fetched_playlist: playlist_db.entry_count = len(fetched_playlist["entries"]) else: -- GitLab