mirror of
https://github.com/advplyr/audiobookshelf.git
synced 2025-06-30 04:25:03 +02:00
Update:Only load libraries from db when needed
This commit is contained in:
parent
1c40af3eef
commit
1d974375a0
13 changed files with 189 additions and 60 deletions
|
@ -1,7 +1,18 @@
|
|||
const { DataTypes, Model } = require('sequelize')
|
||||
|
||||
module.exports = (sequelize) => {
|
||||
class LibraryFolder extends Model { }
|
||||
class LibraryFolder extends Model {
|
||||
/**
|
||||
* Gets all library folder path strings
|
||||
* @returns {Promise<string[]>} array of library folder paths
|
||||
*/
|
||||
static async getAllLibraryFolderPaths() {
|
||||
const libraryFolders = await this.findAll({
|
||||
attributes: ['path']
|
||||
})
|
||||
return libraryFolders.map(l => l.path)
|
||||
}
|
||||
}
|
||||
|
||||
LibraryFolder.init({
|
||||
id: {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue