Add:Ebook and supplementary ebook library filters

This commit is contained in:
advplyr 2023-06-10 15:59:44 -05:00
parent a9f5c64204
commit aae92649b1
15 changed files with 56 additions and 5 deletions

View File

@ -188,9 +188,9 @@ export default {
sublist: true sublist: true
}, },
{ {
text: this.$strings.LabelEbook, text: this.$strings.LabelEbooks,
value: 'ebook', value: 'ebooks',
sublist: false sublist: true
}, },
{ {
text: this.$strings.LabelAbridged, text: this.$strings.LabelAbridged,
@ -341,6 +341,18 @@ export default {
} }
] ]
}, },
ebooks() {
return [
{
id: 'ebook',
name: this.$strings.LabelHasEbook
},
{
id: 'supplementary',
name: this.$strings.LabelHasSupplementaryEbook
}
]
},
missing() { missing() {
return [ return [
{ {

View File

@ -80,7 +80,7 @@ export const actions = {
if (state.settings.orderBy == 'media.metadata.publishedYear') { if (state.settings.orderBy == 'media.metadata.publishedYear') {
settingsUpdate.orderBy = 'media.metadata.title' settingsUpdate.orderBy = 'media.metadata.title'
} }
const invalidFilters = ['series', 'authors', 'narrators', 'languages', 'progress', 'issues'] const invalidFilters = ['series', 'authors', 'narrators', 'languages', 'progress', 'issues', 'ebooks', 'abridged']
const filterByFirstPart = (state.settings.filterBy || '').split('.').shift() const filterByFirstPart = (state.settings.filterBy || '').split('.').shift()
if (invalidFilters.includes(filterByFirstPart)) { if (invalidFilters.includes(filterByFirstPart)) {
settingsUpdate.filterBy = 'all' settingsUpdate.filterBy = 'all'

View File

@ -224,6 +224,7 @@
"LabelDuration": "Laufzeit", "LabelDuration": "Laufzeit",
"LabelDurationFound": "Gefundene Laufzeit:", "LabelDurationFound": "Gefundene Laufzeit:",
"LabelEbook": "Ebook", "LabelEbook": "Ebook",
"LabelEbooks": "Ebooks",
"LabelEdit": "Bearbeiten", "LabelEdit": "Bearbeiten",
"LabelEmail": "Email", "LabelEmail": "Email",
"LabelEmailSettingsFromAddress": "From Address", "LabelEmailSettingsFromAddress": "From Address",
@ -251,6 +252,8 @@
"LabelGenre": "Kategorie", "LabelGenre": "Kategorie",
"LabelGenres": "Kategorien", "LabelGenres": "Kategorien",
"LabelHardDeleteFile": "Datei dauerhaft löschen", "LabelHardDeleteFile": "Datei dauerhaft löschen",
"LabelHasEbook": "Has ebook",
"LabelHasSupplementaryEbook": "Has supplementary ebook",
"LabelHost": "Host", "LabelHost": "Host",
"LabelHour": "Stunde", "LabelHour": "Stunde",
"LabelIcon": "Symbol", "LabelIcon": "Symbol",

View File

@ -224,6 +224,7 @@
"LabelDuration": "Duration", "LabelDuration": "Duration",
"LabelDurationFound": "Duration found:", "LabelDurationFound": "Duration found:",
"LabelEbook": "Ebook", "LabelEbook": "Ebook",
"LabelEbooks": "Ebooks",
"LabelEdit": "Edit", "LabelEdit": "Edit",
"LabelEmail": "Email", "LabelEmail": "Email",
"LabelEmailSettingsFromAddress": "From Address", "LabelEmailSettingsFromAddress": "From Address",
@ -251,6 +252,8 @@
"LabelGenre": "Genre", "LabelGenre": "Genre",
"LabelGenres": "Genres", "LabelGenres": "Genres",
"LabelHardDeleteFile": "Hard delete file", "LabelHardDeleteFile": "Hard delete file",
"LabelHasEbook": "Has ebook",
"LabelHasSupplementaryEbook": "Has supplementary ebook",
"LabelHost": "Host", "LabelHost": "Host",
"LabelHour": "Hour", "LabelHour": "Hour",
"LabelIcon": "Icon", "LabelIcon": "Icon",

View File

@ -224,6 +224,7 @@
"LabelDuration": "Duración", "LabelDuration": "Duración",
"LabelDurationFound": "Duración Comprobada:", "LabelDurationFound": "Duración Comprobada:",
"LabelEbook": "Ebook", "LabelEbook": "Ebook",
"LabelEbooks": "Ebooks",
"LabelEdit": "Editar", "LabelEdit": "Editar",
"LabelEmail": "Email", "LabelEmail": "Email",
"LabelEmailSettingsFromAddress": "From Address", "LabelEmailSettingsFromAddress": "From Address",
@ -251,6 +252,8 @@
"LabelGenre": "Genero", "LabelGenre": "Genero",
"LabelGenres": "Géneros", "LabelGenres": "Géneros",
"LabelHardDeleteFile": "Eliminar Definitivamente", "LabelHardDeleteFile": "Eliminar Definitivamente",
"LabelHasEbook": "Has ebook",
"LabelHasSupplementaryEbook": "Has supplementary ebook",
"LabelHost": "Host", "LabelHost": "Host",
"LabelHour": "Hora", "LabelHour": "Hora",
"LabelIcon": "Icono", "LabelIcon": "Icono",

View File

@ -224,6 +224,7 @@
"LabelDuration": "Durée", "LabelDuration": "Durée",
"LabelDurationFound": "Durée trouvée :", "LabelDurationFound": "Durée trouvée :",
"LabelEbook": "E-book", "LabelEbook": "E-book",
"LabelEbooks": "Ebooks",
"LabelEdit": "Modifier", "LabelEdit": "Modifier",
"LabelEmail": "E-mail", "LabelEmail": "E-mail",
"LabelEmailSettingsFromAddress": "Expéditeur", "LabelEmailSettingsFromAddress": "Expéditeur",
@ -251,6 +252,8 @@
"LabelGenre": "Genre", "LabelGenre": "Genre",
"LabelGenres": "Genres", "LabelGenres": "Genres",
"LabelHardDeleteFile": "Suppression du fichier", "LabelHardDeleteFile": "Suppression du fichier",
"LabelHasEbook": "Has ebook",
"LabelHasSupplementaryEbook": "Has supplementary ebook",
"LabelHost": "Hôte", "LabelHost": "Hôte",
"LabelHour": "Heure", "LabelHour": "Heure",
"LabelIcon": "Icone", "LabelIcon": "Icone",

View File

@ -224,6 +224,7 @@
"LabelDuration": "Duration", "LabelDuration": "Duration",
"LabelDurationFound": "Duration found:", "LabelDurationFound": "Duration found:",
"LabelEbook": "Ebook", "LabelEbook": "Ebook",
"LabelEbooks": "Ebooks",
"LabelEdit": "Edit", "LabelEdit": "Edit",
"LabelEmail": "Email", "LabelEmail": "Email",
"LabelEmailSettingsFromAddress": "From Address", "LabelEmailSettingsFromAddress": "From Address",
@ -251,6 +252,8 @@
"LabelGenre": "Genre", "LabelGenre": "Genre",
"LabelGenres": "Genres", "LabelGenres": "Genres",
"LabelHardDeleteFile": "Hard delete file", "LabelHardDeleteFile": "Hard delete file",
"LabelHasEbook": "Has ebook",
"LabelHasSupplementaryEbook": "Has supplementary ebook",
"LabelHost": "Host", "LabelHost": "Host",
"LabelHour": "Hour", "LabelHour": "Hour",
"LabelIcon": "Icon", "LabelIcon": "Icon",

View File

@ -224,6 +224,7 @@
"LabelDuration": "Duration", "LabelDuration": "Duration",
"LabelDurationFound": "Duration found:", "LabelDurationFound": "Duration found:",
"LabelEbook": "Ebook", "LabelEbook": "Ebook",
"LabelEbooks": "Ebooks",
"LabelEdit": "Edit", "LabelEdit": "Edit",
"LabelEmail": "Email", "LabelEmail": "Email",
"LabelEmailSettingsFromAddress": "From Address", "LabelEmailSettingsFromAddress": "From Address",
@ -251,6 +252,8 @@
"LabelGenre": "Genre", "LabelGenre": "Genre",
"LabelGenres": "Genres", "LabelGenres": "Genres",
"LabelHardDeleteFile": "Hard delete file", "LabelHardDeleteFile": "Hard delete file",
"LabelHasEbook": "Has ebook",
"LabelHasSupplementaryEbook": "Has supplementary ebook",
"LabelHost": "Host", "LabelHost": "Host",
"LabelHour": "Hour", "LabelHour": "Hour",
"LabelIcon": "Icon", "LabelIcon": "Icon",

View File

@ -224,6 +224,7 @@
"LabelDuration": "Trajanje", "LabelDuration": "Trajanje",
"LabelDurationFound": "Pronađeno trajanje:", "LabelDurationFound": "Pronađeno trajanje:",
"LabelEbook": "Ebook", "LabelEbook": "Ebook",
"LabelEbooks": "Ebooks",
"LabelEdit": "Uredi", "LabelEdit": "Uredi",
"LabelEmail": "Email", "LabelEmail": "Email",
"LabelEmailSettingsFromAddress": "From Address", "LabelEmailSettingsFromAddress": "From Address",
@ -251,6 +252,8 @@
"LabelGenre": "Genre", "LabelGenre": "Genre",
"LabelGenres": "Žanrovi", "LabelGenres": "Žanrovi",
"LabelHardDeleteFile": "Obriši datoteku zauvijek", "LabelHardDeleteFile": "Obriši datoteku zauvijek",
"LabelHasEbook": "Has ebook",
"LabelHasSupplementaryEbook": "Has supplementary ebook",
"LabelHost": "Host", "LabelHost": "Host",
"LabelHour": "Sat", "LabelHour": "Sat",
"LabelIcon": "Ikona", "LabelIcon": "Ikona",

View File

@ -224,6 +224,7 @@
"LabelDuration": "Durata", "LabelDuration": "Durata",
"LabelDurationFound": "Durata Trovata:", "LabelDurationFound": "Durata Trovata:",
"LabelEbook": "Ebook", "LabelEbook": "Ebook",
"LabelEbooks": "Ebooks",
"LabelEdit": "Modifica", "LabelEdit": "Modifica",
"LabelEmail": "Email", "LabelEmail": "Email",
"LabelEmailSettingsFromAddress": "From Address", "LabelEmailSettingsFromAddress": "From Address",
@ -251,6 +252,8 @@
"LabelGenre": "Genere", "LabelGenre": "Genere",
"LabelGenres": "Generi", "LabelGenres": "Generi",
"LabelHardDeleteFile": "Elimina Definitivamente", "LabelHardDeleteFile": "Elimina Definitivamente",
"LabelHasEbook": "Has ebook",
"LabelHasSupplementaryEbook": "Has supplementary ebook",
"LabelHost": "Host", "LabelHost": "Host",
"LabelHour": "Ora", "LabelHour": "Ora",
"LabelIcon": "Icona", "LabelIcon": "Icona",

View File

@ -224,6 +224,7 @@
"LabelDuration": "Duur", "LabelDuration": "Duur",
"LabelDurationFound": "Gevonden duur:", "LabelDurationFound": "Gevonden duur:",
"LabelEbook": "Ebook", "LabelEbook": "Ebook",
"LabelEbooks": "Ebooks",
"LabelEdit": "Wijzig", "LabelEdit": "Wijzig",
"LabelEmail": "Email", "LabelEmail": "Email",
"LabelEmailSettingsFromAddress": "From Address", "LabelEmailSettingsFromAddress": "From Address",
@ -251,6 +252,8 @@
"LabelGenre": "Genre", "LabelGenre": "Genre",
"LabelGenres": "Genres", "LabelGenres": "Genres",
"LabelHardDeleteFile": "Hard-delete bestand", "LabelHardDeleteFile": "Hard-delete bestand",
"LabelHasEbook": "Has ebook",
"LabelHasSupplementaryEbook": "Has supplementary ebook",
"LabelHost": "Host", "LabelHost": "Host",
"LabelHour": "Uur", "LabelHour": "Uur",
"LabelIcon": "Icoon", "LabelIcon": "Icoon",

View File

@ -224,6 +224,7 @@
"LabelDuration": "Czas trwania", "LabelDuration": "Czas trwania",
"LabelDurationFound": "Znaleziona długość:", "LabelDurationFound": "Znaleziona długość:",
"LabelEbook": "Ebook", "LabelEbook": "Ebook",
"LabelEbooks": "Ebooks",
"LabelEdit": "Edytuj", "LabelEdit": "Edytuj",
"LabelEmail": "Email", "LabelEmail": "Email",
"LabelEmailSettingsFromAddress": "From Address", "LabelEmailSettingsFromAddress": "From Address",
@ -251,6 +252,8 @@
"LabelGenre": "Gatunek", "LabelGenre": "Gatunek",
"LabelGenres": "Gatunki", "LabelGenres": "Gatunki",
"LabelHardDeleteFile": "Usuń trwale plik", "LabelHardDeleteFile": "Usuń trwale plik",
"LabelHasEbook": "Has ebook",
"LabelHasSupplementaryEbook": "Has supplementary ebook",
"LabelHost": "Host", "LabelHost": "Host",
"LabelHour": "Godzina", "LabelHour": "Godzina",
"LabelIcon": "Ikona", "LabelIcon": "Ikona",

View File

@ -224,6 +224,7 @@
"LabelDuration": "Длина", "LabelDuration": "Длина",
"LabelDurationFound": "Найденная длина:", "LabelDurationFound": "Найденная длина:",
"LabelEbook": "Ebook", "LabelEbook": "Ebook",
"LabelEbooks": "Ebooks",
"LabelEdit": "Редактировать", "LabelEdit": "Редактировать",
"LabelEmail": "Email", "LabelEmail": "Email",
"LabelEmailSettingsFromAddress": "From Address", "LabelEmailSettingsFromAddress": "From Address",
@ -251,6 +252,8 @@
"LabelGenre": "Жанр", "LabelGenre": "Жанр",
"LabelGenres": "Жанры", "LabelGenres": "Жанры",
"LabelHardDeleteFile": "Жесткое удаление файла", "LabelHardDeleteFile": "Жесткое удаление файла",
"LabelHasEbook": "Has ebook",
"LabelHasSupplementaryEbook": "Has supplementary ebook",
"LabelHost": "Host", "LabelHost": "Host",
"LabelHour": "Часы", "LabelHour": "Часы",
"LabelIcon": "Иконка", "LabelIcon": "Иконка",

View File

@ -224,6 +224,7 @@
"LabelDuration": "持续时间", "LabelDuration": "持续时间",
"LabelDurationFound": "找到持续时间:", "LabelDurationFound": "找到持续时间:",
"LabelEbook": "Ebook", "LabelEbook": "Ebook",
"LabelEbooks": "Ebooks",
"LabelEdit": "编辑", "LabelEdit": "编辑",
"LabelEmail": "Email", "LabelEmail": "Email",
"LabelEmailSettingsFromAddress": "From Address", "LabelEmailSettingsFromAddress": "From Address",
@ -251,6 +252,8 @@
"LabelGenre": "流派", "LabelGenre": "流派",
"LabelGenres": "流派", "LabelGenres": "流派",
"LabelHardDeleteFile": "完全删除文件", "LabelHardDeleteFile": "完全删除文件",
"LabelHasEbook": "Has ebook",
"LabelHasSupplementaryEbook": "Has supplementary ebook",
"LabelHost": "Host", "LabelHost": "Host",
"LabelHour": "小时", "LabelHour": "小时",
"LabelIcon": "图标", "LabelIcon": "图标",

View File

@ -13,7 +13,7 @@ module.exports = {
getFilteredLibraryItems(libraryItems, filterBy, user, feedsArray) { getFilteredLibraryItems(libraryItems, filterBy, user, feedsArray) {
let filtered = libraryItems let filtered = libraryItems
const searchGroups = ['genres', 'tags', 'series', 'authors', 'progress', 'narrators', 'missing', 'languages', 'tracks'] const searchGroups = ['genres', 'tags', 'series', 'authors', 'progress', 'narrators', 'missing', 'languages', 'tracks', 'ebooks']
const group = searchGroups.find(_group => filterBy.startsWith(_group + '.')) const group = searchGroups.find(_group => filterBy.startsWith(_group + '.'))
if (group) { if (group) {
const filterVal = filterBy.replace(`${group}.`, '') const filterVal = filterBy.replace(`${group}.`, '')
@ -62,6 +62,9 @@ module.exports = {
} else if (group === 'tracks') { } else if (group === 'tracks') {
if (filter === 'single') filtered = filtered.filter(li => li.isBook && li.media.numTracks === 1) if (filter === 'single') filtered = filtered.filter(li => li.isBook && li.media.numTracks === 1)
else if (filter === 'multi') filtered = filtered.filter(li => li.isBook && li.media.numTracks > 1) else if (filter === 'multi') filtered = filtered.filter(li => li.isBook && li.media.numTracks > 1)
} else if (group === 'ebooks') {
if (filter === 'ebook') filtered = filtered.filter(li => li.media.ebookFile)
else if (filter === 'supplementary') filtered = filtered.filter(li => li.libraryFiles.some(lf => lf.isEBookFile && lf.ino !== li.media.ebookFile?.ino))
} }
} else if (filterBy === 'issues') { } else if (filterBy === 'issues') {
filtered = filtered.filter(li => li.hasIssues) filtered = filtered.filter(li => li.hasIssues)