Commit 99c4f212 authored by David Trattnig's avatar David Trattnig
Browse files

Fix API request data for non-file entries.

parent 861c1611
......@@ -23,7 +23,6 @@ import requests
from modules.base.utils import SimpleUtil as SU
from modules.base.models import Playlist
class TrackServiceHandler():
......@@ -60,9 +59,10 @@ class TrackServiceHandler():
diff = (entry.entry_start_actual - entry.entry_start).total_seconds()
self.logger.info("There's a difference of %s seconds between planned and actual start of the entry" % diff)
data["track_start"] = entry.entry_start_actual
data["track_artist"] = entry.meta_data.artist
data["track_album"] = entry.meta_data.album
data["track_title"] = entry.meta_data.title
if entry.meta_data:
data["track_artist"] = entry.meta_data.artist
data["track_album"] = entry.meta_data.album
data["track_title"] = entry.meta_data.title
data["track_duration"] = entry.duration
data["track_num"] = entry.entry_num
data["track_type"] = entry.get_type().numeric
......@@ -100,9 +100,10 @@ class TrackServiceHandler():
for e in current_playlist.entries:
entry = dict()
entry["track_start"] = e.entry_start
entry["track_artist"] = e.meta_data.artist
entry["track_album"] = e.meta_data.album
entry["track_title"] = e.meta_data.title
if e.meta_data:
entry["track_artist"] = e.meta_data.artist
entry["track_album"] = e.meta_data.album
entry["track_title"] = e.meta_data.title
entry["track_num"] = e.entry_num
entry["track_duration"] = e.duration
entry["track_type"] = e.get_type().numeric
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment