mirror of
https://github.com/advplyr/audiobookshelf.git
synced 2026-02-28 21:19:42 +00:00
Added Started Series to the progress list (only on the series page).
This allows people to see all Series they have started, but not finished. It'll only be used on the series page, keeping the original filters/behavior for the Library / bookshelf views.
This commit is contained in:
parent
8498378bca
commit
c084766a24
2 changed files with 15 additions and 2 deletions
|
|
@ -389,7 +389,7 @@ export default {
|
|||
return this.filterData.publishedDecades || []
|
||||
},
|
||||
progress() {
|
||||
return [
|
||||
const items = [
|
||||
{
|
||||
id: 'finished',
|
||||
name: this.$strings.LabelFinished
|
||||
|
|
@ -398,6 +398,15 @@ export default {
|
|||
id: 'in-progress',
|
||||
name: this.$strings.LabelInProgress
|
||||
},
|
||||
]
|
||||
// only add "started series" filter in series view
|
||||
if (this.isSeries) {
|
||||
items.push({
|
||||
id: 'started-series',
|
||||
name: this.$strings.LabelStarted
|
||||
})
|
||||
}
|
||||
items.push(
|
||||
{
|
||||
id: 'not-started',
|
||||
name: this.$strings.LabelNotStarted
|
||||
|
|
@ -406,7 +415,8 @@ export default {
|
|||
id: 'not-finished',
|
||||
name: this.$strings.LabelNotFinished
|
||||
}
|
||||
]
|
||||
)
|
||||
return items
|
||||
},
|
||||
tracks() {
|
||||
return [
|
||||
|
|
|
|||
|
|
@ -83,6 +83,9 @@ module.exports = {
|
|||
const progQuery = 'SELECT count(*) FROM books b, bookSeries bs LEFT OUTER JOIN mediaProgresses mp ON mp.mediaItemId = b.id AND mp.userId = :userId WHERE bs.seriesId = series.id AND bs.bookId = b.id AND (mp.isFinished = 1 OR mp.currentTime > 0)'
|
||||
seriesWhere.push(Sequelize.where(Sequelize.literal(`(${progQuery})`), 0))
|
||||
userPermissionBookWhere.replacements.userId = user.id
|
||||
} else if (filterValue === 'started-series') {
|
||||
attrQuery = 'SELECT count(*) FROM books b, bookSeries bs LEFT OUTER JOIN mediaProgresses mp ON mp.mediaItemId = b.id AND mp.userId = :userId WHERE bs.seriesId = series.id AND bs.bookId = b.id AND (mp.isFinished = 1 OR mp.currentTime > 0 OR mp.ebookProgress > 0)'
|
||||
userPermissionBookWhere.replacements.userId = user.id
|
||||
} else if (filterValue === 'in-progress') {
|
||||
attrQuery = 'SELECT count(*) FROM books b, bookSeries bs LEFT OUTER JOIN mediaProgresses mp ON mp.mediaItemId = b.id AND mp.userId = :userId WHERE bs.seriesId = series.id AND bs.bookId = b.id AND (mp.currentTime > 0 OR mp.ebookProgress > 0) AND mp.isFinished = 0'
|
||||
userPermissionBookWhere.replacements.userId = user.id
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue