mirror of
https://github.com/advplyr/audiobookshelf.git
synced 2025-07-19 10:24:41 +02:00
Add support to podcast type
This commit is contained in:
parent
8c84640484
commit
b1ee54522a
16 changed files with 77 additions and 22 deletions
|
@ -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
|
||||
|
@ -333,4 +335,4 @@ class Feed {
|
|||
return author
|
||||
}
|
||||
}
|
||||
module.exports = Feed
|
||||
module.exports = Feed
|
||||
|
|
|
@ -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,9 +156,12 @@ class FeedEpisode {
|
|||
{ 'itunes:summary': this.description || '' },
|
||||
{
|
||||
"itunes:explicit": !!this.explicit
|
||||
}
|
||||
},
|
||||
{"itunes:episodeType": this.episodeType},
|
||||
{"itunes:season": this.season},
|
||||
{"itunes:episode": this.episode}
|
||||
]
|
||||
}
|
||||
}
|
||||
}
|
||||
module.exports = FeedEpisode
|
||||
module.exports = FeedEpisode
|
||||
|
|
|
@ -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: {
|
||||
|
@ -73,4 +77,4 @@ class FeedMeta {
|
|||
}
|
||||
}
|
||||
}
|
||||
module.exports = FeedMeta
|
||||
module.exports = FeedMeta
|
||||
|
|
|
@ -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]
|
||||
}
|
||||
|
@ -132,4 +137,4 @@ class PodcastMetadata {
|
|||
return hasUpdates
|
||||
}
|
||||
}
|
||||
module.exports = PodcastMetadata
|
||||
module.exports = PodcastMetadata
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue