+
-
-
+
-
+
@@ -72,7 +72,8 @@
@@ -99,6 +100,7 @@ export default {
return []
})
return {
+ mediaType: libraryItems[0].mediaType,
libraryItems
}
},
@@ -139,6 +141,9 @@ export default {
}
},
computed: {
+ isPodcastLibrary() {
+ return this.mediaType === 'podcast'
+ },
coverAspectRatio() {
return this.$store.getters['getServerSetting']('coverAspectRatio')
},
diff --git a/client/pages/item/_id/index.vue b/client/pages/item/_id/index.vue
index c1f90eaa..053273ce 100644
--- a/client/pages/item/_id/index.vue
+++ b/client/pages/item/_id/index.vue
@@ -31,7 +31,7 @@
{{ bookSubtitle }}
-
by {{ podcastAuthor }}
+
by {{ podcastAuthor || 'Unknown' }}
by {{ author }},
@@ -126,15 +126,15 @@
-
+
-
+
-
+
diff --git a/server/objects/entities/PodcastEpisode.js b/server/objects/entities/PodcastEpisode.js
index 42243af8..1c1266e1 100644
--- a/server/objects/entities/PodcastEpisode.js
+++ b/server/objects/entities/PodcastEpisode.js
@@ -59,6 +59,26 @@ class PodcastEpisode {
}
}
+ toJSONExpanded() {
+ return {
+ id: this.id,
+ index: this.index,
+ episode: this.episode,
+ episodeType: this.episodeType,
+ title: this.title,
+ subtitle: this.subtitle,
+ description: this.description,
+ enclosure: this.enclosure ? { ...this.enclosure } : null,
+ pubDate: this.pubDate,
+ audioFile: this.audioFile.toJSON(),
+ publishedAt: this.publishedAt,
+ addedAt: this.addedAt,
+ updatedAt: this.updatedAt,
+ duration: this.duration,
+ size: this.size
+ }
+ }
+
get tracks() {
return [this.audioFile]
}
diff --git a/server/objects/mediaTypes/Podcast.js b/server/objects/mediaTypes/Podcast.js
index c285c295..8bb716f7 100644
--- a/server/objects/mediaTypes/Podcast.js
+++ b/server/objects/mediaTypes/Podcast.js
@@ -47,7 +47,8 @@ class Podcast {
coverPath: this.coverPath,
tags: [...this.tags],
episodes: this.episodes.map(e => e.toJSON()),
- autoDownloadEpisodes: this.autoDownloadEpisodes
+ autoDownloadEpisodes: this.autoDownloadEpisodes,
+ size: this.size
}
}
@@ -56,8 +57,9 @@ class Podcast {
metadata: this.metadata.toJSONExpanded(),
coverPath: this.coverPath,
tags: [...this.tags],
- episodes: this.episodes.map(e => e.toJSON()),
- autoDownloadEpisodes: this.autoDownloadEpisodes
+ episodes: this.episodes.map(e => e.toJSONExpanded()),
+ autoDownloadEpisodes: this.autoDownloadEpisodes,
+ size: this.size
}
}
diff --git a/server/objects/metadata/PodcastMetadata.js b/server/objects/metadata/PodcastMetadata.js
index 8680e8b7..2bd4ebde 100644
--- a/server/objects/metadata/PodcastMetadata.js
+++ b/server/objects/metadata/PodcastMetadata.js
@@ -1,3 +1,6 @@
+const Logger = require('../../Logger')
+const { areEquivalent, copyValue } = require('../../utils/index')
+
class PodcastMetadata {
constructor(metadata) {
this.title = null
@@ -87,5 +90,20 @@ class PodcastMetadata {
this.genres = [...mediaMetadata.genres]
}
}
+
+ update(payload) {
+ var json = this.toJSON()
+ var hasUpdates = false
+ for (const key in json) {
+ if (payload[key] !== undefined) {
+ if (!areEquivalent(payload[key], json[key])) {
+ this[key] = copyValue(payload[key])
+ Logger.debug('[PodcastMetadata] Key updated', key, this[key])
+ hasUpdates = true
+ }
+ }
+ }
+ return hasUpdates
+ }
}
module.exports = PodcastMetadata
\ No newline at end of file
diff --git a/server/utils/scandir.js b/server/utils/scandir.js
index 26b20d74..feaa2cb2 100644
--- a/server/utils/scandir.js
+++ b/server/utils/scandir.js
@@ -120,12 +120,11 @@ function groupFileItemsIntoLibraryItemDirs(mediaType, fileItems) {
return libraryItemGroup
}
-function cleanFileObjects(libraryItemPath, folderPath, files) {
+function cleanFileObjects(libraryItemPath, files) {
return Promise.all(files.map(async (file) => {
var filePath = Path.posix.join(libraryItemPath, file)
- var relFilePath = filePath.replace(folderPath, '')
var newLibraryFile = new LibraryFile()
- await newLibraryFile.setDataFromPath(filePath, relFilePath)
+ await newLibraryFile.setDataFromPath(filePath, file)
return newLibraryFile
}))
}
@@ -153,7 +152,7 @@ async function scanFolder(libraryMediaType, folder, serverSettings = {}) {
for (const libraryItemPath in libraryItemGrouping) {
var libraryItemData = getDataFromMediaDir(libraryMediaType, folderPath, libraryItemPath, serverSettings)
- var fileObjs = await cleanFileObjects(libraryItemData.path, folderPath, libraryItemGrouping[libraryItemPath])
+ var fileObjs = await cleanFileObjects(libraryItemData.path, libraryItemGrouping[libraryItemPath])
var libraryItemFolderStats = await getFileTimestampsWithIno(libraryItemData.path)
items.push({
folderId: folder.id,