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

refactor: new domain metadata generation

parent 62d210de
No related branches found
No related tags found
1 merge request!35ORM-less scheduling
...@@ -271,11 +271,11 @@ class ResourceUtil(Enum): ...@@ -271,11 +271,11 @@ class ResourceUtil(Enum):
content_class = ResourceUtil.get_content_class(content_type) content_class = ResourceUtil.get_content_class(content_type)
annotations = { annotations = {
"show_name": str(item.playlist.timeslot.show_name), "show_name": str(item.playlist.timeslot.show.name),
"show_id": int(item.playlist.timeslot.show_id), "show_id": int(item.playlist.timeslot.show.id),
"timeslot_id": int(item.playlist.timeslot.timeslot_id), "timeslot_id": int(item.playlist.timeslot.id),
"playlist_id": int(item.playlist.playlist_id), "playlist_id": int(item.playlist.id),
"playlist_entry": str(float(item.entry_num)), "playlist_entry": str(float(item.get_position())),
"track_type": int(content_class.numeric), "track_type": int(content_class.numeric),
"track_start": "", "track_start": "",
"track_duration": -1, "track_duration": -1,
...@@ -286,12 +286,12 @@ class ResourceUtil(Enum): ...@@ -286,12 +286,12 @@ class ResourceUtil(Enum):
if assign_track_start: if assign_track_start:
# Convert to current Liquidsoap date/time format # Convert to current Liquidsoap date/time format
annotations["track_start"] = item.item_start.strftime("%Y/%m/%d %H:%M:%S") annotations["track_start"] = item.get_start().strftime("%Y/%m/%d %H:%M:%S")
if item.duration and item.duration > 0: if item.duration and item.duration > 0:
annotations["track_duration"] = item.duration annotations["track_duration"] = item.duration
if item.meta_data: if item.metadata:
annotations["track_title"] = str(item.meta_data.title) annotations["track_title"] = str(item.metadata.title)
annotations["track_album"] = str(item.meta_data.album) annotations["track_album"] = str(item.metadata.album)
annotations["track_artist"] = str(item.meta_data.artist) annotations["track_artist"] = str(item.metadata.artist)
return annotations return annotations
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment