refactor
This commit is contained in:
parent
22cfc3ae46
commit
45cf9558fe
2 changed files with 12 additions and 6 deletions
10
src/js/podcast.js
Normal file
10
src/js/podcast.js
Normal file
|
@ -0,0 +1,10 @@
|
|||
import fetch from 'isomorphic-unfetch'
|
||||
import getPodcastFromFeed from "podparse"
|
||||
|
||||
async function getPodcast(url) {
|
||||
let feedContent = await fetch(url)
|
||||
feedContent = await feedContent.text()
|
||||
return await getPodcastFromFeed(feedContent)
|
||||
}
|
||||
|
||||
export default getPodcast
|
|
@ -17,9 +17,7 @@
|
|||
|
||||
<script>
|
||||
import radiomanifest from '../js/radiomanifest'
|
||||
|
||||
import fetch from 'isomorphic-unfetch'
|
||||
import getPodcastFromFeed from "podparse"
|
||||
import getPodcast from '../js/podcast'
|
||||
|
||||
export default {
|
||||
name: 'radio',
|
||||
|
@ -42,9 +40,7 @@ export default {
|
|||
this.Radio = await radiomanifest.get(this.f7route.params.radioId)
|
||||
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)
|
||||
this.Show = await getPodcast(this.ShowBasicInfo.getFeed())
|
||||
console.log('Show =', this.Show)
|
||||
this.loading = false
|
||||
} catch (e) {
|
||||
|
|
Loading…
Reference in a new issue