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

feat: add getters

parent 6da8c1f4
No related branches found
No related tags found
1 merge request!35ORM-less scheduling
......@@ -255,6 +255,24 @@ class Timeslot:
self.show = show
self.episode = episode
def get_id(self) -> int:
"""
Get ID.
Returns:
int: The ID.
"""
return self.id
def get_repetition_id(self) -> int:
"""
Get ID of the timeslot this timeslot is a repetition of.
Returns:
int: Repetition timeslot ID. None if it is not a repeating timeslot.
"""
return self.repetition_id
def set_playlists(self, pl_timeslot: Playlist, pl_schedule: Playlist, pl_show: Playlist):
"""
Set all playlists and their respective types at once.
......@@ -330,6 +348,24 @@ class Timeslot:
"""
return self.get_end() - self.get_start()
def get_show(self) -> Show:
"""
Get show associated with the timeslot.
Returns:
Show: The show.
"""
return self.show
def get_episode(self) -> Episode:
"""
Get episode associated with the timeslot.
Returns:
Episode: The episode.
"""
return self.episode
def __str__(self) -> str:
"""
String representation.
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment