From 522904b0ec3c44a83eef10361b9f652e4142c23f Mon Sep 17 00:00:00 2001
From: David Trattnig <david.trattnig@o94.at>
Date: Thu, 29 Oct 2020 17:04:17 +0100
Subject: [PATCH] Rename "schedule" to "timeslot". #50

---
 config/sample-development.engine.ini |   4 +-
 config/sample-docker.engine.ini      |   4 +-
 config/sample-production.engine.ini  |   4 +-
 docs/developer-guide.md              |   4 +-
 docs/engine-features.md              |  14 +-
 src/base/exceptions.py               |   2 +-
 src/core/engine.py                   |   2 +-
 src/core/events.py                   |  12 +-
 src/plugins/trackservice.py          |  42 ++---
 src/scheduling/calendar.py           | 170 +++++++++---------
 src/scheduling/calender_fetcher.py   | 130 +++++++-------
 src/scheduling/fallback.py           |   8 +-
 src/scheduling/models.py             | 118 ++++++------
 src/scheduling/scheduler.py          | 256 +++++++++++++--------------
 tests/connection_tester.py           |   2 +-
 tests/test.py                        |  29 ++-
 16 files changed, 400 insertions(+), 401 deletions(-)

diff --git a/config/sample-development.engine.ini b/config/sample-development.engine.ini
index 332e7612..8a5b7de6 100644
--- a/config/sample-development.engine.ini
+++ b/config/sample-development.engine.ini
@@ -77,7 +77,7 @@ api_engine_store_health="http://localhost:8008/api/v1/source/health/${ENGINE_NUM
 
 # How often should the calendar be fetched in seconds. This determines the time of the last changes applied, before a specific show aired
 fetching_frequency=30
-# The scheduling window defines when the entries of each schedule are queued for play-out in an ideal scenario. 
+# The scheduling window defines when the entries of each timeslot are queued for play-out in an ideal scenario. 
 
 # The actual window (scheduling_window_start - scheduling_window_end) should be higher then the `fetching_frequency` to allow proper queuing. 
 # Otherwise the fetch might never hit the scheduling window, because the scheduling logic is attached to the fetching logic. 
@@ -88,7 +88,7 @@ fetching_frequency=30
 #   - Update/Delete/Assignment of playlists and entries: Those are accepted until the **end** of the the scheduling window; existing queued entries are updated
 #
 # After the end of the scheduling window the pre-loading phase starts.
-# Note, the values for windows is defined as a offset minus the actual start of the schedule in seconds.
+# Note, the values for windows is defined as a offset minus the actual start of the timeslot in seconds.
 scheduling_window_start=120
 scheduling_window_end=15
 # How many seconds before the actual schedule time the entry should be pre-rolled. Note to provide enough timeout for
diff --git a/config/sample-docker.engine.ini b/config/sample-docker.engine.ini
index 57176e37..5000c16e 100644
--- a/config/sample-docker.engine.ini
+++ b/config/sample-docker.engine.ini
@@ -77,7 +77,7 @@ api_engine_store_health="http://127.0.0.1:8008/api/v1/source/health/${ENGINE_NUM
 
 # How often should the calendar be fetched in seconds. This determines the time of the last changes applied, before a specific show aired
 fetching_frequency=300
-# The scheduling window defines when the entries of each schedule are queued for play-out in an ideal scenario. 
+# The scheduling window defines when the entries of each timeslot are queued for play-out in an ideal scenario. 
 
 # The actual window (scheduling_window_start - scheduling_window_end) should be higher then the `fetching_frequency` to allow proper queuing. 
 # Otherwise the fetch might never hit the scheduling window, because the scheduling logic is attached to the fetching logic. 
@@ -88,7 +88,7 @@ fetching_frequency=300
 #   - Update/Delete/Assignment of playlists and entries: Those are accepted until the **end** of the the scheduling window; existing queued entries are updated
 #
 # After the end of the scheduling window the pre-loading phase starts.
-# Note, the values for windows is defined as a offset minus the actual start of the schedule in seconds.
+# Note, the values for windows is defined as a offset minus the actual start of the timeslot in seconds.
 scheduling_window_start=600
 scheduling_window_end=60
 # How many seconds before the actual schedule time the entry should be pre-rolled. Note to provide enough timeout for
diff --git a/config/sample-production.engine.ini b/config/sample-production.engine.ini
index 8212604d..913629dd 100644
--- a/config/sample-production.engine.ini
+++ b/config/sample-production.engine.ini
@@ -77,7 +77,7 @@ api_engine_store_health="http://localhost:8008/api/v1/source/health/${ENGINE_NUM
 
 # How often should the calendar be fetched in seconds. This determines the time of the last changes applied, before a specific show aired
 fetching_frequency=300
-# The scheduling window defines when the entries of each schedule are queued for play-out in an ideal scenario. 
+# The scheduling window defines when the entries of each timeslot are queued for play-out in an ideal scenario. 
 
 # The actual window (scheduling_window_start - scheduling_window_end) should be higher then the `fetching_frequency` to allow proper queuing. 
 # Otherwise the fetch might never hit the scheduling window, because the scheduling logic is attached to the fetching logic. 
@@ -88,7 +88,7 @@ fetching_frequency=300
 #   - Update/Delete/Assignment of playlists and entries: Those are accepted until the **end** of the the scheduling window; existing queued entries are updated
 #
 # After the end of the scheduling window the pre-loading phase starts.
-# Note, the values for windows is defined as a offset minus the actual start of the schedule in seconds.
+# Note, the values for windows is defined as a offset minus the actual start of the timeslot in seconds.
 scheduling_window_start=600
 scheduling_window_end=60
 # How many seconds before the actual schedule time the entry should be pre-rolled. Note to provide enough timeout for
diff --git a/docs/developer-guide.md b/docs/developer-guide.md
index 97f66b68..8781ba55 100644
--- a/docs/developer-guide.md
+++ b/docs/developer-guide.md
@@ -29,7 +29,7 @@ For example:
 
     - Steering, to get the main incredient of an play-out engine: schedules (or "timeslots" in Steering terms), 
       which hold the actual information on playlists and their entries.
-    - Dashboard, to have a neat interface, being able to programm the schedules
+    - Dashboard, to have a neat interface, being able to programm the timeslots
     - Tank, to get the references to audio files and other audio sources. Plus the actual files.
 
 If you need to test and develop against the Engine's API you'll also need to get the `engine-api` project running.
@@ -63,7 +63,7 @@ When you start Engine the following is happening:
 2. Python `run.py`: Start Liquidsoap.
 3. Liquidsoap: When Liquidsoap finished its startup, it creates a socket file as configured in `socketdir` of `engine.ini`.
 4. Python `src/core/liquidsoap/client.py`: Connects to that socket file.
-5. Python `src/schedulung/scheduler.py`: Continously loads schedules from the API endpoints, stores them in the local database and starts the playout as per the schedules.
+5. Python `src/schedulung/scheduler.py`: Continously loads timeslots from the API endpoints, stores them in the local database and starts the playout as per the timeslots.
 
 ## More infos for debugging
 
diff --git a/docs/engine-features.md b/docs/engine-features.md
index 3fc39e8e..d6d29142 100644
--- a/docs/engine-features.md
+++ b/docs/engine-features.md
@@ -51,7 +51,7 @@ To configure your Icecast connectivity check-out the `[stream]` section in your
 
 Engine provide a scheduling functionality by polling external API endpoints frequently.
 
-Scheduling is split into multiple phase. Below you see a timline with one schedule planned at a certain
+Scheduling is split into multiple phase. Below you see a timline with one timeslot planned at a certain
 point in time and the involved phase before:
 
 ```ascii
@@ -72,29 +72,29 @@ point in time and the involved phase before:
     It does not involve related playlists and their entries. Those can still be modified after the
     scheduling window has started.
 
-    The start and the end of the window is defined by the start of the schedule minus
+    The start and the end of the window is defined by the start of the timeslot minus
     a configured amount of seconds (see `scheduling_window_start` and `scheduling_window_end`
     in `engine.ini`).
 
     During the scheduling window, the external API Endpoints are pulled continiously, to
-    check for updated schedules and related playlists. Also, any changes to playlists and
+    check for updated timeslots and related playlists. Also, any changes to playlists and
     its entries are respected within that window (see `fetching_frequency` in `engine.ini`).
 
     > Important: It's vital that the the scheduling window is wider than the fetching frequency.
     Otherwise one fetch might never hit a scheduling window, hence not being able to schedule stuff.
 
-- **Queuing and Pre-Loading**: Before any playlist entries of the schedule can be turned into
+- **Queuing and Pre-Loading**: Before any playlist entries of the timeslot can be turned into
     sound, they need to be queued and pre-loaded. Ideally the pre-loading happens somewhat before
     the scheduled play-out time to avoid any delays in timing. Set the maximum time reserved for
     pre-loading in your configuration (compare `preload_offset`in `engine.ini`).
 
     > Important: The offset should not exceed the time between the end of the scheduling-window and the
-    start of the actual schedule playout.
+    start of the actual timeslot playout.
 
 - **Play-out**: Finally the actual play-out is happening. The faders of the virtual mixers are pushed
     all the way up, as soon it's "time to play" for one of the pre-loaded entries.
     Transitions between playlist entries with different types of sources (file, stream and analog
-    inputs) are performed automatically. At the end of each schedule the channel is faded-out,
+    inputs) are performed automatically. At the end of each timeslot the channel is faded-out,
     no matter if the total length of the playlist entries would require a longer timeslot.
 
     If for some reason the playout is corrupted, stopped or too silent to make any sense, then
@@ -114,7 +114,7 @@ The available fallbacks are evaluated in following order:
     It's important to note, in case that playlists containing anything different than
     file entries, are ignored (i.e. live or stream content).
 
-2. **Show Fallback**: If the schedule for some show has no playlist assigned, the
+2. **Show Fallback**: If the timeslot for some show has no playlist assigned, the
     playlist assigned as a *show fallback* is used instead. In the dashboard this can
     be done as seen in the screenshot below. 
 
diff --git a/src/base/exceptions.py b/src/base/exceptions.py
index 0495625e..9e14ae38 100644
--- a/src/base/exceptions.py
+++ b/src/base/exceptions.py
@@ -23,7 +23,7 @@
 class NoProgrammeLoadedException(Exception):
     pass
 
-class NoActiveScheduleException(Exception):
+class NoActiveTimeslotException(Exception):
     pass
 
 
diff --git a/src/core/engine.py b/src/core/engine.py
index 0e3b245c..99f2d61b 100644
--- a/src/core/engine.py
+++ b/src/core/engine.py
@@ -292,7 +292,7 @@ class Player:
 
     def play(self, entry, transition):
         """
-        Plays a new `Entry`. In case of a new schedule (or some intented, immediate transition),
+        Plays a new `Entry`. In case of a new timeslot (or some intented, immediate transition),
         a clean channel is selected and transitions between old and new channel is performed.
 
         This method expects that the entry is pre-loaded using `preload(..)` or `preload_group(self, entries)`
diff --git a/src/core/events.py b/src/core/events.py
index cf2eea4d..4ab14c63 100644
--- a/src/core/events.py
+++ b/src/core/events.py
@@ -260,15 +260,15 @@ class EngineEventDispatcher():
         thread.start() 
 
 
-    def on_schedule_change(self, schedule):
+    def on_timeslot_change(self, timeslot):
         """
-        Called when the playlist or entries of the current schedule have changed.
+        Called when the playlist or entries of the current timeslot have changed.
         """
-        def func(self, schedule):        
-            self.logger.debug("on_schedule_change(..)")
-            self.call_event("on_schedule_change", schedule)
+        def func(self, timeslot):        
+            self.logger.debug("on_timeslot_change(..)")
+            self.call_event("on_timeslot_change", timeslot)
 
-        thread = Thread(target = func, args = (self, schedule))
+        thread = Thread(target = func, args = (self, timeslot))
         thread.start() 
 
 
diff --git a/src/plugins/trackservice.py b/src/plugins/trackservice.py
index 877c5e01..0d642f2d 100644
--- a/src/plugins/trackservice.py
+++ b/src/plugins/trackservice.py
@@ -96,9 +96,9 @@ class TrackServiceHandler():
         data["track_num"] = entry.entry_num
         data["track_type"] = content_class.numeric   
         data["playlist_id"] = entry.playlist.playlist_id
-        data["schedule_id"] = entry.playlist.schedule.schedule_id
-        data["show_id"] = entry.playlist.schedule.show_id
-        data["show_name"] = entry.playlist.schedule.show_name
+        data["timeslot_id"] = entry.playlist.timeslot.timeslot_id
+        data["show_id"] = entry.playlist.timeslot.show_id
+        data["show_name"] = entry.playlist.timeslot.show_name
         data["log_source"] = self.config.get("api_engine_number")    
 
         self.store_trackservice(data)
@@ -130,9 +130,9 @@ class TrackServiceHandler():
             # This is a playlog according to the scheduled playlist (normal or fallback)
             data["track_num"] = entry.entry_num
             data["playlist_id"] = entry.playlist.playlist_id
-            data["schedule_id"] = entry.playlist.schedule.schedule_id
-            data["show_id"] = entry.playlist.schedule.show_id
-            data["show_name"] = entry.playlist.schedule.show_name
+            data["timeslot_id"] = entry.playlist.timeslot.timeslot_id
+            data["show_id"] = entry.playlist.timeslot.show_id
+            data["show_name"] = entry.playlist.timeslot.show_name
         else:
             # This is a fallback playlog which wasn't scheduled actually (e.g. station fallback)
             (past, timeslot, next) = self.playlog.get_timeslots()            
@@ -193,10 +193,10 @@ class TrackServiceHandler():
                 data["current_playlist"]["entries"].append(entry)          
 
         if current_timeslot:            
-            data["current_schedule"] = current_timeslot
+            data["current_timeslot"] = current_timeslot
 
         if next_timeslot:
-            data["next_schedule"] = next_timeslot
+            data["next_timeslot"] = next_timeslot
 
 
         data = SU.clean_dictionary(data)
@@ -251,20 +251,20 @@ class Playlog:
         """
         data = {}
         self.assign_fallback_playlist(data, None)
-        data["schedule_id"] = -1
+        data["timeslot_id"] = -1
         data["show_id"] = -1
         data["show_name"] = ""
 
         if self.previous_timeslot:
-            data["schedule_start"] = self.previous_timeslot.get("schedule_end")
+            data["timeslot_start"] = self.previous_timeslot.get("timeslot_end")
         else:
-            data["schedule_start"] = datetime.now()
+            data["timeslot_start"] = datetime.now()
 
         if next_timeslot:
-            data["schedule_end"] = next_timeslot.schedule_start
+            data["timeslot_end"] = next_timeslot.timeslot_start
         else:
             # Fake the end, because the timeslot is actually not existing
-            data["schedule_end"] = datetime.now() + timedelta(hours=1) 
+            data["timeslot_end"] = datetime.now() + timedelta(hours=1) 
 
         self.current_timeslot = data
 
@@ -281,7 +281,7 @@ class Playlog:
             timeslot (Timeslot):    The current timeslot
         """
         if timeslot and self.previous_timeslot:
-            if self.previous_timeslot.get("schedule_start") == timeslot.schedule_start:
+            if self.previous_timeslot.get("timeslot_start") == timeslot.timeslot_start:
                 return # Avoid overwrite by multiple calls in a row
 
         data = {}
@@ -294,16 +294,16 @@ class Playlog:
         # A valid timeslot from the scheduler is available
         if timeslot:              
             self.assign_fallback_playlist(data, timeslot)
-            data["schedule_id"] = timeslot.schedule_id
-            data["schedule_start"] = timeslot.schedule_start
-            data["schedule_end"] = timeslot.schedule_end            
+            data["timeslot_id"] = timeslot.timeslot_id
+            data["timeslot_start"] = timeslot.timeslot_start
+            data["timeslot_end"] = timeslot.timeslot_end            
             data["show_id"] = timeslot.show_id
             data["show_name"] = timeslot.show_name            
             data = SU.clean_dictionary(data)
 
             # Any previous (fake) timeslots should get the proper end now
             if not self.previous_timeslot:  
-                self.current_timeslot["schedule_end"] = timeslot.schedule_start
+                self.current_timeslot["timeslot_end"] = timeslot.timeslot_start
             self.previous_timeslot = self.current_timeslot       
             self.current_timeslot = data
 
@@ -315,9 +315,9 @@ class Playlog:
         if next_timeslot:
             ns = {}
             self.assign_fallback_playlist(ns, next_timeslot)
-            ns["schedule_id"] = next_timeslot.schedule_id
-            ns["schedule_start"] = next_timeslot.schedule_start
-            ns["schedule_end"] = next_timeslot.schedule_end
+            ns["timeslot_id"] = next_timeslot.timeslot_id
+            ns["timeslot_start"] = next_timeslot.timeslot_start
+            ns["timeslot_end"] = next_timeslot.timeslot_end
             ns["show_id"] = next_timeslot.show_id
             ns["show_name"] = next_timeslot.show_name
             ns["playlist_id"] = next_timeslot.playlist_id
diff --git a/src/scheduling/calendar.py b/src/scheduling/calendar.py
index 4401cd5a..dd27b6a9 100644
--- a/src/scheduling/calendar.py
+++ b/src/scheduling/calendar.py
@@ -27,7 +27,7 @@ import logging
 from datetime                           import datetime
 
 from src.base.utils                     import SimpleUtil as SU
-from src.scheduling.models                    import Schedule, Playlist, PlaylistEntry, PlaylistEntryMetaData
+from src.scheduling.models                    import Timeslot, Playlist, PlaylistEntry, PlaylistEntryMetaData
 from src.scheduling.calender_fetcher    import CalendarFetcher
 
 
@@ -48,7 +48,7 @@ class AuraCalendarService(threading.Thread):
     queue = None
     config = None
     logger = None
-    fetched_schedule_data = None
+    fetched_timeslot_data = None
     calendar_fetcher = None
     stop_event = None
 
@@ -84,80 +84,80 @@ class AuraCalendarService(threading.Thread):
         deleted schedules.
 
         Returns
-            Schedule ([]):  An arrar of retrieved schedules passed via `self.queue`
+            Timeslot ([]):  An arrar of retrieved timeslots passed via `self.queue`
         """
         result = []
         now_unix = SU.timestamp()
         scheduling_window_start = self.config.get("scheduling_window_start")
 
         try:
-            fetched_schedule_data = self.calendar_fetcher.fetch()
-            self.logger.debug("Schedule data fetched from API: " + str(fetched_schedule_data))
+            fetched_timeslot_data = self.calendar_fetcher.fetch()
+            self.logger.debug("Timeslot data fetched from API: " + str(fetched_timeslot_data))
 
             # If nothing is fetched, return
-            if not fetched_schedule_data:
+            if not fetched_timeslot_data:
                 self.queue.put("fetching_aborted Nothing fetched")
                 return
             
-            # Check if existing schedules have been deleted
-            local_schedules = Schedule.select_programme(datetime.now())
-            for local_schedule in local_schedules:
+            # Check if existing timeslots have been deleted
+            local_timeslots = Timeslot.select_programme(datetime.now())
+            for local_timeslot in local_timeslots:
 
-                # Only allow deletion of schedules which are deleted before the start of the scheduling window
-                if local_schedule.start_unix > now_unix:
-                    if (local_schedule.start_unix - scheduling_window_start) > now_unix:
+                # Only allow deletion of timeslots which are deleted before the start of the scheduling window
+                if local_timeslot.start_unix > now_unix:
+                    if (local_timeslot.start_unix - scheduling_window_start) > now_unix:
 
-                        # Filter the local schedule from the fetched ones
-                        existing_schedule = list(filter(lambda new_schedule: \
-                            new_schedule["schedule_id"] == local_schedule.schedule_id, fetched_schedule_data))
+                        # Filter the local timeslot from the fetched ones
+                        existing_timeslot = list(filter(lambda new_timeslot: \
+                            new_timeslot["timeslot_id"] == local_timeslot.timeslot_id, fetched_timeslot_data))
                         
-                        if existing_schedule:
-                            # self.logger.debug("Schedule #%s is still existing remotely!" % (local_schedule.schedule_id))
+                        if existing_timeslot:
+                            # self.logger.debug("Timeslot #%s is still existing remotely!" % (local_timeslot.timeslot_id))
                             pass
                         else:
-                            self.logger.info("Schedule #%s has been deleted remotely, hence also delete it locally [%s]" % \
-                                (local_schedule.schedule_id, str(local_schedule)))
-                            local_schedule.delete(commit=True)
-                            self.logger.info("Deleted local schedule #%s from database" % local_schedule.schedule_id)
+                            self.logger.info("Timeslot #%s has been deleted remotely, hence also delete it locally [%s]" % \
+                                (local_timeslot.timeslot_id, str(local_timeslot)))
+                            local_timeslot.delete(commit=True)
+                            self.logger.info("Deleted local timeslot #%s from database" % local_timeslot.timeslot_id)
 
                     else:
-                        msg = "Schedule #%s has been deleted remotely. Since the scheduling window has already started, it won't be deleted locally." % \
-                            local_schedule.schedule_id
+                        msg = "Timeslot #%s has been deleted remotely. Since the scheduling window has already started, it won't be deleted locally." % \
+                            local_timeslot.timeslot_id
                         self.logger.error(SU.red(msg))
 
-            # Process fetched schedules    
-            for schedule in fetched_schedule_data:
+            # Process fetched timeslots    
+            for timeslot in fetched_timeslot_data:
 
-                # Check schedule for validity
-                if "start" not in schedule:
-                    self.logger.warning("No 'start' of schedule given. Skipping the schedule: %s " % str(schedule))
+                # Check timeslot for validity
+                if "start" not in timeslot:
+                    self.logger.warning("No 'start' of timeslot given. Skipping the timeslot: %s " % str(timeslot))
                     continue
-                if "end" not in schedule:
-                    self.logger.warning("No 'end' of schedule given. Skipping the schedule: %s " % str(schedule))
+                if "end" not in timeslot:
+                    self.logger.warning("No 'end' of timeslot given. Skipping the timeslot: %s " % str(timeslot))
                     continue
 
-                # Store the schedule
-                schedule_db = self.store_schedule(schedule)
+                # Store the timeslot
+                timeslot_db = self.store_timeslot(timeslot)
 
                 # Store playlists to play
-                self.store_playlist(schedule_db, schedule_db.playlist_id, schedule["playlist"])
-                if schedule_db.schedule_fallback_id:
-                    self.store_playlist(schedule_db, schedule_db.schedule_fallback_id, schedule["schedule_fallback"])
-                if schedule_db.show_fallback_id:
-                    self.store_playlist(schedule_db, schedule_db.show_fallback_id, schedule["show_fallback"])
-                if schedule_db.station_fallback_id:
-                    self.store_playlist(schedule_db, schedule_db.station_fallback_id, schedule["station_fallback"])
+                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.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(schedule_db, schedule_db.playlist_id, schedule["playlist"], PlaylistType.DEFAULT.id)
-                # if schedule_db.schedule_fallback_id:
-                #     self.store_playlist(schedule_db, schedule_db.schedule_fallback_id, schedule["schedule_fallback"], PlaylistType.TIMESLOT.id)
-                # if schedule_db.show_fallback_id:
-                #     self.store_playlist(schedule_db, schedule_db.show_fallback_id, schedule["show_fallback"], PlaylistType.SHOW.id)
-                # if schedule_db.station_fallback_id:
-                #     self.store_playlist(schedule_db, schedule_db.station_fallback_id, schedule["station_fallback"], PlaylistType.STATION.id)
+                # 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(schedule_db)
+                result.append(timeslot_db)
 
             # Release the mutex
             self.queue.put(result)
@@ -171,49 +171,49 @@ class AuraCalendarService(threading.Thread):
 
 
 
-    def store_schedule(self, schedule):
+    def store_timeslot(self, timeslot):
         """
-        Stores the given schedule to the database.
+        Stores the given timeslot to the database.
 
         Args:
-            schedule (Schedule):    The schedule
+            timeslot (Timeslot):    The timeslot
         """
-        schedule_db = Schedule.select_show_on_datetime(schedule["start"])
+        timeslot_db = Timeslot.select_show_on_datetime(timeslot["start"])
         havetoadd = False
 
-        if not schedule_db:
-            self.logger.debug("no schedule with given schedule id in database => create new")
-            schedule_db = Schedule()
+        if not timeslot_db:
+            self.logger.debug("no timeslot with given timeslot id in database => create new")
+            timeslot_db = Timeslot()
             havetoadd = True
 
 
-        schedule_db.show_id = schedule["show_id"]
-        schedule_db.schedule_id = schedule["schedule_id"]
-        schedule_db.schedule_start = schedule["start"]
-        schedule_db.schedule_end = schedule["end"]
-        schedule_db.show_name = schedule["show_name"]
-        schedule_db.show_hosts = schedule["show_hosts"]
-        schedule_db.is_repetition = schedule["is_repetition"]
-        schedule_db.funding_category = schedule["show_fundingcategory"]
-        schedule_db.languages = schedule["show_languages"]
-        schedule_db.type = schedule["show_type"]
-        schedule_db.category = schedule["show_categories"]
-        schedule_db.topic = schedule["show_topics"]
-        schedule_db.musicfocus = schedule["show_musicfocus"]
+        timeslot_db.show_id = timeslot["show_id"]
+        timeslot_db.timeslot_id = timeslot["timeslot_id"]
+        timeslot_db.timeslot_start = timeslot["start"]
+        timeslot_db.timeslot_end = timeslot["end"]
+        timeslot_db.show_name = timeslot["show_name"]
+        timeslot_db.show_hosts = timeslot["show_hosts"]
+        timeslot_db.is_repetition = timeslot["is_repetition"]
+        timeslot_db.funding_category = timeslot["show_fundingcategory"]
+        timeslot_db.languages = timeslot["show_languages"]
+        timeslot_db.type = timeslot["show_type"]
+        timeslot_db.category = timeslot["show_categories"]
+        timeslot_db.topic = timeslot["show_topics"]
+        timeslot_db.musicfocus = timeslot["show_musicfocus"]
 
-        schedule_db.playlist_id = schedule["playlist_id"]
-        schedule_db.schedule_fallback_id = schedule["schedule_fallback_id"]
-        schedule_db.show_fallback_id = schedule["show_fallback_id"]
-        schedule_db.station_fallback_id = schedule["station_fallback_id"]
+        timeslot_db.playlist_id = timeslot["playlist_id"]
+        timeslot_db.timeslot_fallback_id = timeslot["timeslot_fallback_id"]
+        timeslot_db.show_fallback_id = timeslot["show_fallback_id"]
+        timeslot_db.station_fallback_id = timeslot["station_fallback_id"]
 
-        schedule_db.store(add=havetoadd, commit=True)
+        timeslot_db.store(add=havetoadd, commit=True)
 
-        return schedule_db
+        return timeslot_db
 
 
 
-    # def store_playlist(self, schedule_db, playlist_id, fetched_playlist, fallbackplaylist_type=0):
-    def store_playlist(self, schedule_db, playlist_id, fetched_playlist):
+    # def store_playlist(self, timeslot_db, playlist_id, fetched_playlist, fallbackplaylist_type=0):
+    def store_playlist(self, timeslot_db, playlist_id, fetched_playlist):
         """
         Stores the Playlist to the database.
         """
@@ -222,17 +222,17 @@ class AuraCalendarService(threading.Thread):
             # self.logger.debug("Playlist type %s with ID '%s' is not available!" % (fallbackplaylist_type, playlist_id))
             return
             
-        playlist_db = Playlist.select_playlist_for_schedule(schedule_db.schedule_start, playlist_id)
+        playlist_db = Playlist.select_playlist_for_timeslot(timeslot_db.timeslot_start, playlist_id)
         havetoadd = False
 
         if not playlist_db:
             playlist_db = Playlist()
             havetoadd = True
 
-        self.logger.debug("Storing playlist %d for schedule (%s)" % (playlist_id, str(schedule_db)))
+        self.logger.debug("Storing playlist %d for timeslot (%s)" % (playlist_id, str(timeslot_db)))
         playlist_db.playlist_id = playlist_id
-        playlist_db.schedule_start = schedule_db.schedule_start
-        playlist_db.show_name = schedule_db.show_name
+        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"])
@@ -242,20 +242,20 @@ class AuraCalendarService(threading.Thread):
         playlist_db.store(havetoadd, commit=True)
       
         if playlist_db.entry_count > 0:
-            self.store_playlist_entries(schedule_db, playlist_db, fetched_playlist)
+            self.store_playlist_entries(timeslot_db, playlist_db, fetched_playlist)
 
         return playlist_db
 
 
 
-    def store_playlist_entries(self, schedule_db, playlist_db, fetched_playlist):
+    def store_playlist_entries(self, timeslot_db, playlist_db, fetched_playlist):
         """
         Stores the playlist entries to the database.
         """
         entry_num = 0
         time_marker = playlist_db.start_unix
 
-        self.expand_entry_duration(schedule_db, fetched_playlist)
+        self.expand_entry_duration(timeslot_db, fetched_playlist)
         self.delete_orphaned_entries(playlist_db, fetched_playlist)  
 
         for entry in fetched_playlist["entries"]:
@@ -305,13 +305,13 @@ class AuraCalendarService(threading.Thread):
             entry_num += 1
 
 
-    def expand_entry_duration(self, schedule_db, fetched_playlist):
+    def expand_entry_duration(self, timeslot_db, fetched_playlist):
         """
         If some playlist entry doesn't have a duration assigned, its duration is expanded to the
-        remaining duration of the playlist (= schedule duration minus playlist entries with duration).
+        remaining duration of the playlist (= timeslot duration minus playlist entries with duration).
         If there's more than one entry without duration, such entries are removed from the playlist.
         """
-        total_seconds = (schedule_db.schedule_end - schedule_db.schedule_start).total_seconds()
+        total_seconds = (timeslot_db.timeslot_end - timeslot_db.timeslot_start).total_seconds()
         total_duration = SU.seconds_to_nano(total_seconds)
         actual_duration = 0        
         missing_duration = []
diff --git a/src/scheduling/calender_fetcher.py b/src/scheduling/calender_fetcher.py
index dd869346..e227d3d2 100644
--- a/src/scheduling/calender_fetcher.py
+++ b/src/scheduling/calender_fetcher.py
@@ -30,13 +30,13 @@ from src.base.utils import SimpleUtil as SU
 
 class CalendarFetcher:
     """
-    Fetches the schedules, playlists and playlist entries as JSON
+    Fetches the timeslots, playlists and playlist entries as JSON
     via the API endpoints of Steering and Tank.
     """
     config = None
     logging = None
     has_already_fetched = False
-    fetched_schedule_data = None
+    fetched_timeslot_data = None
 
     # Config for API Endpoints
     steering_calendar_url = None
@@ -72,37 +72,37 @@ class CalendarFetcher:
         """
         return_data = []
 
-        self.logger.debug("Fetching schedules from STEERING")
-        self.fetched_schedule_data = self.fetch_schedule_data()
-        if not self.fetched_schedule_data:
-            self.logger.critical(SU.red("No schedules fetched from API!"))
+        self.logger.debug("Fetching timeslots from STEERING")
+        self.fetched_timeslot_data = self.fetch_timeslot_data()
+        if not self.fetched_timeslot_data:
+            self.logger.critical(SU.red("No timeslots fetched from API!"))
             return None
 
         self.logger.debug("Fetching playlists from TANK")
         self.fetch_playlists()
 
         try:
-            for schedule in self.fetched_schedule_data:
-                # Skip schedule if no start or end is given
-                if "start" not in schedule:
-                    self.logger.warning("No start of schedule given. Skipping schedule: " + str(schedule))
-                    schedule = None
-                if "end" not in schedule:
-                    self.logger.warning("No end of schedule given. Skipping schedule: " + str(schedule))
-                    schedule = None
-                if "playlist" not in schedule \
-                    and "show_fallback" not in schedule \
-                    and "schedule_fallback" not in schedule \
-                    and "station_fallback" not in schedule:
+            for timeslot in self.fetched_timeslot_data:
+                # Skip timeslot if no start or end is given
+                if "start" not in timeslot:
+                    self.logger.warning("No start of timeslot given. Skipping timeslot: " + str(timeslot))
+                    timeslot = None
+                if "end" not in timeslot:
+                    self.logger.warning("No end of timeslot given. Skipping timeslot: " + str(timeslot))
+                    timeslot = None
+                if "playlist" not in timeslot \
+                    and "show_fallback" not in timeslot \
+                    and "schedule_fallback" not in timeslot \
+                    and "station_fallback" not in timeslot:
                     
-                    self.logger.warning("No playlist for schedule given. Skipping schedule: " + str(schedule))
-                    schedule = None
+                    self.logger.warning("No playlist for timeslot given. Skipping timeslot: " + str(timeslot))
+                    timeslot = None
 
-                if schedule:
-                    return_data.append(schedule)
+                if timeslot:
+                    return_data.append(timeslot)
         except TypeError:
             self.logger.error(SU.red("Nothing fetched ..."))
-            self.fetched_schedule_data = None
+            self.fetched_timeslot_data = None
             return None
 
         return return_data
@@ -114,59 +114,59 @@ class CalendarFetcher:
     #
 
 
-    def fetch_schedule_data(self):
+    def fetch_timeslot_data(self):
         """
-        Fetches schedule data from Steering.
+        Fetches timeslot data from Steering.
 
         Returns:
-            ([Schedule]):   An array of schedules
+            ([Timeslot]):   An array of timeslots
         """
-        schedule = None
+        timeslot = None
         headers = { "content-type": "application/json" }
        
         try:
-            self.logger.debug("Fetch schedules from Steering API...")                
+            self.logger.debug("Fetch timeslots from Steering API...")                
             response = requests.get(self.steering_calendar_url, data=None, headers=headers)
             if not response.status_code == 200:
-                self.logger.critical(SU.red("HTTP Status: %s | Schedules could not be fetched! Response: %s" % \
+                self.logger.critical(SU.red("HTTP Status: %s | Timeslots could not be fetched! Response: %s" % \
                     (str(response.status_code), response.text)))
                 return None            
-            schedule = response.json()                
+            timeslot = response.json()                
         except Exception as e:
-            self.logger.critical(SU.red("Error while requesting schedules from Steering!"), e)
+            self.logger.critical(SU.red("Error while requesting timeslots from Steering!"), e)
 
-        if not schedule:
-            self.logger.error(SU.red("Got no schedule via Playout API (Steering)!"))
+        if not timeslot:
+            self.logger.error(SU.red("Got no timeslot via Playout API (Steering)!"))
             return None
 
-        return self.remove_unnecessary_data(schedule)
+        return self.remove_unnecessary_data(timeslot)
 
 
 
     def fetch_playlists(self):
         """
-        Fetches all playlists including fallback playlists for every schedule.
-        This method used the class member `fetched_schedule_data`` to iterate
-        over and extend schedule data.
+        Fetches all playlists including fallback playlists for every timeslot.
+        This method used the class member `fetched_timeslot_data`` to iterate
+        over and extend timeslot data.
         """
         # store fetched entries => do not have to fetch playlist_id more than once
         fetched_entries=[]
 
         try:
-            for schedule in self.fetched_schedule_data:
+            for timeslot in self.fetched_timeslot_data:
 
                 # Get IDs of playlists
-                playlist_id = self.get_playlist_id(schedule, "playlist_id")
-                schedule_fallback_id = self.get_playlist_id(schedule, "schedule_fallback_id")
-                show_fallback_id = self.get_playlist_id(schedule, "show_fallback_id")
-                station_fallback_id = self.get_playlist_id(schedule, "station_fallback_id")
+                playlist_id = self.get_playlist_id(timeslot, "playlist_id")
+                schedule_fallback_id = self.get_playlist_id(timeslot, "schedule_fallback_id")
+                show_fallback_id = self.get_playlist_id(timeslot, "show_fallback_id")
+                station_fallback_id = self.get_playlist_id(timeslot, "station_fallback_id")
 
-                # Retrieve playlist and the fallback playlists for every schedule.
+                # Retrieve playlist and the fallback playlists for every timeslot.
                 # If a playlist (like station_fallback) is already fetched, it is not fetched again but reused
-                schedule["playlist"]          = self.fetch_playlist(playlist_id,          fetched_entries)
-                schedule["schedule_fallback"] = self.fetch_playlist(schedule_fallback_id, fetched_entries)
-                schedule["show_fallback"]     = self.fetch_playlist(show_fallback_id,     fetched_entries)
-                schedule["station_fallback"]  = self.fetch_playlist(station_fallback_id,  fetched_entries)
+                timeslot["playlist"]          = self.fetch_playlist(playlist_id,          fetched_entries)
+                timeslot["schedule_fallback"] = self.fetch_playlist(schedule_fallback_id, fetched_entries)
+                timeslot["show_fallback"]     = self.fetch_playlist(show_fallback_id,     fetched_entries)
+                timeslot["station_fallback"]  = self.fetch_playlist(station_fallback_id,  fetched_entries)
 
         except Exception as e:
             self.logger.error("Error while fetching playlists from API endpoints: " + str(e), e)
@@ -175,7 +175,7 @@ class CalendarFetcher:
 
     def fetch_playlist(self, playlist_id, fetched_playlists):
         """
-        Fetches the playlist for a given schedule.
+        Fetches the playlist for a given timeslot.
 
         Args:
             id_name (String):       The type of playlist to fetch (e.g. normal vs. fallback)
@@ -216,37 +216,37 @@ class CalendarFetcher:
  
 
 
-    def get_playlist_id(self, schedule, id_name):
+    def get_playlist_id(self, timeslot, id_name):
         """
         Extracts the playlist ID for a given playlist (fallback) type.
         """
-        playlist_id = str(schedule[id_name])
+        playlist_id = str(timeslot[id_name])
         if not playlist_id or playlist_id == "None":
-            self.logger.debug("No value defined for '%s' in schedule '#%s'" % (id_name, schedule["schedule_id"]))
+            self.logger.debug("No value defined for '%s' in timeslot '#%s'" % (id_name, timeslot["timeslot_id"]))
             return None
         
         return playlist_id
 
 
-    def remove_unnecessary_data(self, schedule):
+    def remove_unnecessary_data(self, timeslot):
         """
-        Removes all schedules which are not relevant for 
+        Removes all timeslots which are not relevant for 
         further processing.
         """
-        count_before = len(schedule)
-        schedule = self.remove_data_more_than_24h_in_the_future(schedule)
-        schedule = self.remove_data_in_the_past(schedule)
-        count_after = len(schedule)
+        count_before = len(timeslot)
+        timeslot = self.remove_data_more_than_24h_in_the_future(timeslot)
+        timeslot = self.remove_data_in_the_past(timeslot)
+        count_after = len(timeslot)
 
-        self.logger.debug("Removed %d unnecessary schedules from response. Entries left: %d" % ((count_before - count_after), count_after))
-        return schedule
+        self.logger.debug("Removed %d unnecessary timeslots from response. Entries left: %d" % ((count_before - count_after), count_after))
+        return timeslot
 
 
-    def remove_data_more_than_24h_in_the_future(self, schedules):
+    def remove_data_more_than_24h_in_the_future(self, timeslots):
         """ 
         Removes entries 24h in the future and 12 hours in the past.
         Note: This might influence resuming (in case of a crash)  
-        single schedules which are longer than 12 hours long.
+        single timeslots which are longer than 12 hours long.
         Think e.g. live broadcasts.
         """
         items = []
@@ -254,7 +254,7 @@ class CalendarFetcher:
         now_plus_24hours = now + (12*60*60)
         now_minus_12hours = now - (12*60*60)
 
-        for s in schedules:
+        for s in timeslots:
             start_time = datetime.strptime(s["start"], "%Y-%m-%dT%H:%M:%S")
             start_time = SU.timestamp(start_time)
 
@@ -264,14 +264,14 @@ class CalendarFetcher:
         return items
 
 
-    def remove_data_in_the_past(self, schedules):
+    def remove_data_in_the_past(self, timeslots):
         """
-        Removes all schedules from the past, except the one which is 
+        Removes all timeslots from the past, except the one which is 
         currently playing.
         """
         items = []
         now = SU.timestamp()
-        for s in schedules:
+        for s in timeslots:
             start_time = datetime.strptime(s["start"], "%Y-%m-%dT%H:%M:%S")
             start_time = SU.timestamp(start_time)
             end_time = datetime.strptime(s["end"], "%Y-%m-%dT%H:%M:%S")
diff --git a/src/scheduling/fallback.py b/src/scheduling/fallback.py
index 307ad88d..8e007177 100644
--- a/src/scheduling/fallback.py
+++ b/src/scheduling/fallback.py
@@ -96,7 +96,7 @@ class FallbackManager:
             self.logger.info(f"Resolved {fallback_type.value} fallback")         
             return FallbackCommand(timeslot, playlist.entries)
         else:
-            msg = f"There is no schedule- or show-fallback defined for timeslot#{timeslot.schedule_id}. "
+            msg = f"There is no timeslot- or show-fallback defined for timeslot#{timeslot.timeslot_id}. "
             msg += f"The station fallback will be used automatically."
             self.logger.info(msg)
 
@@ -108,7 +108,7 @@ class FallbackManager:
         this one is returned. In case of station fallback no playlist is returned.
 
         Args:
-            timeslot (Schedule)
+            timeslot (Timeslot)
         
         Returns:
             (FallbackType, Playlist)
@@ -131,7 +131,7 @@ class FallbackManager:
         Retrieves the playlist to be used in a fallback scenario.
 
         Args: 
-            timeslot (Schedule)
+            timeslot (Timeslot)
 
         Returns:
             (Playlist)
@@ -222,7 +222,7 @@ class FallbackCommand(EngineExecutor):
 
         # Start fade-out 50% before the end of the timeslot for a more smooth transition
         end_time_offset = int(float(AuraConfig.config().get("fade_out_time")) / 2 * 1000 * -1)
-        end_time = SU.timestamp(timeslot.schedule_end + timedelta(milliseconds=end_time_offset))
+        end_time = SU.timestamp(timeslot.timeslot_end + timedelta(milliseconds=end_time_offset))
         self.logger.info(f"Starting fade-out of scheduled fallback with an offset of {end_time_offset} milliseconds at {end_time}")
         child_timer = EngineExecutor("FALLBACK", None, end_time, do_stop, None)
         super().__init__("FALLBACK", child_timer, timeslot.start_unix, do_play, entries)
\ No newline at end of file
diff --git a/src/scheduling/models.py b/src/scheduling/models.py
index 430dae8e..7cd8373e 100644
--- a/src/scheduling/models.py
+++ b/src/scheduling/models.py
@@ -104,16 +104,16 @@ class AuraDatabaseModel():
         """
         Re-creates the database for developments purposes.
         """
-        manualschedule = Schedule()
-        manualschedule.schedule_id = 0
-        manualschedule.show_name = "Manual Show"
+        manualtimeslot = Timeslot()
+        manualtimeslot.timeslot_id = 0
+        manualtimeslot.show_name = "Manual Show"
         Base.metadata.drop_all()
         Base.metadata.create_all()
 
         
-        # self.logger.debug("inserting manual scheduling possibility and fallback trackservice schedule")
-        # DB.session.add(manualschedule)
-        # db.session.add(fallback_trackservice_schedule)
+        # self.logger.debug("inserting manual scheduling possibility and fallback trackservice timeslot")
+        # DB.session.add(manualtimeslot)
+        # db.session.add(fallback_trackservice_timeslot)
         # self.logger.debug("all created. commiting...")
         DB.session.commit()
 
@@ -127,19 +127,19 @@ class AuraDatabaseModel():
 #
 
 
-class Schedule(DB.Model, AuraDatabaseModel):
+class Timeslot(DB.Model, AuraDatabaseModel):
     """
-    One specific Schedule for a show on a timeslot.
+    One specific Timeslot for a show on a timeslot.
     Holding references to playlists and fallback-playlists.
     """
-    __tablename__ = 'schedule'
+    __tablename__ = 'timeslot'
 
     # Primary keys
     id = Column(Integer, primary_key=True, autoincrement=True)
 
-    schedule_start = Column(DateTime, unique=True, index=True)
-    schedule_end = Column(DateTime, unique=True, index=True)
-    schedule_id = Column(Integer, unique=True)
+    timeslot_start = Column(DateTime, unique=True, index=True)
+    timeslot_end = Column(DateTime, unique=True, index=True)
+    timeslot_id = Column(Integer, unique=True)
 
     show_id = Column(Integer)
     show_name = Column(String(256))
@@ -159,58 +159,58 @@ class Schedule(DB.Model, AuraDatabaseModel):
     show_fallback_id = Column(Integer)
     station_fallback_id = Column(Integer)
     
-    fadeouttimer = None # Used to fade-out the schedule, even when entries are longer
+    fadeouttimer = None # Used to fade-out the timeslot, even when entries are longer
 
     playlist = relationship("Playlist",
-                            primaryjoin="and_(Schedule.schedule_start==Playlist.schedule_start, Schedule.playlist_id==Playlist.playlist_id, Schedule.show_name==Playlist.show_name)",
-                            back_populates="schedule")
+                            primaryjoin="and_(Timeslot.timeslot_start==Playlist.timeslot_start, Timeslot.playlist_id==Playlist.playlist_id, Timeslot.show_name==Playlist.show_name)",
+                            back_populates="timeslot")
     schedule_fallback = relationship("Playlist",
-                            primaryjoin="and_(Schedule.schedule_start==Playlist.schedule_start, Schedule.schedule_fallback_id==Playlist.playlist_id, Schedule.show_name==Playlist.show_name)",
-                            back_populates="schedule")
+                            primaryjoin="and_(Timeslot.timeslot_start==Playlist.timeslot_start, Timeslot.schedule_fallback_id==Playlist.playlist_id, Timeslot.show_name==Playlist.show_name)",
+                            back_populates="timeslot")
     show_fallback = relationship("Playlist",
-                            primaryjoin="and_(Schedule.schedule_start==Playlist.schedule_start, Schedule.show_fallback_id==Playlist.playlist_id, Schedule.show_name==Playlist.show_name)",
-                            back_populates="schedule")
+                            primaryjoin="and_(Timeslot.timeslot_start==Playlist.timeslot_start, Timeslot.show_fallback_id==Playlist.playlist_id, Timeslot.show_name==Playlist.show_name)",
+                            back_populates="timeslot")
     station_fallback = relationship("Playlist",
-                            primaryjoin="and_(Schedule.schedule_start==Playlist.schedule_start, Schedule.station_fallback_id==Playlist.playlist_id, Schedule.show_name==Playlist.show_name)",
-                            back_populates="schedule")
+                            primaryjoin="and_(Timeslot.timeslot_start==Playlist.timeslot_start, Timeslot.station_fallback_id==Playlist.playlist_id, Timeslot.show_name==Playlist.show_name)",
+                            back_populates="timeslot")
 
 
     @staticmethod
     def select_show_on_datetime(date_time):
-        return DB.session.query(Schedule).filter(Schedule.schedule_start == date_time).first()
+        return DB.session.query(Timeslot).filter(Timeslot.timeslot_start == date_time).first()
 
 
     @staticmethod
     def select_programme(date_from=datetime.date.today()):
         """
-        Select all schedules starting from `date_from` or from today if no
+        Select all timeslots starting from `date_from` or from today if no
         parameter is passed.
 
         Args:
-            date_from (datetime):   Select schedules from this date and time on
+            date_from (datetime):   Select timeslots from this date and time on
 
         Returns:
-            ([Schedule]):           List of schedules
+            ([Timeslot]):           List of timeslots
         """
-        schedules = DB.session.query(Schedule).\
-            filter(Schedule.schedule_start >= date_from).\
-            order_by(Schedule.schedule_start).all()
+        timeslots = DB.session.query(Timeslot).\
+            filter(Timeslot.timeslot_start >= date_from).\
+            order_by(Timeslot.timeslot_start).all()
 
-        return schedules
+        return timeslots
 
 
     @staticmethod
     def select_upcoming(n):
         """
-        Selects the (`n`) upcoming schedules.
+        Selects the (`n`) upcoming timeslots.
         """
         now = datetime.datetime.now()
         DB.session.commit() # Required since independend session is used.
-        schedules = DB.session.query(Schedule).\
-            filter(Schedule.schedule_start > str(now)).\
-            order_by(Schedule.schedule_start.asc()).limit(n).all()
+        timeslots = DB.session.query(Timeslot).\
+            filter(Timeslot.timeslot_start > str(now)).\
+            order_by(Timeslot.timeslot_start.asc()).limit(n).all()
         
-        return schedules
+        return timeslots
 
 
     def get_playlist(self):
@@ -237,29 +237,29 @@ class Schedule(DB.Model, AuraDatabaseModel):
     @hybrid_property
     def start_unix(self):
         """
-        Start time of the schedule in UNIX time.
+        Start time of the timeslot in UNIX time.
         """
-        return time.mktime(self.schedule_start.timetuple())
+        return time.mktime(self.timeslot_start.timetuple())
 
 
     @hybrid_property
     def end_unix(self):
         """
-        End time of the schedule in UNIX time.
+        End time of the timeslot in UNIX time.
         """
-        return time.mktime(self.schedule_end.timetuple())
+        return time.mktime(self.timeslot_end.timetuple())
 
 
     def as_dict(self):
         """
-        Returns the schedule as a dictionary for serialization.
+        Returns the timeslot as a dictionary for serialization.
         """
         playlist = self.playlist
 
         return {
-            "schedule_id": self.schedule_id,        
-            "schedule_start": self.schedule_start.isoformat(),
-            "schedule_end": self.schedule_end.isoformat(),
+            "timeslot_id": self.timeslot_id,        
+            "timeslot_start": self.timeslot_start.isoformat(),
+            "timeslot_end": self.timeslot_end.isoformat(),
 
             "topic": self.topic,
             "musicfocus": self.musicfocus,
@@ -288,7 +288,7 @@ class Schedule(DB.Model, AuraDatabaseModel):
         """
         time_start = SimpleUtil.fmt_time(self.start_unix)
         time_end = SimpleUtil.fmt_time(self.end_unix)
-        return "ID#%s [Show: %s, ShowID: %s | %s - %s ]" % (str(self.schedule_id), self.show_name, str(self.show_id), time_start, time_end)
+        return "ID#%s [Show: %s, ShowID: %s | %s - %s ]" % (str(self.timeslot_id), self.show_name, str(self.show_id), time_start, time_end)
 
 
 
@@ -300,12 +300,12 @@ class Playlist(DB.Model, AuraDatabaseModel):
 
     # pk,fk
     artificial_id = Column(Integer, primary_key=True)
-    schedule_start = Column(DateTime, ForeignKey("schedule.schedule_start"))
+    timeslot_start = Column(DateTime, ForeignKey("timeslot.timeslot_start"))
     # relationships
-    schedule = relationship("Schedule", uselist=False, back_populates="playlist")
+    timeslot = relationship("Timeslot", uselist=False, back_populates="playlist")
     entries = relationship("PlaylistEntry", back_populates="playlist")
     # data
-    playlist_id = Column(Integer, autoincrement=False)  # , ForeignKey("schedule.playlist_id"))
+    playlist_id = Column(Integer, autoincrement=False)  # , ForeignKey("timeslot.playlist_id"))
     show_name = Column(String(256))
     entry_count = Column(Integer)
 
@@ -326,24 +326,24 @@ class Playlist(DB.Model, AuraDatabaseModel):
 
 
     @staticmethod
-    def select_playlist_for_schedule(start_date, playlist_id):
+    def select_playlist_for_timeslot(start_date, playlist_id):
         """
-        Retrieves the playlist for the given schedule identified by `start_date` and `playlist_id`
+        Retrieves the playlist for the given timeslot identified by `start_date` and `playlist_id`
 
         Args:
             start_date (datetime):  Date and time when the playlist is scheduled
             playlist_id (Integer):  The ID of the playlist
 
         Returns:
-            (Playlist):             The playlist, if existing for schedule
+            (Playlist):             The playlist, if existing for timeslot
 
         Raises:
             Exception:              In case there a inconsistent database state, such es multiple playlists for given date/time.
         """
         playlist = None
-        playlists = DB.session.query(Playlist).filter(Playlist.schedule_start == start_date).all()
+        playlists = DB.session.query(Playlist).filter(Playlist.timeslot_start == start_date).all()
         # FIXME There are unknown issues with the native SQL query by ID
-        # playlists = DB.session.query(Playlist).filter(Playlist.schedule_start == datetime and Playlist.playlist_id == playlist_id).all()
+        # playlists = DB.session.query(Playlist).filter(Playlist.timeslot_start == datetime and Playlist.playlist_id == playlist_id).all()
         
         for p in playlists:
             if p.playlist_id == playlist_id:
@@ -363,7 +363,7 @@ class Playlist(DB.Model, AuraDatabaseModel):
         Returns:
             (Array<Playlist>):      An array holding the playlists
         """
-        return DB.session.query(Playlist).filter(Playlist.playlist_id == playlist_id).order_by(Playlist.schedule_start).all()
+        return DB.session.query(Playlist).filter(Playlist.playlist_id == playlist_id).order_by(Playlist.timeslot_start).all()
     
 
     @staticmethod
@@ -382,7 +382,7 @@ class Playlist(DB.Model, AuraDatabaseModel):
         """
         Start time of the playlist in UNIX time.
         """
-        return time.mktime(self.schedule_start.timetuple())
+        return time.mktime(self.timeslot_start.timetuple())
 
 
     @hybrid_property
@@ -390,7 +390,7 @@ class Playlist(DB.Model, AuraDatabaseModel):
         """
         End time of the playlist in UNIX time.
         """
-        return time.mktime(self.schedule_start.timetuple()) + self.duration
+        return time.mktime(self.timeslot_start.timetuple()) + self.duration
 
 
     @hybrid_property
@@ -525,13 +525,13 @@ class PlaylistEntry(DB.Model, AuraDatabaseModel):
         return prev_entries
 
 
-    def get_next_entries(self, schedule_sensitive=True):
+    def get_next_entries(self, timeslot_sensitive=True):
         """
         Retrieves all following entries as part of the current entry's playlist.
 
         Args:
-            schedule_sensitive (Boolean):   If `True` entries which start after \
-                the end of the schedule are excluded
+            timeslot_sensitive (Boolean):   If `True` entries which start after \
+                the end of the timeslot are excluded
 
         Returns:
             (List):     List of PlaylistEntry
@@ -539,8 +539,8 @@ class PlaylistEntry(DB.Model, AuraDatabaseModel):
         next_entries = []
         for entry in self.playlist.entries:
             if entry.entry_start > self.entry_start:
-                if schedule_sensitive:
-                    if entry.entry_start < self.playlist.schedule.schedule_end:
+                if timeslot_sensitive:
+                    if entry.entry_start < self.playlist.timeslot.timeslot_end:
                         next_entries.append(entry)
                 else:
                     next_entries.append(entry)
diff --git a/src/scheduling/scheduler.py b/src/scheduling/scheduler.py
index 416ce1fa..91a3f44a 100644
--- a/src/scheduling/scheduler.py
+++ b/src/scheduling/scheduler.py
@@ -29,8 +29,8 @@ from datetime                   import datetime, timedelta
 
 from src.base.config            import AuraConfig
 from src.base.utils             import SimpleUtil as SU
-from src.scheduling.models            import AuraDatabaseModel, Schedule, Playlist
-from src.base.exceptions        import NoActiveScheduleException, LoadSourceException
+from src.scheduling.models            import AuraDatabaseModel, Timeslot, Playlist
+from src.base.exceptions        import NoActiveTimeslotException, LoadSourceException
 from src.core.control           import EngineExecutor
 from src.core.engine            import Engine
 from src.core.channels          import ChannelType, TransitionType, EntryPlayState
@@ -118,8 +118,8 @@ class AuraScheduler(threading.Thread):
         Called when thread is started via `start()`. It does the following:
         
             1. `self.fetch_new_programme()` periodically from the API depending on the `fetching_frequency` defined in the engine configuration. 
-            2. Loads the latest programme from the database and sets the instance state `self.programme` with current schedules.
-            3. Queues all schedules of the programme, if the soundssystem is ready to accept commands.
+            2. Loads the latest programme from the database and sets the instance state `self.programme` with current timeslots.
+            3. Queues all timeslots of the programme, if the soundssystem is ready to accept commands.
 
         On every cycle the configuration file is reloaded, to allow modifications while running the engine.
         """
@@ -127,7 +127,7 @@ class AuraScheduler(threading.Thread):
             try:
                 self.config.load_config()
                 seconds_to_wait = int(self.config.get("fetching_frequency"))
-                self.logger.info(SU.cyan(f"== start fetching new schedules (every {seconds_to_wait} seconds) =="))
+                self.logger.info(SU.cyan(f"== start fetching new timeslots (every {seconds_to_wait} seconds) =="))
                 
                 # Load some stuff from the API in any case
                 self.fetch_new_programme()
@@ -152,7 +152,7 @@ class AuraScheduler(threading.Thread):
                         
             # FIXME better location for call
             if self.engine.event_dispatcher:
-                current_timeslot = self.get_active_schedule()
+                current_timeslot = self.get_active_timeslot()
                 self.engine.event_dispatcher.on_timeslot(current_timeslot)
             
             EngineExecutor.log_commands()            
@@ -181,7 +181,7 @@ class AuraScheduler(threading.Thread):
         try:
             self.play_active_entry()
             self.queue_startup_entries()
-        except NoActiveScheduleException:
+        except NoActiveTimeslotException:
             # That's not good, but keep on working...
             pass
 
@@ -193,23 +193,23 @@ class AuraScheduler(threading.Thread):
         Usually called when the Engine boots.
 
         Raises:
-            (NoActiveScheduleException):    If there's no schedule in the programme, within the scheduling window
+            (NoActiveTimeslotException):    If there's no timeslot in the programme, within the scheduling window
         """
         sleep_offset = 10
-        active_schedule = self.get_active_schedule()
+        active_timeslot = self.get_active_timeslot()
 
         # Schedule any available fallback playlist
-        if active_schedule:
-            self.fallback.queue_fallback_playlist(active_schedule)
-            # Queue the fade-out of the schedule
-            if not active_schedule.fadeouttimer:
-                self.queue_end_of_schedule(active_schedule, True)
+        if active_timeslot:
+            self.fallback.queue_fallback_playlist(active_timeslot)
+            # Queue the fade-out of the timeslot
+            if not active_timeslot.fadeouttimer:
+                self.queue_end_of_timeslot(active_timeslot, True)
 
         active_entry = self.get_active_entry()
         if not active_entry:
-            raise NoActiveScheduleException
+            raise NoActiveTimeslotException
 
-        # In case of a file-system source, we need to fast-foward to the current marker as per schedule
+        # In case of a file-system source, we need to fast-foward to the current marker as per timeslot
         if active_entry.get_content_type() in ResourceClass.FILE.types:
 
             # Calculate the seconds we have to fast-forward
@@ -264,14 +264,14 @@ class AuraScheduler(threading.Thread):
         if not self.programme:
             self.load_programme_from_db()
 
-        # Check for current schedule
-        current_schedule = self.get_active_schedule()
-        if not current_schedule:
+        # Check for current timeslot
+        current_timeslot = self.get_active_timeslot()
+        if not current_timeslot:
             self.logger.warning(SU.red("There's no active timeslot"))
             return None
 
         # Check for scheduled playlist
-        current_playlist = current_schedule.get_playlist()
+        current_playlist = current_timeslot.get_playlist()
         if not current_playlist:
             msg = "There's no playlist assigned to the current timeslot. Most likely a fallback will make things okay again."
             self.logger.warning(SU.red(msg))
@@ -294,24 +294,24 @@ class AuraScheduler(threading.Thread):
 
 
 
-    def get_active_schedule(self):
+    def get_active_timeslot(self):
         """
-        Retrieves the schedule currently to be played. 
+        Retrieves the timeslot currently to be played. 
         
         Returns:
-            (Schedule): The current schedule
+            (Timeslot): The current timeslot
         """
-        current_schedule = None
+        current_timeslot = None
         now_unix = Engine.engine_time()
 
-        # Iterate over all schedules and find the one to be played right now
+        # Iterate over all timeslots and find the one to be played right now
         if self.programme:
-            for schedule in self.programme:
-                if schedule.start_unix <= now_unix and now_unix < schedule.end_unix:
-                    current_schedule = schedule
+            for timeslot in self.programme:
+                if timeslot.start_unix <= now_unix and now_unix < timeslot.end_unix:
+                    current_timeslot = timeslot
                     break
         
-        return current_schedule
+        return current_timeslot
 
 
 
@@ -325,16 +325,16 @@ class AuraScheduler(threading.Thread):
             ([Timeslot]): The next timeslots
         """
         now_unix = Engine.engine_time()
-        next_schedules = []
+        next_timeslots = []
 
-        for schedule in self.programme:
-            if schedule.start_unix > now_unix:
-                if (len(next_schedules) < max_count) or max_count == 0:
-                    next_schedules.append(schedule)
+        for timeslot in self.programme:
+            if timeslot.start_unix > now_unix:
+                if (len(next_timeslots) < max_count) or max_count == 0:
+                    next_timeslots.append(timeslot)
                 else:
                     break
                 
-        return next_schedules
+        return next_timeslots
 
 
     def get_active_playlist(self):
@@ -344,9 +344,9 @@ class AuraScheduler(threading.Thread):
         Returns:
             (Playlist): The resolved playlist
         """
-        schedule = self.get_active_schedule()
-        if schedule:
-            return schedule.get_playlist()
+        timeslot = self.get_active_timeslot()
+        if timeslot:
+            return timeslot.get_playlist()
         return None
 
 
@@ -381,23 +381,23 @@ class AuraScheduler(threading.Thread):
 
     def get_ascii_programme(self):
         """
-        Creates a printable version of the current programme (playlists and entries as per schedule) 
+        Creates a printable version of the current programme (playlists and entries as per timeslot) 
 
         Returns:
             (String):   An ASCII representation of the programme
         """
-        active_schedule = self.get_active_schedule()
+        active_timeslot = self.get_active_timeslot()
 
         s = "\n\n   SCHEDULED NOW:"
         s += "\n┌──────────────────────────────────────────────────────────────────────────────────────────────────────"
-        if active_schedule:
+        if active_timeslot:
             planned_playlist = None
-            if active_schedule.playlist:
-                planned_playlist = active_schedule.playlist[0]
+            if active_timeslot.playlist:
+                planned_playlist = active_timeslot.playlist[0]
 
-            (fallback_type, resolved_playlist) = self.fallback.resolve_playlist(active_schedule)
+            (fallback_type, resolved_playlist) = self.fallback.resolve_playlist(active_timeslot)
 
-            s += "\n│   Playing timeslot %s         " % active_schedule
+            s += "\n│   Playing timeslot %s         " % active_timeslot
             if planned_playlist: 
                 if resolved_playlist and resolved_playlist.playlist_id != planned_playlist.playlist_id:
                     s += "\n│       └── Playlist %s         " % planned_playlist
@@ -439,19 +439,19 @@ class AuraScheduler(threading.Thread):
         s += "\n   SCHEDULED NEXT:"
         s += "\n┌──────────────────────────────────────────────────────────────────────────────────────────────────────"
 
-        next_schedules = self.get_next_timeslots()
-        if not next_schedules:
+        next_timeslots = self.get_next_timeslots()
+        if not next_timeslots:
             s += "\n│   Nothing.         "
         else:
-            for schedule in next_schedules:        
-                (fallback_type, resolved_playlist) = self.fallback.resolve_playlist(schedule)
+            for timeslot in next_timeslots:        
+                (fallback_type, resolved_playlist) = self.fallback.resolve_playlist(timeslot)
                 if resolved_playlist:
 
-                    s += "\n│   Queued timeslot %s         " % schedule
+                    s += "\n│   Queued timeslot %s         " % timeslot
                     s += "\n│      └── Playlist %s         (Type: %s)" % (resolved_playlist, SU.cyan(str(fallback_type)))
-                    if resolved_playlist.end_unix > schedule.end_unix:
+                    if resolved_playlist.end_unix > timeslot.end_unix:
                         s += "\n│          %s!              " % \
-                        (SU.red("↑↑↑ Playlist #%s ends after timeslot #%s!" % (resolved_playlist.playlist_id, schedule.schedule_id)))
+                        (SU.red("↑↑↑ Playlist #%s ends after timeslot #%s!" % (resolved_playlist.playlist_id, timeslot.timeslot_id)))
                     
                     entries = self.preprocess_entries(resolved_playlist.entries, False)
                     s += self.build_playlist_string(entries)
@@ -466,15 +466,15 @@ class AuraScheduler(threading.Thread):
         Returns a stringified list of entries
         """
         s = ""
-        is_out_of_schedule = False
+        is_out_of_timeslot = False
 
         for entry in entries:
-            if entry.queue_state == EntryQueueState.OUT_OF_SCHEDULE and not is_out_of_schedule:
+            if entry.queue_state == EntryQueueState.OUT_OF_SCHEDULE and not is_out_of_timeslot:
                 s += "\n│             %s" % \
-                    SU.red("↓↓↓ These entries won't be played because they are out of schedule.")
-                is_out_of_schedule = True
+                    SU.red("↓↓↓ These entries won't be played because they are out of timeslot.")
+                is_out_of_timeslot = True
 
-            s += self.build_entry_string("\n│         └── ", entry, is_out_of_schedule)
+            s += self.build_entry_string("\n│         └── ", entry, is_out_of_timeslot)
 
         return s
 
@@ -504,34 +504,34 @@ class AuraScheduler(threading.Thread):
 
 
 
-    def filter_scheduling_window(self, schedules):
+    def filter_scheduling_window(self, timeslots):
         """
-        Ignore schedules which are beyond the scheduling window. The end of the scheduling window
+        Ignore timeslots which are beyond the scheduling window. The end of the scheduling window
         is defined by the config option `scheduling_window_end`. This value defines the seconds
-        minus the actual start time of the schedule.
+        minus the actual start time of the timeslot.
         """
         now_unix = Engine.engine_time()
-        len_before = len(schedules)
+        len_before = len(timeslots)
         window_start = self.config.get("scheduling_window_start")
         window_end = self.config.get("scheduling_window_end")
-        schedules = list(filter(lambda s: (s.start_unix - window_end) > now_unix and (s.start_unix - window_start) < now_unix, schedules))
-        len_after = len(schedules)
-        self.logger.info("For now, skipped %s future schedule(s) which are out of the scheduling window (-%ss <-> -%ss)" % ((len_before - len_after), window_start, window_end))
+        timeslots = list(filter(lambda s: (s.start_unix - window_end) > now_unix and (s.start_unix - window_start) < now_unix, timeslots))
+        len_after = len(timeslots)
+        self.logger.info("For now, skipped %s future timeslot(s) which are out of the scheduling window (-%ss <-> -%ss)" % ((len_before - len_after), window_start, window_end))
 
-        return schedules
+        return timeslots
 
 
 
-    def is_schedule_in_window(self, schedule):
+    def is_timeslot_in_window(self, timeslot):
         """
-        Checks if the schedule is within the scheduling window.
+        Checks if the timeslot is within the scheduling window.
         """
         now_unix = Engine.engine_time()
         window_start = self.config.get("scheduling_window_start")
         window_end = self.config.get("scheduling_window_end")
 
-        if schedule.start_unix - window_start < now_unix and \
-            schedule.start_unix - window_end > now_unix:
+        if timeslot.start_unix - window_start < now_unix and \
+            timeslot.start_unix - window_end > now_unix:
 
             return True
         return False
@@ -540,26 +540,26 @@ class AuraScheduler(threading.Thread):
 
     def queue_programme(self):
         """
-        Queues the current programme (playlists as per schedule) by creating
+        Queues the current programme (playlists as per timeslot) by creating
         timed commands to the sound-system to enable the individual tracks of playlists. 
         """
 
         # Get a clean set of the timeslots within the scheduling window
-        schedules = self.get_next_timeslots()
-        schedules = self.filter_scheduling_window(schedules)
+        timeslots = self.get_next_timeslots()
+        timeslots = self.filter_scheduling_window(timeslots)
 
-        # Queue the schedules, their playlists and entries
-        if schedules:
-            for next_schedule in schedules:
-                # Schedule any available fallback playlist
-                self.fallback.queue_fallback_playlist(next_schedule)
+        # Queue the timeslots, their playlists and entries
+        if timeslots:
+            for next_timeslot in timeslots:
+                # Timeslot any available fallback playlist
+                self.fallback.queue_fallback_playlist(next_timeslot)
 
-                if next_schedule.playlist:
-                    self.queue_playlist_entries(next_schedule, next_schedule.get_playlist().entries, False, True)
+                if next_timeslot.playlist:
+                    self.queue_playlist_entries(next_timeslot, next_timeslot.get_playlist().entries, False, True)
                                 
-                # Queue the fade-out of the schedule
-                if not next_schedule.fadeouttimer:
-                    self.queue_end_of_schedule(next_schedule, True)
+                # Queue the fade-out of the timeslot
+                if not next_timeslot.fadeouttimer:
+                    self.queue_end_of_timeslot(next_timeslot, True)
 
         self.logger.info(SU.green("Finished queuing programme."))
 
@@ -570,11 +570,11 @@ class AuraScheduler(threading.Thread):
         Queues all entries after the one currently playing upon startup. Don't use
         this method in any other scenario, as it doesn't respect the scheduling window.
         """
-        current_schedule = self.get_active_schedule()
+        current_timeslot = self.get_active_timeslot()
         
-        # Queue the (rest of the) currently playing schedule upon startup
-        if current_schedule:
-            current_playlist = current_schedule.get_playlist()
+        # Queue the (rest of the) currently playing timeslot upon startup
+        if current_timeslot:
+            current_playlist = current_timeslot.get_playlist()
 
             if current_playlist:
                 active_entry = self.get_active_entry()
@@ -589,22 +589,22 @@ class AuraScheduler(threading.Thread):
 
                     # Queue open entries for current playlist
                     rest_of_playlist = active_entry.get_next_entries(True)
-                    self.queue_playlist_entries(current_schedule, rest_of_playlist, False, True)
+                    self.queue_playlist_entries(current_timeslot, rest_of_playlist, False, True)
 
                     # Store them for later reference
-                    current_schedule.queued_entries = [active_entry]
+                    current_timeslot.queued_entries = [active_entry]
                     if rest_of_playlist:
-                        current_schedule.queued_entries.append(rest_of_playlist)
+                        current_timeslot.queued_entries.append(rest_of_playlist)
 
 
 
-    def queue_playlist_entries(self, schedule, entries, fade_in, fade_out):
+    def queue_playlist_entries(self, timeslot, entries, fade_in, fade_out):
         """
         Creates sound-system player commands for all playlist items to be executed at the scheduled time.
 
         Since each scheduled playlist can consist of multiple entry types such as *file*, *live*,
-        and *stream*, the play-out of the schedule is actually a bit more complex. Before any playlist 
-        entries of the schedule can be turned into sound, they need to be grouped, queued and pre-loaded.
+        and *stream*, the play-out of the timeslot is actually a bit more complex. Before any playlist 
+        entries of the timeslot can be turned into sound, they need to be grouped, queued and pre-loaded.
 
         1. First, all entries are aggregated when they hold filesystem entries.
             Given you have a playlist with 10 entries, the first 4 are consisting of files, the next two
@@ -619,7 +619,7 @@ class AuraScheduler(threading.Thread):
             this stage at all.
 
         Args:
-            schedule (Schedule):        The schedule this entries belong to
+            timeslot (Timeslot):        The timeslot this entries belong to
             entries ([PlaylistEntry]):  The playlist entries to be scheduled for playout
             fade_in (Boolean):          Fade-in at the beginning of the set of entries
             fade_out (Boolean):         Fade-out at the end of the set of entries
@@ -632,7 +632,7 @@ class AuraScheduler(threading.Thread):
         previous_entry = None
         index = 0
 
-        # Mark entries which start after the end of their schedule or are cut
+        # Mark entries which start after the end of their timeslot or are cut
         clean_entries = self.preprocess_entries(entries, True)
 
         # Group/aggregate all filesystem entries, allowing them to be queued at once
@@ -650,8 +650,8 @@ class AuraScheduler(threading.Thread):
             previous_entry = entry
         self.logger.info("Built %s entry group(s)" % len(entry_groups))
          
-        # Schedule function calls
-        do_queue_schedule_end = False
+        # Timeslot function calls
+        do_queue_timeslot_end = False
         if len(clean_entries) > 0 and len(entry_groups) > 0:
             for entries in entry_groups:
                 if not isinstance(entries, list):
@@ -661,7 +661,7 @@ class AuraScheduler(threading.Thread):
                 self.set_entries_timer(entries, fade_in, fade_out)
 
                 # Store them for later reference
-                schedule.queued_entries = clean_entries
+                timeslot.queued_entries = clean_entries
 
         else:
             self.logger.warn(SU.red("Nothing to schedule ..."))
@@ -743,7 +743,7 @@ class AuraScheduler(threading.Thread):
 
         Args:
             entries ([PlaylistEntry]):  The playlist entries to be scheduled for playout
-            cut_oos (Boolean):  If `True` entries which are 'out of schedule' are not returned
+            cut_oos (Boolean):  If `True` entries which are 'out of timeslot' are not returned
 
         Returns:
             ([PlaylistEntry]):  The list of processed playlist entries
@@ -752,11 +752,11 @@ class AuraScheduler(threading.Thread):
 
         for entry in entries:
 
-            if entry.entry_start >= entry.playlist.schedule.schedule_end:
-                msg = "Filtered entry (%s) after end-of schedule (%s) ... SKIPPED" % (entry, entry.playlist.schedule)
+            if entry.entry_start >= entry.playlist.timeslot.timeslot_end:
+                msg = "Filtered entry (%s) after end-of timeslot (%s) ... SKIPPED" % (entry, entry.playlist.timeslot)
                 self.logger.warning(SU.red(msg))
                 entry.queue_state = EntryQueueState.OUT_OF_SCHEDULE
-            elif entry.end_unix > entry.playlist.schedule.end_unix:
+            elif entry.end_unix > entry.playlist.timeslot.end_unix:
                 entry.queue_state = EntryQueueState.CUT
             else:
                 entry.queue_state = EntryQueueState.OKAY
@@ -768,24 +768,24 @@ class AuraScheduler(threading.Thread):
 
 
 
-    def queue_end_of_schedule(self, schedule, fade_out):
+    def queue_end_of_timeslot(self, timeslot, fade_out):
         """
-        Queues a engine action to stop/fade-out the given schedule.
+        Queues a engine action to stop/fade-out the given timeslot.
 
         Args:
-            schedule (PlaylistEntry):  The schedule
-            fade_out (Boolean):        If the schedule should be faded-out
+            timeslot (PlaylistEntry):  The timeslot
+            fade_out (Boolean):        If the timeslot should be faded-out
         """
-        schedule_end = schedule.schedule_end
-        schedule_end_unix = schedule.end_unix
+        timeslot_end = timeslot.timeslot_end
+        timeslot_end_unix = timeslot.end_unix
         now_unix = Engine.engine_time()
         fade_out_time = 0
 
-        # Stop function to be called when schedule ends
-        def do_stop(schedule):
-            if schedule.has_queued_entries():
-                last_entry = schedule.queued_entries[-1]
-                self.logger.info(SU.cyan("=== stop('%s') ===" % str(last_entry.playlist.schedule)))
+        # Stop function to be called when timeslot ends
+        def do_stop(timeslot):
+            if timeslot.has_queued_entries():
+                last_entry = timeslot.queued_entries[-1]
+                self.logger.info(SU.cyan("=== stop('%s') ===" % str(last_entry.playlist.timeslot)))
                 transition_type = TransitionType.INSTANT
                 if fade_out:
                     transition_type = TransitionType.FADE
@@ -795,16 +795,16 @@ class AuraScheduler(threading.Thread):
             fade_out_time = int(round(float(self.config.get("fade_out_time")))) #TODO Use float
         
         # Stop any existing fade-out timer
-        if schedule.fadeouttimer:
-            schedule.fadeouttimer.cancel()
-            self.message_timer.remove(schedule.fadeouttimer)
+        if timeslot.fadeouttimer:
+            timeslot.fadeouttimer.cancel()
+            self.message_timer.remove(timeslot.fadeouttimer)
 
         # Create timer to fade-out
-        start_fade_out = schedule_end_unix - now_unix - fade_out_time
-        # last_entry = schedule.queued_entries[-1]
-        schedule.fadeouttimer = self.create_timer(start_fade_out, do_stop, schedule, fadeout=True)
+        start_fade_out = timeslot_end_unix - now_unix - fade_out_time
+        # last_entry = timeslot.queued_entries[-1]
+        timeslot.fadeouttimer = self.create_timer(start_fade_out, do_stop, timeslot, fadeout=True)
 
-        self.logger.info("Fading out schedule in %s seconds at %s | Schedule: %s" % (str(start_fade_out), str(schedule_end), schedule))
+        self.logger.info("Fading out timeslot in %s seconds at %s | Timeslot: %s" % (str(start_fade_out), str(timeslot_end), timeslot))
 
 
 
@@ -846,9 +846,9 @@ class AuraScheduler(threading.Thread):
         # Always load latest programme from the database
         self.last_successful_fetch = lsf
         self.load_programme_from_db()
-        self.logger.info(SU.green("Finished loading current programme from database (%s schedules)" % str(len(self.programme))))
-        for schedule in self.programme:
-            self.logger.debug("\tSchedule %s with Playlist %s" % (str(schedule), str(schedule.playlist)))
+        self.logger.info(SU.green("Finished loading current programme from database (%s timeslots)" % str(len(self.programme))))
+        for timeslot in self.programme:
+            self.logger.debug("\tTimeslot %s with Playlist %s" % (str(timeslot), str(timeslot.playlist)))
 
 
 
@@ -859,7 +859,7 @@ class AuraScheduler(threading.Thread):
         them via `self.enable_entries(..)`. After that, the
         current message queue is printed to the console.
         """
-        self.programme = Schedule.select_programme()
+        self.programme = Timeslot.select_programme()
 
         if not self.programme:
             self.logger.critical(SU.red("Could not load programme from database. We are in big trouble my friend!"))
@@ -886,7 +886,7 @@ class AuraScheduler(threading.Thread):
         Args:
             diff (Integer):     The difference in seconds from now, when the call should happen
             func (Function):    The function to call
-            param ([]):         A schedule or list of entries
+            param ([]):         A timeslot or list of entries
 
         Returns:
             (CallFunctionTimer, CallFunctionTimer):     In case of a "switch" command, the switch and pre-roll timer is returned
@@ -894,8 +894,8 @@ class AuraScheduler(threading.Thread):
         """
         if not fadein and not fadeout and not switcher or fadein and fadeout or fadein and switcher or fadeout and switcher:
             raise ValueError("You have to call me with either fadein=true, fadeout=true or switcher=True")
-        if not isinstance(param, list) and not isinstance(param, Schedule):
-            raise ValueError("No list of entries nor schedule passed!")
+        if not isinstance(param, list) and not isinstance(param, Timeslot):
+            raise ValueError("No list of entries nor timeslot passed!")
 
         t = CallFunctionTimer(diff=diff, func=func, param=param, fadein=fadein, fadeout=fadeout, switcher=switcher)
         self.message_timer.append(t)
@@ -1025,7 +1025,7 @@ class CallFunctionTimer(threading.Timer):
 
         self.func = func
         self.param = param
-        self.entries = param # TODO Refactor since param can hold [entries] or a schedule, depending on the timer type
+        self.entries = param # TODO Refactor since param can hold [entries] or a timeslot, depending on the timer type
         self.fadein = fadein
         self.fadeout = fadeout
         self.switcher = switcher
@@ -1042,7 +1042,7 @@ class CallFunctionTimer(threading.Timer):
         if self.fadein:
             return status + " fading in entries '" + ResourceUtil.get_entries_string(self.entries)
         elif self.fadeout:
-            return status + " fading out schedule '" + str(self.param)
+            return status + " fading out timeslot '" + str(self.param)
         elif self.switcher:
             return status + " switching to entries '" + ResourceUtil.get_entries_string(self.entries)
         elif self.loader:
diff --git a/tests/connection_tester.py b/tests/connection_tester.py
index d230b2bd..a1214df8 100644
--- a/tests/connection_tester.py
+++ b/tests/connection_tester.py
@@ -47,7 +47,7 @@ class ConnectionTester(AuraConfig):
     # ------------------------------------------------------------------------------------------ #
 #    def test_db_conn(self):
 #        try:
-#            ScheduleEntry.select_all()
+#            TimeslotEntry.select_all()
 #        except:
 #            return False
 #
diff --git a/tests/test.py b/tests/test.py
index 218c7157..7fc24393 100644
--- a/tests/test.py
+++ b/tests/test.py
@@ -26,11 +26,10 @@ from datetime import datetime
 
 from src.base.logger import AuraLogger
 from src.base.config import AuraConfig
-from src.scheduling.models import Schedule, TrackService
+from src.scheduling.models import Timeslot
 
 
 # src
-from src.core.engine import SoundSystem
 from src.scheduling.scheduler import AuraScheduler
 
 class TestLogger(unittest.TestCase):
@@ -70,28 +69,28 @@ class TestConfig(unittest.TestCase):
         self.assertIsNotNone(self.config.get("db_name"))
         self.assertIsNotNone(self.config.get("db_host"))
 
-class TestSchedule(unittest.TestCase):
-    schedule = None
+class TestTimeslot(unittest.TestCase):
+    timeslot = None
 
     def setUp(self):
-        self.schedule = Schedule()
+        self.timeslot = Timeslot()
 
-    def test_schedule(self):
-        # select one and check if its not None and a Schedule
-        entry = self.schedule.select_by_id(1)
+    def test_timeslot(self):
+        # select one and check if its not None and a Timeslot
+        entry = self.timeslot.select_by_id(1)
         self.assertIsNotNone(entry)
-        self.assertIsInstance(entry, Schedule)
+        self.assertIsInstance(entry, Timeslot)
 
 
-class TestScheduleEntry(unittest.TestCase):
-    schedule_entry = None
+class TestTimeslotEntry(unittest.TestCase):
+    timeslot_entry = None
 
     def setUp(self):
-        self.schedule_entry = ScheduleEntry()
+        self.timeslot_entry = TimeslotEntry()
 
-    def test_schedule_entry(self):
-        # select one playlist and check if its not None, a ScheduleEntry
-        entry = self.schedule_entry.select_playlist(2)
+    def test_timeslot_entry(self):
+        # select one playlist and check if its not None, a TimeslotEntry
+        entry = self.timeslot_entry.select_playlist(2)
 
         self.assertIsNotNone(entry)
         self.assertIsInstance(entry, list)
-- 
GitLab