Add support to podcast type

This commit is contained in:
mfcar 2023-02-22 18:22:52 +00:00
parent 8c84640484
commit b1ee54522a
No known key found for this signature in database
16 changed files with 77 additions and 22 deletions

View File

@ -39,6 +39,11 @@
</div>
</div>
</div>
<div class="flex mt-2 -mx-1">
<div class="w-1/4 px-1">
<ui-dropdown :label="$strings.LabelPodcastType" v-model="details.type" :items="podcastTypes" small class="max-w-52" />
</div>
</div>
</form>
</div>
</template>
@ -65,7 +70,8 @@ export default {
itunesId: null,
itunesArtistId: null,
explicit: false,
language: null
language: null,
type: null
},
newTags: []
}
@ -93,7 +99,10 @@ export default {
},
filterData() {
return this.$store.state.libraries.filterData || {}
}
},
podcastTypes() {
return this.$store.state.globals.podcastTypes || []
},
},
methods: {
getDetails() {
@ -219,6 +228,7 @@ export default {
this.details.itunesArtistId = this.mediaMetadata.itunesArtistId || ''
this.details.language = this.mediaMetadata.language || ''
this.details.explicit = !!this.mediaMetadata.explicit
this.details.type = this.mediaMetadata.type || 'episodic'
this.newTags = [...(this.media.tags || [])]
},

View File

@ -37,6 +37,15 @@ export const state = () => ({
value: 'yyyy-MM-dd'
}
],
podcastTypes: [
{ text: 'Episodic', value: 'episodic' },
{ text: 'Serial', value: 'serial' }
],
episodeTypes: [
{ text: 'Full', value: 'full' },
{ text: 'Trailer', value: 'trailer' },
{ text: 'Bonus', value: 'bonus' }
],
libraryIcons: ['database', 'audiobookshelf', 'books-1', 'books-2', 'book-1', 'microphone-1', 'microphone-3', 'radio', 'podcast', 'rss', 'headphones', 'music', 'file-picture', 'rocket', 'power', 'star', 'heart']
})

View File

@ -301,6 +301,7 @@
"LabelPlayMethod": "Abspielmethode",
"LabelPodcast": "Podcast",
"LabelPodcasts": "Podcasts",
"LabelPodcastType": "Podcast Type",
"LabelPrefixesToIgnore": "Zu ignorierende(s) Vorwort(e) (Groß- und Kleinschreibung wird nicht berücksichtigt)",
"LabelProgress": "Fortschritt",
"LabelProvider": "Anbieter",

View File

@ -301,6 +301,7 @@
"LabelPlayMethod": "Play Method",
"LabelPodcast": "Podcast",
"LabelPodcasts": "Podcasts",
"LabelPodcastType": "Podcast Type",
"LabelPrefixesToIgnore": "Prefixes to Ignore (case insensitive)",
"LabelProgress": "Progress",
"LabelProvider": "Provider",

View File

@ -301,6 +301,7 @@
"LabelPlayMethod": "Play Method",
"LabelPodcast": "Podcast",
"LabelPodcasts": "Podcasts",
"LabelPodcastType": "Podcast Type",
"LabelPrefixesToIgnore": "Prefixes to Ignore (case insensitive)",
"LabelProgress": "Progress",
"LabelProvider": "Provider",

View File

@ -301,6 +301,7 @@
"LabelPlayMethod": "Méthode d'écoute",
"LabelPodcast": "Podcast",
"LabelPodcasts": "Podcasts",
"LabelPodcastType": "Podcast Type",
"LabelPrefixesToIgnore": "Préfixes à Ignorer (Insensible à la Casse)",
"LabelProgress": "Progression",
"LabelProvider": "Fournisseur",

View File

@ -301,6 +301,7 @@
"LabelPlayMethod": "Vrsta reprodukcije",
"LabelPodcast": "Podcast",
"LabelPodcasts": "Podcasts",
"LabelPodcastType": "Podcast Type",
"LabelPrefixesToIgnore": "Prefiksi za ignorirati (mala i velika slova nisu bitna)",
"LabelProgress": "Napredak",
"LabelProvider": "Dobavljač",

View File

@ -301,6 +301,7 @@
"LabelPlayMethod": "Metodo di riproduzione",
"LabelPodcast": "Podcast",
"LabelPodcasts": "Podcasts",
"LabelPodcastType": "Podcast Type",
"LabelPrefixesToIgnore": "Suffissi da ignorare (specificando maiuscole e minuscole)",
"LabelProgress": "Cominciati",
"LabelProvider": "Provider",

View File

@ -301,6 +301,7 @@
"LabelPlayMethod": "Metoda odtwarzania",
"LabelPodcast": "Podcast",
"LabelPodcasts": "Podcasty",
"LabelPodcastType": "Podcast Type",
"LabelPrefixesToIgnore": "Ignorowane prefiksy (wielkość liter nie ma znaczenia)",
"LabelProgress": "Postęp",
"LabelProvider": "Dostawca",

View File

@ -301,6 +301,7 @@
"LabelPlayMethod": "Метод Воспроизведения",
"LabelPodcast": "Подкаст",
"LabelPodcasts": "Подкасты",
"LabelPodcastType": "Podcast Type",
"LabelPrefixesToIgnore": "Игнорируемые Префиксы (без учета регистра)",
"LabelProgress": "Прогресс",
"LabelProvider": "Провайдер",

View File

@ -301,6 +301,7 @@
"LabelPlayMethod": "播放方法",
"LabelPodcast": "播客",
"LabelPodcasts": "播客",
"LabelPodcastType": "Podcast Type",
"LabelPrefixesToIgnore": "忽略的前缀 (不区分大小写)",
"LabelProgress": "进度",
"LabelProvider": "供应商",

View File

@ -106,6 +106,7 @@ class Feed {
this.meta.feedUrl = feedUrl
this.meta.link = `${serverAddress}/item/${libraryItem.id}`
this.meta.explicit = !!mediaMetadata.explicit
this.meta.type = mediaMetadata.type
this.episodes = []
if (isPodcast) { // PODCAST EPISODES
@ -142,6 +143,7 @@ class Feed {
this.meta.author = author
this.meta.imageUrl = media.coverPath ? `${this.serverAddress}/feed/${this.slug}/cover` : `${this.serverAddress}/Logo.png`
this.meta.explicit = !!mediaMetadata.explicit
this.meta.type = mediaMetadata.type
this.episodes = []
if (isPodcast) { // PODCAST EPISODES

View File

@ -14,6 +14,9 @@ class FeedEpisode {
this.author = null
this.explicit = null
this.duration = null
this.season = null
this.episode = null
this.episodeType = null
this.libraryItemId = null
this.episodeId = null
@ -35,6 +38,9 @@ class FeedEpisode {
this.author = episode.author
this.explicit = episode.explicit
this.duration = episode.duration
this.season = episode.season
this.episode = episode.episode
this.episodeType = episode.episodeType
this.libraryItemId = episode.libraryItemId
this.episodeId = episode.episodeId || null
this.trackIndex = episode.trackIndex || 0
@ -52,6 +58,9 @@ class FeedEpisode {
author: this.author,
explicit: this.explicit,
duration: this.duration,
season: this.season,
episode: this.episode,
episodeType: this.episodeType,
libraryItemId: this.libraryItemId,
episodeId: this.episodeId,
trackIndex: this.trackIndex,
@ -77,6 +86,9 @@ class FeedEpisode {
this.author = meta.author
this.explicit = mediaMetadata.explicit
this.duration = episode.duration
this.season = episode.season
this.episode = episode.episode
this.episodeType = episode.episodeType
this.libraryItemId = libraryItem.id
this.episodeId = episode.id
this.trackIndex = 0
@ -144,7 +156,10 @@ class FeedEpisode {
{ 'itunes:summary': this.description || '' },
{
"itunes:explicit": !!this.explicit
}
},
{"itunes:episodeType": this.episodeType},
{"itunes:season": this.season},
{"itunes:episode": this.episode}
]
}
}

View File

@ -7,6 +7,7 @@ class FeedMeta {
this.feedUrl = null
this.link = null
this.explicit = null
this.type = null
if (meta) {
this.construct(meta)
@ -21,6 +22,7 @@ class FeedMeta {
this.feedUrl = meta.feedUrl
this.link = meta.link
this.explicit = meta.explicit
this.type = meta.type
}
toJSON() {
@ -31,7 +33,8 @@ class FeedMeta {
imageUrl: this.imageUrl,
feedUrl: this.feedUrl,
link: this.link,
explicit: this.explicit
explicit: this.explicit,
type: this.type
}
}
@ -53,6 +56,7 @@ class FeedMeta {
{ 'author': this.author || 'advplyr' },
{ 'itunes:author': this.author || 'advplyr' },
{ 'itunes:summary': this.description || '' },
{ 'itunes:type': this.type },
{
'itunes:image': {
_attr: {

View File

@ -15,6 +15,7 @@ class PodcastMetadata {
this.itunesArtistId = null
this.explicit = false
this.language = null
this.type = null
if (metadata) {
this.construct(metadata)
@ -34,6 +35,7 @@ class PodcastMetadata {
this.itunesArtistId = metadata.itunesArtistId
this.explicit = metadata.explicit
this.language = metadata.language || null
this.type = metadata.type || 'episodic'
}
toJSON() {
@ -49,7 +51,8 @@ class PodcastMetadata {
itunesId: this.itunesId,
itunesArtistId: this.itunesArtistId,
explicit: this.explicit,
language: this.language
language: this.language,
type: this.type
}
}
@ -67,7 +70,8 @@ class PodcastMetadata {
itunesId: this.itunesId,
itunesArtistId: this.itunesArtistId,
explicit: this.explicit,
language: this.language
language: this.language,
type: this.type
}
}
@ -112,6 +116,7 @@ class PodcastMetadata {
this.itunesArtistId = mediaMetadata.itunesArtistId || null
this.explicit = !!mediaMetadata.explicit
this.language = mediaMetadata.language || null
this.type = mediaMetadata.type || null
if (mediaMetadata.genres && mediaMetadata.genres.length) {
this.genres = [...mediaMetadata.genres]
}

View File

@ -46,7 +46,8 @@ function extractPodcastMetadata(channel) {
categories: extractCategories(channel),
feedUrl: null,
description: null,
descriptionPlain: null
descriptionPlain: null,
type: null
}
if (channel['itunes:new-feed-url']) {
@ -61,7 +62,7 @@ function extractPodcastMetadata(channel) {
metadata.descriptionPlain = htmlSanitizer.stripAllTags(rawDescription)
}
var arrayFields = ['title', 'language', 'itunes:explicit', 'itunes:author', 'pubDate', 'link']
var arrayFields = ['title', 'language', 'itunes:explicit', 'itunes:author', 'pubDate', 'link', 'itunes:type']
arrayFields.forEach((key) => {
var cleanKey = key.split(':').pop()
metadata[cleanKey] = extractFirstArrayItem(channel, key)