Cleaning up, adding readme and images, genre filter

This commit is contained in:
advplyr 2021-08-19 17:29:36 -05:00
parent 2c5b5dbeae
commit d59aefd8c7
25 changed files with 269 additions and 65 deletions

View file

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