mirror of
https://github.com/advplyr/audiobookshelf.git
synced 2026-07-10 11:21:36 +00:00
Merge branch 'master' into mf/rssInboundManager
This commit is contained in:
commit
4de5b92fa7
44 changed files with 991 additions and 109 deletions
|
|
@ -190,6 +190,7 @@ module.exports = {
|
|||
const json = li.toJSONMinified()
|
||||
json.media.metadata.series = {
|
||||
id: filteredSeries.id,
|
||||
name: filteredSeries.name,
|
||||
sequence: filteredSeries.sequence
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -16,8 +16,8 @@ function parseCreators(metadata) {
|
|||
}
|
||||
|
||||
function fetchCreators(creators, role) {
|
||||
if (!creators || !creators.length) return null
|
||||
return [...new Set(creators.filter(c => c.role === role).map(c => c.value))]
|
||||
if (!creators?.length) return null
|
||||
return [...new Set(creators.filter(c => c.role === role && c.value).map(c => c.value))]
|
||||
}
|
||||
|
||||
function fetchTagString(metadata, tag) {
|
||||
|
|
@ -92,7 +92,7 @@ function fetchDescription(metadata) {
|
|||
|
||||
function fetchGenres(metadata) {
|
||||
if (!metadata['dc:subject'] || !metadata['dc:subject'].length) return []
|
||||
return [...new Set(metadata['dc:subject'].filter(g => typeof g === 'string'))]
|
||||
return [...new Set(metadata['dc:subject'].filter(g => g && typeof g === 'string'))]
|
||||
}
|
||||
|
||||
function fetchLanguage(metadata) {
|
||||
|
|
@ -122,7 +122,7 @@ function fetchNarrators(creators, metadata) {
|
|||
|
||||
function fetchTags(metadata) {
|
||||
if (!metadata['dc:tag'] || !metadata['dc:tag'].length) return []
|
||||
return [...new Set(metadata['dc:tag'].filter(tag => typeof tag === 'string'))]
|
||||
return [...new Set(metadata['dc:tag'].filter(tag => tag && typeof tag === 'string'))]
|
||||
}
|
||||
|
||||
function stripPrefix(str) {
|
||||
|
|
|
|||
|
|
@ -205,6 +205,15 @@ module.exports = {
|
|||
}
|
||||
}
|
||||
]
|
||||
|
||||
// Handle library setting to hide single book series
|
||||
// TODO: Merge with existing query
|
||||
if (library.settings.hideSingleBookSeries) {
|
||||
seriesWhere.push(Sequelize.where(Sequelize.literal(`(SELECT count(*) FROM books b, bookSeries bs WHERE bs.seriesId = series.id AND bs.bookId = b.id)`), {
|
||||
[Sequelize.Op.gt]: 1
|
||||
}))
|
||||
}
|
||||
|
||||
// Handle user permissions to only include series with at least 1 book
|
||||
// TODO: Simplify to a single query
|
||||
if (userPermissionBookWhere.bookWhere.length) {
|
||||
|
|
|
|||
|
|
@ -247,7 +247,7 @@ module.exports = {
|
|||
podcastEpisodeWhere['$mediaProgresses.isFinished$'] = true
|
||||
}
|
||||
} else if (filterGroup === 'recent') {
|
||||
libraryItemWhere['createdAt'] = {
|
||||
podcastEpisodeWhere['createdAt'] = {
|
||||
[Sequelize.Op.gte]: new Date(new Date() - (60 * 24 * 60 * 60 * 1000)) // 60 days ago
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue