Added check for missing preview tracks

This commit is contained in:
RemixDev 2020-05-10 13:19:12 +02:00
parent 76afeb2c17
commit 2b8801d49a
2 changed files with 16 additions and 7 deletions

View File

@ -79,6 +79,10 @@ img.circle {
opacity: 1;
}
i.disabled {
opacity: 0.5;
}
span.tag {
background-color: var(--tag-background);
border-radius: 2px;

View File

@ -1000,9 +1000,12 @@ <h2 class="inline-flex"><span v-if="metadata">{{ metadata }}</span><span class="
<template v-if="type!='Spotify Playlist'">
<template v-for="track in body">
<tr v-if="track.type == 'track'">
<td><i @click=playPausePreview
:class="'material-icons' + (track.preview ? ' preview_playlist_controls' : '')"
:data-preview="track.preview">play_arrow</i></td>
<td>
<i v-if="track.preview" @click=playPausePreview
:class="'material-icons' + (track.preview ? ' preview_playlist_controls' : '')"
:data-preview="track.preview">play_arrow</i>
<i v-else class="material-icons disabled">play_arrow</i>
</td>
<td>{{ track.track_position }}</td>
<td class="inline-flex"><i v-if="track.explicit_lyrics"
class="material-icons">explicit</i>{{ track.title + (track.title_version && track.title.indexOf(track.title_version) == -1 ? ' '+ track.title_version : '') }}
@ -1022,9 +1025,11 @@ <h2 class="inline-flex"><span v-if="metadata">{{ metadata }}</span><span class="
</template>
<template v-else>
<tr v-for="(track, i) in body">
<td><i @click=playPausePreview
:class="'material-icons' + (track.preview_url ? ' preview_playlist_controls' : '')"
:data-preview="track.preview_url">play_arrow</i></td>
<td>
<i v-if="track.preview_url" @click=playPausePreview
:class="'material-icons' + (track.preview_url ? ' preview_playlist_controls' : '')"
:data-preview="track.preview_url">play_arrow</i></td>
<i v-else class="material-icons disabled">play_arrow</i>
<td>{{ i+1 }}</td>
<td class="inline-flex"><i v-if="track.explicit"
class="material-icons">explicit</i>{{ track.name }}
@ -1083,4 +1088,4 @@ <h2 class="inline-flex"><span v-if="metadata">{{ metadata }}</span><span class="
<script src="/public/js/bundle.js"></script>
</html>
</html>