mirror of
https://github.com/advplyr/audiobookshelf.git
synced 2025-07-24 21:04:33 +02:00
Cleaning up, adding readme and images, genre filter
This commit is contained in:
parent
2c5b5dbeae
commit
d59aefd8c7
25 changed files with 269 additions and 65 deletions
18
server/Db.js
18
server/Db.js
|
@ -154,5 +154,23 @@ class Db {
|
|||
Logger.error(`[DB] Remove entity ${entityName} Failed: ${error}`)
|
||||
})
|
||||
}
|
||||
|
||||
getGenres() {
|
||||
var allGenres = []
|
||||
this.db.audiobooks.forEach((audiobook) => {
|
||||
allGenres = allGenres.concat(audiobook.genres)
|
||||
})
|
||||
allGenres = [...new Set(allGenres)] // Removes duplicates
|
||||
return allGenres
|
||||
}
|
||||
|
||||
getTags() {
|
||||
var allTags = []
|
||||
this.db.audiobooks.forEach((audiobook) => {
|
||||
allTags = allTags.concat(audiobook.tags)
|
||||
})
|
||||
allTags = [...new Set(allTags)] // Removes duplicates
|
||||
return allTags
|
||||
}
|
||||
}
|
||||
module.exports = Db
|
Loading…
Add table
Add a link
Reference in a new issue