"git@dev.funkwhale.audio:ariasuni/funkwhale.git" did not exist on "8ddc6f298b685bf0be8646f019c1fdb2002844aa"
Newer
Older
<slot />
<div class="ui hidden divider" />
<div
v-if="isLoading"
class="ui inverted active dimmer"
>
<div class="ui loader" />
<podcast-table
v-if="isPodcast"
:default-cover="defaultCover"
:is-podcast="isPodcast"
:show-art="true"
:show-position="false"
:tracks="objects"
:show-artist="false"
:show-album="false"
:paginate-results="true"
:total="count"
:page="page"
:paginate-by="limit"
@page-changed="updatePage"
/>
<track-table
v-else
:default-cover="defaultCover"
:is-podcast="isPodcast"
:show-art="true"
:show-position="false"
:tracks="objects"
:show-artist="false"
:show-album="false"
:paginate-results="true"
:total="count"
:page="page"
:paginate-by="limit"
@page-changed="updatePage"
/>
<template v-if="!isLoading && objects.length === 0">
<empty-state
:refresh="true"
@refresh="fetchData('tracks/')"
>
<translate translate-context="Content/Channels/*">
You may need to subscribe to this channel to see its content.
</translate>
</template>
</div>
</template>
<script>
import _ from '@/lodash'
import axios from 'axios'
import PodcastTable from '@/components/audio/podcast/Table.vue'
import TrackTable from '@/components/audio/track/Table.vue'
TrackTable
},
props: {
filters: { type: Object, required: true },
limit: { type: Number, default: 10 },
defaultCover: { type: Object, required: true },
isPodcast: { type: Boolean, required: true }
},
data () {
return {
objects: [],
count: 0,
isLoading: false,
watch: {
page () {
this.fetchData('tracks/')
}
},
created () {
this.fetchData('tracks/')
},
methods: {
if (!url) {
return
}
this.isLoading = true
const self = this
const params = _.clone(this.filters)
const channelsPromise = await axios.get(url, { params: params })
self.nextPage = channelsPromise.data.next
self.objects = channelsPromise.data.results
self.count = channelsPromise.data.count
self.$emit('fetched', channelsPromise.data)
self.isLoading = false
} catch (e) {