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; opacity: 1;
} }
i.disabled {
opacity: 0.5;
}
span.tag { span.tag {
background-color: var(--tag-background); background-color: var(--tag-background);
border-radius: 2px; 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-if="type!='Spotify Playlist'">
<template v-for="track in body"> <template v-for="track in body">
<tr v-if="track.type == 'track'"> <tr v-if="track.type == 'track'">
<td><i @click=playPausePreview <td>
:class="'material-icons' + (track.preview ? ' preview_playlist_controls' : '')" <i v-if="track.preview" @click=playPausePreview
:data-preview="track.preview">play_arrow</i></td> :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>{{ track.track_position }}</td>
<td class="inline-flex"><i v-if="track.explicit_lyrics" <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 : '') }} 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>
<template v-else> <template v-else>
<tr v-for="(track, i) in body"> <tr v-for="(track, i) in body">
<td><i @click=playPausePreview <td>
:class="'material-icons' + (track.preview_url ? ' preview_playlist_controls' : '')" <i v-if="track.preview_url" @click=playPausePreview
:data-preview="track.preview_url">play_arrow</i></td> :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>{{ i+1 }}</td>
<td class="inline-flex"><i v-if="track.explicit" <td class="inline-flex"><i v-if="track.explicit"
class="material-icons">explicit</i>{{ track.name }} class="material-icons">explicit</i>{{ track.name }}