podcast parsing
This commit is contained in:
parent
3e9299e77c
commit
22cfc3ae46
2 changed files with 19 additions and 14 deletions
|
@ -24,7 +24,9 @@
|
||||||
"framework7-icons": "^5.0.5",
|
"framework7-icons": "^5.0.5",
|
||||||
"framework7-vue": "^7.1.2",
|
"framework7-vue": "^7.1.2",
|
||||||
"howler": "^2.2.3",
|
"howler": "^2.2.3",
|
||||||
|
"isomorphic-unfetch": "^4.0.2",
|
||||||
"material-icons": "^1.13.1",
|
"material-icons": "^1.13.1",
|
||||||
|
"podparse": "^1.5.1",
|
||||||
"skeleton-elements": "^4.0.1",
|
"skeleton-elements": "^4.0.1",
|
||||||
"swiper": "^8.4.6",
|
"swiper": "^8.4.6",
|
||||||
"tailwindcss": "^3.2.4",
|
"tailwindcss": "^3.2.4",
|
||||||
|
|
|
@ -1,15 +1,16 @@
|
||||||
<template>
|
<template>
|
||||||
<f7-page name="show">
|
<f7-page name="show">
|
||||||
|
|
||||||
<f7-preloader v-if='loading' />
|
<f7-preloader v-if='loading_meta' />
|
||||||
<f7-block v-else>
|
<f7-block v-else>
|
||||||
<f7-block-title>{{Show.name}}</f7-block-title>
|
<f7-block-title>{{ShowBasicInfo.name}}</f7-block-title>
|
||||||
<f7-block-header>{{Radio.name}}</f7-block-header>
|
<f7-block-header>{{Radio.name}}</f7-block-header>
|
||||||
|
</f7-block>
|
||||||
|
|
||||||
<f7-list>
|
<f7-preloader v-if='loading' />
|
||||||
|
<f7-list v-else>
|
||||||
<f7-list-item v-for='episode in Show.episodes' :key='episode.url' :title='episode.title' :link='`/radio/${radioId}/shows/${Show.name}/${episode.url}`' :footer='episode.text' />
|
<f7-list-item v-for='episode in Show.episodes' :key='episode.url' :title='episode.title' :link='`/radio/${radioId}/shows/${Show.name}/${episode.url}`' :footer='episode.text' />
|
||||||
</f7-list>
|
</f7-list>
|
||||||
</f7-block>
|
|
||||||
|
|
||||||
</f7-page>
|
</f7-page>
|
||||||
</template>
|
</template>
|
||||||
|
@ -17,10 +18,14 @@
|
||||||
<script>
|
<script>
|
||||||
import radiomanifest from '../js/radiomanifest'
|
import radiomanifest from '../js/radiomanifest'
|
||||||
|
|
||||||
|
import fetch from 'isomorphic-unfetch'
|
||||||
|
import getPodcastFromFeed from "podparse"
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
name: 'radio',
|
name: 'radio',
|
||||||
data () {
|
data () {
|
||||||
return {
|
return {
|
||||||
|
loading_meta: true,
|
||||||
loading: true,
|
loading: true,
|
||||||
radioId: null,
|
radioId: null,
|
||||||
showId: null,
|
showId: null,
|
||||||
|
@ -31,18 +36,16 @@ export default {
|
||||||
async mounted () {
|
async mounted () {
|
||||||
this.radioId = this.f7route.params.radioId
|
this.radioId = this.f7route.params.radioId
|
||||||
this.showId = this.f7route.params.showId
|
this.showId = this.f7route.params.showId
|
||||||
// XXX: parse podcast
|
this.ShowBasicInfo = {}
|
||||||
this.Show = {
|
|
||||||
episodes: [
|
|
||||||
{title: 'titolo1', text: 'foo1', 'url': '/asd1'},
|
|
||||||
{title: 'titolo2', text: 'foo2', 'url': '/asd2'},
|
|
||||||
],
|
|
||||||
name: this.showId,
|
|
||||||
}
|
|
||||||
console.log('show=', this.Show)
|
|
||||||
try {
|
try {
|
||||||
this.Radio = await radiomanifest.get(this.f7route.params.radioId)
|
this.Radio = await radiomanifest.get(this.f7route.params.radioId)
|
||||||
console.log('Radio=', this.Radio)
|
this.ShowBasicInfo = this.Radio.getShowByName(this.showId)
|
||||||
|
this.loading_meta = false
|
||||||
|
let feedContent = await fetch(this.ShowBasicInfo.getFeed())
|
||||||
|
feedContent = await feedContent.text()
|
||||||
|
this.Show = await getPodcastFromFeed(feedContent)
|
||||||
|
console.log('Show =', this.Show)
|
||||||
this.loading = false
|
this.loading = false
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
console.error('le cose non vanno mai sempre bene!', e)
|
console.error('le cose non vanno mai sempre bene!', e)
|
||||||
|
|
Loading…
Reference in a new issue