Merge branch '637-radio-track-greyed' into 'develop'
Fix #637: greyed tracks in radio builder and detail page Closes #637 See merge request funkwhale/funkwhale!511
This commit is contained in:
commit
bbc36201c8
|
@ -0,0 +1 @@
|
||||||
|
Fixed greyed tracks in radio builder and detail page (#637)
|
|
@ -120,7 +120,14 @@ export default {
|
||||||
this.isLoading = true
|
this.isLoading = true
|
||||||
let getTracks = new Promise((resolve, reject) => {
|
let getTracks = new Promise((resolve, reject) => {
|
||||||
if (self.track) {
|
if (self.track) {
|
||||||
|
if (!self.track.uploads || self.track.uploads.length === 0) {
|
||||||
|
// fetch uploads from api
|
||||||
|
axios.get(`tracks/${self.track.id}/`).then((response) => {
|
||||||
|
resolve([response.data])
|
||||||
|
})
|
||||||
|
} else {
|
||||||
resolve([self.track])
|
resolve([self.track])
|
||||||
|
}
|
||||||
} else if (self.tracks) {
|
} else if (self.tracks) {
|
||||||
resolve(self.tracks)
|
resolve(self.tracks)
|
||||||
} else if (self.playlist) {
|
} else if (self.playlist) {
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
<template>
|
<template>
|
||||||
<tr>
|
<tr>
|
||||||
<td>
|
<td>
|
||||||
<play-button class="basic icon" :discrete="true" :track="track"></play-button>
|
<play-button class="basic icon" :discrete="true" :is-playable="playable" :track="track"></play-button>
|
||||||
</td>
|
</td>
|
||||||
<td>
|
<td>
|
||||||
<img class="ui mini image" v-if="track.album.cover.original" v-lazy="$store.getters['instance/absoluteUrl'](track.album.cover.small_square_crop)">
|
<img class="ui mini image" v-if="track.album.cover.original" v-lazy="$store.getters['instance/absoluteUrl'](track.album.cover.small_square_crop)">
|
||||||
|
@ -60,7 +60,8 @@ export default {
|
||||||
props: {
|
props: {
|
||||||
track: {type: Object, required: true},
|
track: {type: Object, required: true},
|
||||||
artist: {type: Object, required: false},
|
artist: {type: Object, required: false},
|
||||||
displayPosition: {type: Boolean, default: false}
|
displayPosition: {type: Boolean, default: false},
|
||||||
|
playable: {type: Boolean, required: false, default: false},
|
||||||
},
|
},
|
||||||
components: {
|
components: {
|
||||||
TrackFavoriteIcon,
|
TrackFavoriteIcon,
|
||||||
|
@ -86,9 +87,9 @@ export default {
|
||||||
|
|
||||||
<!-- Add "scoped" attribute to limit CSS to this component only -->
|
<!-- Add "scoped" attribute to limit CSS to this component only -->
|
||||||
<style lang="scss" scoped>
|
<style lang="scss" scoped>
|
||||||
|
|
||||||
tr:not(:hover) {
|
tr:not(:hover) {
|
||||||
.favorite-icon:not(.favorited), .playlist-icon {
|
.favorite-icon:not(.favorited),
|
||||||
|
.playlist-icon {
|
||||||
visibility: hidden;
|
visibility: hidden;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -13,6 +13,7 @@
|
||||||
</thead>
|
</thead>
|
||||||
<tbody>
|
<tbody>
|
||||||
<track-row
|
<track-row
|
||||||
|
:playable="playable"
|
||||||
:display-position="displayPosition"
|
:display-position="displayPosition"
|
||||||
:track="track"
|
:track="track"
|
||||||
:artist="artist"
|
:artist="artist"
|
||||||
|
@ -31,6 +32,7 @@ import Modal from '@/components/semantic/Modal'
|
||||||
export default {
|
export default {
|
||||||
props: {
|
props: {
|
||||||
tracks: {type: Array, required: true},
|
tracks: {type: Array, required: true},
|
||||||
|
playable: {type: Boolean, required: false, default: false},
|
||||||
artist: {type: Object, required: false},
|
artist: {type: Object, required: false},
|
||||||
displayPosition: {type: Boolean, default: false}
|
displayPosition: {type: Boolean, default: false}
|
||||||
},
|
},
|
||||||
|
@ -48,7 +50,6 @@ export default {
|
||||||
|
|
||||||
<!-- Add "scoped" attribute to limit CSS to this component only -->
|
<!-- Add "scoped" attribute to limit CSS to this component only -->
|
||||||
<style scoped>
|
<style scoped>
|
||||||
|
|
||||||
tr:not(:hover) .favorite-icon:not(.favorited) {
|
tr:not(:hover) .favorite-icon:not(.favorited) {
|
||||||
display: none;
|
display: none;
|
||||||
}
|
}
|
||||||
|
|
|
@ -77,7 +77,7 @@
|
||||||
</builder-filter>
|
</builder-filter>
|
||||||
</tbody>
|
</tbody>
|
||||||
</table>
|
</table>
|
||||||
<template v-if="checkResult">
|
<template v-if="checkResult && checkResult.candidates && checkResult.candidates.count">
|
||||||
<h3
|
<h3
|
||||||
class="ui header"
|
class="ui header"
|
||||||
v-translate="{count: checkResult.candidates.count}"
|
v-translate="{count: checkResult.candidates.count}"
|
||||||
|
@ -85,7 +85,7 @@
|
||||||
translate-plural="%{ count } tracks matching combined filters">
|
translate-plural="%{ count } tracks matching combined filters">
|
||||||
%{ count } track matching combined filters
|
%{ count } track matching combined filters
|
||||||
</h3>
|
</h3>
|
||||||
<track-table v-if="checkResult.candidates.sample" :tracks="checkResult.candidates.sample"></track-table>
|
<track-table v-if="checkResult.candidates.sample" :tracks="checkResult.candidates.sample" :playable="true"></track-table>
|
||||||
</template>
|
</template>
|
||||||
</section>
|
</section>
|
||||||
</div>
|
</div>
|
||||||
|
|
Loading…
Reference in New Issue