Skip to content
Snippets Groups Projects
Commit a3e8e3b0 authored by Konrad Mohrfeldt's avatar Konrad Mohrfeldt :koala:
Browse files

fix: gracefully handle missing playlist data in EmissionManager

The playlist data is only available for the currently selected show. Any
playlists used in other shows will not be available and we should
gracefully handle that.

This is a quick fix to address #132. A more permanent and helpful
resolution is outlined in #135 and #136.
parent 90f08abf
No related branches found
No related tags found
No related merge requests found
Pipeline #3034 passed
......@@ -158,7 +158,7 @@
<span class="tw-block">
<strong>{{ $t('emissionTable.playlist') }}:</strong>
{{
getPlaylistById(timeslot.show.default_playlist_id).description ||
getPlaylistById(timeslot.show.default_playlist_id)?.description ||
timeslot.show.default_playlist_id
}}
</span>
......@@ -168,7 +168,7 @@
{{ $t('calendar.empty') }}
</span>
</div>
<div v-else class="tw-leading-none">
<div v-else-if="timeslot.playlist" class="tw-leading-none">
<span class="tw-block">
<strong>{{ $t('emissionTable.playlist') }}:</strong>
{{ timeslot.playlist.description || timeslot.playlist_id }}
......@@ -184,6 +184,9 @@
</span>
</span>
</div>
<div v-else>
<p>{{ $t('emissionTable.missingPlaylistData') }}</p>
</div>
</div>
</div>
</div>
......@@ -291,10 +294,13 @@ export default {
.map((timeslot) => {
const id = timeslot.show
const show = this.getShow({ id })
const playlist = timeslot.playlist_id
? this.getPlaylistById(timeslot.playlist_id) ?? null
: null
return {
...timeslot,
playlist: timeslot.playlist_id ? this.getPlaylistById(timeslot.playlist_id) : null,
playlist,
show: {
...show,
},
......
......@@ -87,6 +87,8 @@ export default {
duration: 'Dauer',
playlist: 'Playlist',
actions: 'Aktionen',
missingPlaylistData:
'Informationen zur Playlist stehen gerade nicht zur Verfügung. Wechsle zur Sendereihe dieser Ausstrahlung.',
},
fileManager: {
......
......@@ -90,6 +90,8 @@ export default {
duration: 'Duration',
playlist: 'Playlist',
actions: 'Actions',
missingPlaylistData:
'Information for this playlist is currently not available. Switch to the show of this emission.',
},
fileManager: {
......
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