feat(server): promote placeholders on scan and enforce visibility rules across list/search/author-series contexts

This commit is contained in:
Jens Bickel 2026-02-09 17:19:20 +01:00
parent c0d9dc4e77
commit 2a775d434a
16 changed files with 1190 additions and 19 deletions

View file

@ -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']

View file

@ -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,

View file

@ -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
}
},
{