Added support for custom metadata providers

WiP but already open to feedback
This commit is contained in:
Barnabas Ratki 2024-01-03 01:36:56 +01:00
parent 8c6a2ac5dd
commit 8027c4a06f
14 changed files with 642 additions and 4 deletions

View file

@ -51,6 +51,11 @@ class LibraryController {
}
}
// Validate that the custom provider exists if given any
if (newLibraryPayload.provider && newLibraryPayload.provider.startsWith("custom-")) {
await Database.doesCustomProviderExistBySlug(newLibraryPayload.provider)
}
const library = new Library()
let currentLargestDisplayOrder = await Database.libraryModel.getMaxDisplayOrder()
@ -175,6 +180,11 @@ class LibraryController {
}
}
// Validate that the custom provider exists if given any
if (req.body.provider && req.body.provider.startsWith("custom-")) {
await Database.doesCustomProviderExistBySlug(req.body.provider)
}
const hasUpdates = library.update(req.body)
// TODO: Should check if this is an update to folder paths or name only
if (hasUpdates) {