* feat: add ui for library source management * fix: lint
This commit is contained in:
@@ -49,6 +49,11 @@ export const systemACLDescriptions: ObjectFromList<typeof systemACLs> = {
|
||||
"auth:simple:invitation:delete": "Delete a simple auth invitation.",
|
||||
|
||||
"library:read": "Fetch a list of all games on this instance.",
|
||||
"library:sources:read":
|
||||
"Fetch a list of all library sources on this instance",
|
||||
"library:sources:new": "Create a new library source.",
|
||||
"library:sources:update": "Update existing library sources.",
|
||||
"library:sources:delete": "Delete library sources.",
|
||||
|
||||
"notifications:read": "Read system notifications.",
|
||||
"notifications:mark": "Mark system notifications as read.",
|
||||
|
||||
@@ -50,6 +50,11 @@ export const systemACLs = [
|
||||
"notifications:delete",
|
||||
|
||||
"library:read",
|
||||
"library:sources:read",
|
||||
"library:sources:new",
|
||||
"library:sources:update",
|
||||
"library:sources:delete",
|
||||
|
||||
"game:read",
|
||||
"game:update",
|
||||
"game:delete",
|
||||
|
||||
@@ -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