mirror of
https://github.com/advplyr/audiobookshelf.git
synced 2025-01-03 00:06:46 +01:00
Merge pull request #561 from jflattery/main
Add support for seasonal podcasts
This commit is contained in:
commit
c8c7a9ece5
@ -40,6 +40,10 @@ export default {
|
|||||||
text: 'Title',
|
text: 'Title',
|
||||||
value: 'title'
|
value: 'title'
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
text: 'Season',
|
||||||
|
value: 'season'
|
||||||
|
},
|
||||||
{
|
{
|
||||||
text: 'Episode',
|
text: 'Episode',
|
||||||
value: 'episode'
|
value: 'episode'
|
||||||
|
@ -7,13 +7,16 @@
|
|||||||
</template>
|
</template>
|
||||||
<div ref="wrapper" class="p-4 w-full text-sm py-2 rounded-lg bg-bg shadow-lg border border-black-300 relative overflow-hidden">
|
<div ref="wrapper" class="p-4 w-full text-sm py-2 rounded-lg bg-bg shadow-lg border border-black-300 relative overflow-hidden">
|
||||||
<div class="flex flex-wrap">
|
<div class="flex flex-wrap">
|
||||||
<div class="w-1/3 p-1">
|
<div class="w-1/5 p-1">
|
||||||
|
<ui-text-input-with-label v-model="newEpisode.season" label="Season" />
|
||||||
|
</div>
|
||||||
|
<div class="w-1/5 p-1">
|
||||||
<ui-text-input-with-label v-model="newEpisode.episode" label="Episode" />
|
<ui-text-input-with-label v-model="newEpisode.episode" label="Episode" />
|
||||||
</div>
|
</div>
|
||||||
<div class="w-1/3 p-1">
|
<div class="w-1/5 p-1">
|
||||||
<ui-text-input-with-label v-model="newEpisode.episodeType" label="Episode Type" />
|
<ui-text-input-with-label v-model="newEpisode.episodeType" label="Episode Type" />
|
||||||
</div>
|
</div>
|
||||||
<div class="w-1/3 p-1">
|
<div class="w-2/5 p-1">
|
||||||
<ui-text-input-with-label v-model="pubDateInput" @input="updatePubDate" type="datetime-local" label="Pub Date" />
|
<ui-text-input-with-label v-model="pubDateInput" @input="updatePubDate" type="datetime-local" label="Pub Date" />
|
||||||
</div>
|
</div>
|
||||||
<div class="w-full p-1">
|
<div class="w-full p-1">
|
||||||
@ -39,6 +42,7 @@ export default {
|
|||||||
return {
|
return {
|
||||||
processing: false,
|
processing: false,
|
||||||
newEpisode: {
|
newEpisode: {
|
||||||
|
season: null,
|
||||||
episode: null,
|
episode: null,
|
||||||
episodeType: null,
|
episodeType: null,
|
||||||
title: null,
|
title: null,
|
||||||
@ -92,6 +96,7 @@ export default {
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
init() {
|
init() {
|
||||||
|
this.newEpisode.season = this.episode.season || ''
|
||||||
this.newEpisode.episode = this.episode.episode || ''
|
this.newEpisode.episode = this.episode.episode || ''
|
||||||
this.newEpisode.episodeType = this.episode.episodeType || ''
|
this.newEpisode.episodeType = this.episode.episodeType || ''
|
||||||
this.newEpisode.title = this.episode.title || ''
|
this.newEpisode.title = this.episode.title || ''
|
||||||
|
@ -20,6 +20,7 @@
|
|||||||
<ui-tooltip :text="userIsFinished ? 'Mark as Not Finished' : 'Mark as Finished'" direction="top">
|
<ui-tooltip :text="userIsFinished ? 'Mark as Not Finished' : 'Mark as Finished'" direction="top">
|
||||||
<ui-read-icon-btn :disabled="isProcessingReadUpdate" :is-read="userIsFinished" borderless class="mx-1 mt-0.5" @click="toggleFinished" />
|
<ui-read-icon-btn :disabled="isProcessingReadUpdate" :is-read="userIsFinished" borderless class="mx-1 mt-0.5" @click="toggleFinished" />
|
||||||
</ui-tooltip>
|
</ui-tooltip>
|
||||||
|
<p v-if="episode.season" class="px-4 text-sm text-gray-300">Season #{{ episode.season }}</p>
|
||||||
<p v-if="episode.episode" class="px-4 text-sm text-gray-300">Episode #{{ episode.episode }}</p>
|
<p v-if="episode.episode" class="px-4 text-sm text-gray-300">Episode #{{ episode.episode }}</p>
|
||||||
<p v-if="publishedAt" class="px-4 text-sm text-gray-300">Published {{ $formatDate(publishedAt, 'MMM do, yyyy') }}</p>
|
<p v-if="publishedAt" class="px-4 text-sm text-gray-300">Published {{ $formatDate(publishedAt, 'MMM do, yyyy') }}</p>
|
||||||
</div>
|
</div>
|
||||||
|
@ -9,6 +9,7 @@ class PodcastEpisode {
|
|||||||
this.id = null
|
this.id = null
|
||||||
this.index = null
|
this.index = null
|
||||||
|
|
||||||
|
this.season = null
|
||||||
this.episode = null
|
this.episode = null
|
||||||
this.episodeType = null
|
this.episodeType = null
|
||||||
this.title = null
|
this.title = null
|
||||||
@ -31,6 +32,7 @@ class PodcastEpisode {
|
|||||||
this.libraryItemId = episode.libraryItemId
|
this.libraryItemId = episode.libraryItemId
|
||||||
this.id = episode.id
|
this.id = episode.id
|
||||||
this.index = episode.index
|
this.index = episode.index
|
||||||
|
this.season = episode.season
|
||||||
this.episode = episode.episode
|
this.episode = episode.episode
|
||||||
this.episodeType = episode.episodeType
|
this.episodeType = episode.episodeType
|
||||||
this.title = episode.title
|
this.title = episode.title
|
||||||
@ -51,6 +53,7 @@ class PodcastEpisode {
|
|||||||
libraryItemId: this.libraryItemId,
|
libraryItemId: this.libraryItemId,
|
||||||
id: this.id,
|
id: this.id,
|
||||||
index: this.index,
|
index: this.index,
|
||||||
|
season: this.season,
|
||||||
episode: this.episode,
|
episode: this.episode,
|
||||||
episodeType: this.episodeType,
|
episodeType: this.episodeType,
|
||||||
title: this.title,
|
title: this.title,
|
||||||
@ -70,6 +73,7 @@ class PodcastEpisode {
|
|||||||
libraryItemId: this.libraryItemId,
|
libraryItemId: this.libraryItemId,
|
||||||
id: this.id,
|
id: this.id,
|
||||||
index: this.index,
|
index: this.index,
|
||||||
|
season: this.season,
|
||||||
episode: this.episode,
|
episode: this.episode,
|
||||||
episodeType: this.episodeType,
|
episodeType: this.episodeType,
|
||||||
title: this.title,
|
title: this.title,
|
||||||
@ -117,6 +121,7 @@ class PodcastEpisode {
|
|||||||
this.pubDate = data.pubDate || ''
|
this.pubDate = data.pubDate || ''
|
||||||
this.description = data.description || ''
|
this.description = data.description || ''
|
||||||
this.enclosure = data.enclosure ? { ...data.enclosure } : null
|
this.enclosure = data.enclosure ? { ...data.enclosure } : null
|
||||||
|
this.season = data.season || ''
|
||||||
this.episode = data.episode || ''
|
this.episode = data.episode || ''
|
||||||
this.episodeType = data.episodeType || ''
|
this.episodeType = data.episodeType || ''
|
||||||
this.publishedAt = data.publishedAt || 0
|
this.publishedAt = data.publishedAt || 0
|
||||||
|
@ -85,7 +85,7 @@ function extractEpisodeData(item) {
|
|||||||
episode.descriptionPlain = stripHtml(episode.description || '').result
|
episode.descriptionPlain = stripHtml(episode.description || '').result
|
||||||
}
|
}
|
||||||
|
|
||||||
var arrayFields = ['title', 'pubDate', 'itunes:episodeType', 'itunes:episode', 'itunes:author', 'itunes:duration', 'itunes:explicit', 'itunes:subtitle']
|
var arrayFields = ['title', 'pubDate', 'itunes:episodeType', 'itunes:season', 'itunes:episode', 'itunes:author', 'itunes:duration', 'itunes:explicit', 'itunes:subtitle']
|
||||||
arrayFields.forEach((key) => {
|
arrayFields.forEach((key) => {
|
||||||
var cleanKey = key.split(':').pop()
|
var cleanKey = key.split(':').pop()
|
||||||
episode[cleanKey] = extractFirstArrayItem(item, key)
|
episode[cleanKey] = extractFirstArrayItem(item, key)
|
||||||
@ -101,6 +101,7 @@ function cleanEpisodeData(data) {
|
|||||||
descriptionPlain: data.descriptionPlain || '',
|
descriptionPlain: data.descriptionPlain || '',
|
||||||
pubDate: data.pubDate || '',
|
pubDate: data.pubDate || '',
|
||||||
episodeType: data.episodeType || '',
|
episodeType: data.episodeType || '',
|
||||||
|
season: data.season || '',
|
||||||
episode: data.episode || '',
|
episode: data.episode || '',
|
||||||
author: data.author || '',
|
author: data.author || '',
|
||||||
duration: data.duration || '',
|
duration: data.duration || '',
|
||||||
|
Loading…
Reference in New Issue
Block a user