mirror of
https://github.com/advplyr/audiobookshelf.git
synced 2026-07-08 02:11:35 +00:00
feat(server): promote placeholders on scan and enforce visibility rules across list/search/author-series contexts
This commit is contained in:
parent
c0d9dc4e77
commit
2a775d434a
16 changed files with 1190 additions and 19 deletions
|
|
@ -553,7 +553,8 @@ module.exports = {
|
|||
model: Database.libraryItemModel,
|
||||
attributes: [],
|
||||
where: {
|
||||
libraryId: libraryId
|
||||
libraryId: libraryId,
|
||||
isPlaceholder: false
|
||||
}
|
||||
}
|
||||
})
|
||||
|
|
@ -582,6 +583,7 @@ module.exports = {
|
|||
attributes: [],
|
||||
where: {
|
||||
libraryId: libraryId,
|
||||
isPlaceholder: false,
|
||||
updatedAt: {
|
||||
[Sequelize.Op.gt]: new Date(lastLoadedAt)
|
||||
}
|
||||
|
|
@ -636,7 +638,8 @@ module.exports = {
|
|||
model: Database.libraryItemModel,
|
||||
attributes: ['isMissing', 'isInvalid'],
|
||||
where: {
|
||||
libraryId: libraryId
|
||||
libraryId: libraryId,
|
||||
isPlaceholder: false
|
||||
}
|
||||
},
|
||||
attributes: ['tags', 'genres', 'publisher', 'publishedYear', 'narrators', 'language']
|
||||
|
|
|
|||
|
|
@ -20,7 +20,10 @@ module.exports = {
|
|||
},
|
||||
include: [
|
||||
{
|
||||
model: Database.libraryItemModel
|
||||
model: Database.libraryItemModel,
|
||||
where: {
|
||||
isPlaceholder: false
|
||||
}
|
||||
},
|
||||
{
|
||||
model: Database.authorModel,
|
||||
|
|
@ -54,7 +57,10 @@ module.exports = {
|
|||
},
|
||||
include: [
|
||||
{
|
||||
model: Database.libraryItemModel
|
||||
model: Database.libraryItemModel,
|
||||
where: {
|
||||
isPlaceholder: false
|
||||
}
|
||||
},
|
||||
{
|
||||
model: Database.podcastEpisodeModel
|
||||
|
|
@ -85,7 +91,10 @@ module.exports = {
|
|||
},
|
||||
include: [
|
||||
{
|
||||
model: Database.libraryItemModel
|
||||
model: Database.libraryItemModel,
|
||||
where: {
|
||||
isPlaceholder: false
|
||||
}
|
||||
},
|
||||
{
|
||||
model: Database.authorModel,
|
||||
|
|
@ -115,7 +124,10 @@ module.exports = {
|
|||
},
|
||||
include: [
|
||||
{
|
||||
model: Database.libraryItemModel
|
||||
model: Database.libraryItemModel,
|
||||
where: {
|
||||
isPlaceholder: false
|
||||
}
|
||||
},
|
||||
{
|
||||
model: Database.podcastEpisodeModel
|
||||
|
|
@ -146,7 +158,10 @@ module.exports = {
|
|||
},
|
||||
include: [
|
||||
{
|
||||
model: Database.libraryItemModel
|
||||
model: Database.libraryItemModel,
|
||||
where: {
|
||||
isPlaceholder: false
|
||||
}
|
||||
},
|
||||
{
|
||||
model: Database.authorModel,
|
||||
|
|
|
|||
|
|
@ -408,8 +408,10 @@ module.exports = {
|
|||
|
||||
let bookAttributes = null
|
||||
|
||||
const allowPlaceholderItems = filterGroup === 'series' || filterGroup === 'authors'
|
||||
const libraryItemWhere = {
|
||||
libraryId
|
||||
libraryId,
|
||||
...(allowPlaceholderItems ? {} : { isPlaceholder: false })
|
||||
}
|
||||
|
||||
let seriesInclude = {
|
||||
|
|
@ -1079,7 +1081,8 @@ module.exports = {
|
|||
{
|
||||
model: Database.libraryItemModel,
|
||||
where: {
|
||||
libraryId: library.id
|
||||
libraryId: library.id,
|
||||
isPlaceholder: false
|
||||
}
|
||||
},
|
||||
{
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue