mirror of
https://github.com/Drop-OSS/drop.git
synced 2025-11-13 08:12:40 +10:00
* feat: add ui for library source management * fix: lint
This commit is contained in:
@ -30,7 +30,9 @@ export class FilesystemProvider
|
||||
|
||||
this.myId = id;
|
||||
this.config = config;
|
||||
fs.mkdirSync(this.config.baseDir, { recursive: true });
|
||||
|
||||
if (!fs.existsSync(this.config.baseDir))
|
||||
throw "Base directory does not exist.";
|
||||
}
|
||||
|
||||
id(): string {
|
||||
|
||||
@ -20,6 +20,19 @@ class LibraryManager {
|
||||
this.libraries.set(library.id(), library);
|
||||
}
|
||||
|
||||
removeLibrary(id: string) {
|
||||
this.libraries.delete(id);
|
||||
}
|
||||
|
||||
async fetchLibraries() {
|
||||
const libraries = await prisma.library.findMany({});
|
||||
const libraryWithMetadata = libraries.map((e) => ({
|
||||
...e,
|
||||
working: this.libraries.has(e.id),
|
||||
}));
|
||||
return libraryWithMetadata;
|
||||
}
|
||||
|
||||
async fetchAllUnimportedGames() {
|
||||
const unimportedGames: { [key: string]: string[] } = {};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user