2023-07-29 17:53:51 +02:00
|
|
|
<template>
|
2024-08-27 16:41:58 +02:00
|
|
|
<AppContent>
|
2023-12-23 22:49:23 +01:00
|
|
|
<Loading v-if="loading" />
|
2024-08-26 16:36:13 +02:00
|
|
|
<EmptyContent
|
2024-05-06 12:47:47 +00:00
|
|
|
v-if="failed"
|
|
|
|
class="error"
|
|
|
|
:name="t('repod', 'Error loading feed')">
|
2023-08-02 11:33:48 +02:00
|
|
|
<template #icon>
|
|
|
|
<Alert />
|
|
|
|
</template>
|
2024-08-26 16:36:13 +02:00
|
|
|
</EmptyContent>
|
2024-04-30 00:48:47 +02:00
|
|
|
<Banner
|
|
|
|
v-if="feed"
|
2023-08-23 10:11:39 +02:00
|
|
|
:author="feed.author"
|
2023-08-23 17:54:09 +02:00
|
|
|
:description="feed.description"
|
2023-08-23 10:11:39 +02:00
|
|
|
:image-url="feed.imageUrl"
|
|
|
|
:link="feed.link"
|
|
|
|
:title="feed.title" />
|
2024-01-14 00:40:52 +01:00
|
|
|
<Episodes v-if="feed" />
|
2024-01-16 22:12:07 +01:00
|
|
|
</AppContent>
|
2023-07-29 17:53:51 +02:00
|
|
|
</template>
|
|
|
|
|
|
|
|
<script>
|
2023-08-02 11:33:48 +02:00
|
|
|
import Alert from 'vue-material-design-icons/Alert.vue'
|
2024-01-16 22:12:07 +01:00
|
|
|
import AppContent from '../components/Atoms/AppContent.vue'
|
2023-08-23 10:11:39 +02:00
|
|
|
import Banner from '../components/Feed/Banner.vue'
|
2024-08-26 16:36:13 +02:00
|
|
|
import EmptyContent from '../components/Atoms/EmptyContent.vue'
|
2023-08-30 09:27:12 +02:00
|
|
|
import Episodes from '../components/Feed/Episodes.vue'
|
2023-12-23 22:49:23 +01:00
|
|
|
import Loading from '../components/Atoms/Loading.vue'
|
2023-08-02 11:33:48 +02:00
|
|
|
import axios from '@nextcloud/axios'
|
2024-01-16 23:13:07 +01:00
|
|
|
import { decodeUrl } from '../utils/url.js'
|
2023-08-02 11:33:48 +02:00
|
|
|
import { generateUrl } from '@nextcloud/router'
|
|
|
|
|
2023-07-29 17:53:51 +02:00
|
|
|
export default {
|
|
|
|
name: 'Feed',
|
2023-08-02 11:33:48 +02:00
|
|
|
components: {
|
|
|
|
Alert,
|
2024-01-16 22:12:07 +01:00
|
|
|
AppContent,
|
2023-08-23 10:11:39 +02:00
|
|
|
Banner,
|
2024-08-26 16:36:13 +02:00
|
|
|
EmptyContent,
|
2023-08-30 09:27:12 +02:00
|
|
|
Episodes,
|
2023-12-23 22:49:23 +01:00
|
|
|
Loading,
|
2023-08-02 11:33:48 +02:00
|
|
|
},
|
2024-08-22 13:30:52 +02:00
|
|
|
data: () => ({
|
|
|
|
failed: false,
|
|
|
|
loading: true,
|
|
|
|
feed: null,
|
|
|
|
}),
|
2023-08-02 11:33:48 +02:00
|
|
|
computed: {
|
|
|
|
url() {
|
2024-01-16 23:13:07 +01:00
|
|
|
return decodeUrl(this.$route.params.url)
|
2023-08-02 11:33:48 +02:00
|
|
|
},
|
|
|
|
},
|
|
|
|
async mounted() {
|
|
|
|
try {
|
2024-04-30 00:48:47 +02:00
|
|
|
const podcastData = await axios.get(
|
|
|
|
generateUrl('/apps/repod/podcast?url={url}', { url: this.url }),
|
|
|
|
)
|
2023-08-29 08:53:15 +02:00
|
|
|
this.feed = podcastData.data
|
2023-08-02 11:33:48 +02:00
|
|
|
} catch (e) {
|
|
|
|
this.failed = true
|
|
|
|
console.error(e)
|
|
|
|
} finally {
|
|
|
|
this.loading = false
|
|
|
|
}
|
|
|
|
},
|
2023-07-29 17:53:51 +02:00
|
|
|
}
|
|
|
|
</script>
|
2024-01-13 00:27:36 +01:00
|
|
|
|
|
|
|
<style scoped>
|
2024-04-30 00:48:47 +02:00
|
|
|
.error {
|
|
|
|
margin: 2rem;
|
|
|
|
}
|
2024-01-13 00:27:36 +01:00
|
|
|
</style>
|