chore(bruno): add multi-library dev setup with scan-all and folder requests
Update NewDevDBSetup collection to create Ebook, Comic, and Manga libraries with separate IDs (ebook_library_id, comic_library_id, manga_library_id) instead of a single library_id. - Fix CreateComicLibrary and CreateMangaLibrary to use correct names, descriptions, and types instead of duplicating Ebook values - Update NewDB.sh to run the full setup sequence: register user, create all three libraries, add folders, then scan all - Add AddEbookLibraryFolder, AddComicLibraryFolder, and AddMangaLibraryFolder requests with per-type subfolder paths - Add ScanAllLibraries request using bru.sendRequest() to scan each library sequentially via the /api/scanner/scan endpoint - Update Get Libraries (Admin) to save all three library IDs - Update List Media Items requests to use ebook_library_id - Rename library_id to ebook_library_id in Create Library and Add Library Folder requests - Add comic_library_id and manga_library_id to environment
This commit is contained in:
@@ -0,0 +1,53 @@
|
||||
info:
|
||||
name: AddEbookLibraryFolder
|
||||
type: http
|
||||
seq: 15
|
||||
|
||||
http:
|
||||
method: POST
|
||||
url: "{{base_url}}/api/libraries/{{ebook_library_id}}/folders"
|
||||
body:
|
||||
type: json
|
||||
data: |-
|
||||
{
|
||||
"folder_path": "{{library_folder}}/Ebooks"
|
||||
}
|
||||
auth: inherit
|
||||
|
||||
runtime:
|
||||
scripts:
|
||||
- type: after-response
|
||||
code: |-
|
||||
function onResponse(res) {
|
||||
try {
|
||||
const responseBody = res.getBody();
|
||||
const id = responseBody.id;
|
||||
|
||||
if (id) {
|
||||
bru.setEnvVar("library_folder_id", id, { persist: true });
|
||||
console.log("Library Folder ID saved:", id);
|
||||
}
|
||||
|
||||
if (!id) {
|
||||
console.log("No id found in response.");
|
||||
}
|
||||
} catch (error) {
|
||||
console.error("Error in post-response script:", error.message);
|
||||
}
|
||||
}
|
||||
onResponse(res);
|
||||
|
||||
settings:
|
||||
encodeUrl: true
|
||||
timeout: 0
|
||||
followRedirects: true
|
||||
maxRedirects: 5
|
||||
|
||||
docs: |-
|
||||
## Add Library Folder
|
||||
|
||||
Adds a new folder path to a library for media scanning and indexing.
|
||||
|
||||
**Method:** POST
|
||||
|
||||
**Endpoint:** /api/libraries/{id}
|
||||
Reference in New Issue
Block a user