Skip to content

Commit

Permalink
Update library API endpoints to load library items from db
Browse files Browse the repository at this point in the history
  • Loading branch information
advplyr committed Aug 13, 2023
1 parent 3651fff commit 6d6e861
Show file tree
Hide file tree
Showing 8 changed files with 352 additions and 114 deletions.
14 changes: 14 additions & 0 deletions server/Database.js
Original file line number Diff line number Diff line change
Expand Up @@ -467,6 +467,20 @@ class Database {
}
}
}

removeNarratorFromFilterData(narrator) {
for (const libraryId in this.libraryFilterData) {
this.libraryFilterData[libraryId].narrators = this.libraryFilterData[libraryId].narrators.filter(n => n !== narrator)
}
}

addNarratorToFilterData(narrator) {
for (const libraryId in this.libraryFilterData) {
if (!this.libraryFilterData[libraryId].narrators.includes(narrator)) {
this.libraryFilterData[libraryId].narrators.push(narrator)
}
}
}
}

module.exports = new Database()
Loading

0 comments on commit 6d6e861

Please sign in to comment.