From af3c3019cf6e1eb5b0d57ecd4253c63c940c65f9 Mon Sep 17 00:00:00 2001 From: John O'Keefe Date: Fri, 27 Mar 2026 21:14:34 -0400 Subject: [PATCH] refactor: reorganize Bruno API collection for better structure - Remove obsolete scenarios/ folder and move requests to root media-items/ - Create new filters/ folder for field value autocomplete searches - Move Field Values Search requests from search/ to filters/ for clarity - Move Search Media Items from scenarios/ to search/ for consistency - Update sequence numbers across all media-items requests (2-13) - Remove redundant folder configuration files - Improve API collection organization for better discoverability --- bruno/media-items/Create Media Item.yml | 2 +- bruno/media-items/Create Media Rating.yml | 2 +- bruno/media-items/Delete Media Item.yml | 2 +- bruno/media-items/Delete Media Rating.yml | 2 +- bruno/media-items/EPUB Download.yml | 2 +- bruno/media-items/Get Media Item.yml | 2 +- bruno/media-items/Get Media Rating.yml | 2 +- .../List Media Items Sorted.yml | 19 ++-- .../{scenarios => }/List Media Items.yml | 0 bruno/media-items/Update Media Item.yml | 2 +- bruno/media-items/Update Media Rating.yml | 2 +- .../filters/Field Values Search - Authors.yml | 89 +++++++++++++++++++ .../filters/Field Values Search - Genres.yml | 89 +++++++++++++++++++ .../Field Values Search - Languages.yml | 89 +++++++++++++++++++ .../filters/Field Values Search - Series.yml | 89 +++++++++++++++++++ bruno/media-items/filters/folder.yml | 7 ++ .../Search Media Items.yml | 2 +- .../{scenarios => search}/folder.yml | 4 +- 18 files changed, 387 insertions(+), 19 deletions(-) rename bruno/media-items/{scenarios => }/List Media Items Sorted.yml (89%) rename bruno/media-items/{scenarios => }/List Media Items.yml (100%) create mode 100644 bruno/media-items/filters/Field Values Search - Authors.yml create mode 100644 bruno/media-items/filters/Field Values Search - Genres.yml create mode 100644 bruno/media-items/filters/Field Values Search - Languages.yml create mode 100644 bruno/media-items/filters/Field Values Search - Series.yml create mode 100644 bruno/media-items/filters/folder.yml rename bruno/media-items/{scenarios => search}/Search Media Items.yml (99%) rename bruno/media-items/{scenarios => search}/folder.yml (54%) diff --git a/bruno/media-items/Create Media Item.yml b/bruno/media-items/Create Media Item.yml index ad7d42d..a005f04 100644 --- a/bruno/media-items/Create Media Item.yml +++ b/bruno/media-items/Create Media Item.yml @@ -1,7 +1,7 @@ info: name: Create Media Item type: http - seq: 2 + seq: 3 http: method: POST diff --git a/bruno/media-items/Create Media Rating.yml b/bruno/media-items/Create Media Rating.yml index 1ee57f2..96d823d 100644 --- a/bruno/media-items/Create Media Rating.yml +++ b/bruno/media-items/Create Media Rating.yml @@ -1,7 +1,7 @@ info: name: Create Media Rating type: http - seq: 3 + seq: 4 http: method: POST diff --git a/bruno/media-items/Delete Media Item.yml b/bruno/media-items/Delete Media Item.yml index c2eea1b..8594e93 100644 --- a/bruno/media-items/Delete Media Item.yml +++ b/bruno/media-items/Delete Media Item.yml @@ -1,7 +1,7 @@ info: name: Delete Media Item type: http - seq: 17 + seq: 11 http: method: DELETE diff --git a/bruno/media-items/Delete Media Rating.yml b/bruno/media-items/Delete Media Rating.yml index 0a0d1c6..9c78f47 100644 --- a/bruno/media-items/Delete Media Rating.yml +++ b/bruno/media-items/Delete Media Rating.yml @@ -1,7 +1,7 @@ info: name: Delete Media Rating type: http - seq: 19 + seq: 13 http: method: DELETE diff --git a/bruno/media-items/EPUB Download.yml b/bruno/media-items/EPUB Download.yml index 4261ea5..b26e73f 100644 --- a/bruno/media-items/EPUB Download.yml +++ b/bruno/media-items/EPUB Download.yml @@ -1,7 +1,7 @@ info: name: Download Media Item type: http - seq: 4 + seq: 5 http: method: GET diff --git a/bruno/media-items/Get Media Item.yml b/bruno/media-items/Get Media Item.yml index 079e2d3..0f1bd42 100644 --- a/bruno/media-items/Get Media Item.yml +++ b/bruno/media-items/Get Media Item.yml @@ -1,7 +1,7 @@ info: name: Get Media Item type: http - seq: 12 + seq: 8 http: method: GET diff --git a/bruno/media-items/Get Media Rating.yml b/bruno/media-items/Get Media Rating.yml index 873d567..a76765b 100644 --- a/bruno/media-items/Get Media Rating.yml +++ b/bruno/media-items/Get Media Rating.yml @@ -1,7 +1,7 @@ info: name: Get Media Rating type: http - seq: 18 + seq: 12 http: method: GET diff --git a/bruno/media-items/scenarios/List Media Items Sorted.yml b/bruno/media-items/List Media Items Sorted.yml similarity index 89% rename from bruno/media-items/scenarios/List Media Items Sorted.yml rename to bruno/media-items/List Media Items Sorted.yml index 19054fe..8243d72 100644 --- a/bruno/media-items/scenarios/List Media Items Sorted.yml +++ b/bruno/media-items/List Media Items Sorted.yml @@ -1,16 +1,21 @@ info: name: List Media Items with Sorting type: http - seq: 1 + seq: 2 + http: method: GET - url: '{{base_url}}/api/media-items?library_id={{library_id}}&sort=title+ASC&limit=10&offset=0' - auth: inherit - body: - type: none + url: "{{base_url}}/api/media-items?library_id={{library_id}}&sort=title+ASC&limit=10&offset=0" headers: - - key: Content-Type - value: application/json + - name: "" + value: application/json + auth: inherit + +settings: + encodeUrl: true + timeout: 0 + followRedirects: true + maxRedirects: 5 docs: |- ## List Media Items with Sorting diff --git a/bruno/media-items/scenarios/List Media Items.yml b/bruno/media-items/List Media Items.yml similarity index 100% rename from bruno/media-items/scenarios/List Media Items.yml rename to bruno/media-items/List Media Items.yml diff --git a/bruno/media-items/Update Media Item.yml b/bruno/media-items/Update Media Item.yml index c96ffe6..87e609f 100644 --- a/bruno/media-items/Update Media Item.yml +++ b/bruno/media-items/Update Media Item.yml @@ -1,7 +1,7 @@ info: name: Update Media Item type: http - seq: 16 + seq: 10 http: method: PUT diff --git a/bruno/media-items/Update Media Rating.yml b/bruno/media-items/Update Media Rating.yml index 34e17db..179fca8 100644 --- a/bruno/media-items/Update Media Rating.yml +++ b/bruno/media-items/Update Media Rating.yml @@ -1,7 +1,7 @@ info: name: Update Media Rating type: http - seq: 14 + seq: 9 http: method: PUT diff --git a/bruno/media-items/filters/Field Values Search - Authors.yml b/bruno/media-items/filters/Field Values Search - Authors.yml new file mode 100644 index 0000000..75a8a3d --- /dev/null +++ b/bruno/media-items/filters/Field Values Search - Authors.yml @@ -0,0 +1,89 @@ +info: + name: Field Values Search - Authors + type: http + seq: 6 + +http: + method: GET + url: "{{base_url}}/api/media-items/search?library_id={{library_id}}&author=orwell&limit=50" + params: + - name: library_id + value: "{{library_id}}" + type: query + - name: author + value: orwell + type: query + - name: limit + value: "50" + type: query + auth: inherit + +settings: + encodeUrl: true + timeout: 0 + followRedirects: true + maxRedirects: 5 + +docs: |- + ## Field Values Search - Authors + + Fetches distinct author values for autocomplete dropdowns with counts and similarity scores. + + **Method:** GET + + **Endpoint:** /api/media-items/search + + **Authentication:** Required (Bearer token) + + **Query Parameters:** + - `library_id` (string, required): Library UUID to search within + - `author` (string, required): Author name to search for (fuzzy match) + - `limit` (integer, optional): Maximum results to return (default: 50) + + **How It Works:** + - Returns distinct author names from the library + - Fuzzy matches the search query against author names + - Includes count of books per author + - Includes similarity score (0-1, higher = better match) + - Sorted by similarity score, then by count + + **Use Case:** + - Populate autocomplete dropdown when user types in author filter field + - Show user available authors with book counts + - Help users discover similar author names + + **Response:** HTTP 200 (OK) + ```json + { + "results": [ + { + "value": "Asimov, Isaac", + "count": 47, + "score": 0.8 + }, + { + "value": "Asimov, Isaac & Robert Silverberg", + "count": 2, + "score": 0.75 + } + ], + "total": 2 + } + ``` + + **Examples:** + - `author=asimov` → Returns "Asimov, Isaac" (47 books), "Asimov, Isaac & Robert Silverberg" (2 books) + - `author=rowling` → Returns "Rowling, J.K." (10 books) + - `author=tolkien` → Returns "Tolkien, J.R.R." (15 books) + + **Frontend Integration:** + - Call this endpoint when user types ≥2 characters in author field + - Display results in `` or custom dropdown + - Show: "Author Name (count)" format + - Allow user to select from suggestions + + **Success Criteria:** + - Status: 200 + - Returns array of author values with counts + - Results sorted by relevance (similarity score) + - Only returns authors matching the fuzzy search diff --git a/bruno/media-items/filters/Field Values Search - Genres.yml b/bruno/media-items/filters/Field Values Search - Genres.yml new file mode 100644 index 0000000..b33db34 --- /dev/null +++ b/bruno/media-items/filters/Field Values Search - Genres.yml @@ -0,0 +1,89 @@ +info: + name: Field Values Search - Genres + type: http + seq: 3 + +http: + method: GET + url: "{{base_url}}/api/media-items/search?library_id={{library_id}}&tags=sci&limit=50" + params: + - name: library_id + value: "{{library_id}}" + type: query + - name: tags + value: sci + type: query + - name: limit + value: "50" + type: query + auth: inherit + +settings: + encodeUrl: true + timeout: 0 + followRedirects: true + maxRedirects: 5 + +docs: |- + ## Field Values Search - Genres + + Fetches distinct tags values for autocomplete dropdowns with counts and similarity scores. + + **Method:** GET + + **Endpoint:** /api/media-items/search + + **Authentication:** Required (Bearer token) + + **Query Parameters:** + - `library_id` (string, required): Library UUID to search within + - `tags` (string, required): Genre name to search for (fuzzy match) + - `limit` (integer, optional): Maximum results to return (default: 50) + + **How It Works:** + - Returns distinct tags names from the library + - Fuzzy matches the search query against tags names + - Includes count of books per tags + - Includes similarity score (0-1, higher = better match) + - Sorted by similarity score, then by count + + **Use Case:** + - Populate autocomplete dropdown when user types in tags filter field + - Show user available tagss with book counts + - Help users discover similar tags names + + **Response:** HTTP 200 (OK) + ```json + { + "results": [ + { + "value": "Sci-Fi", + "count": 234, + "score": 0.85 + }, + { + "value": "Science Fiction", + "count": 156, + "score": 0.82 + } + ], + "total": 2 + } + ``` + + **Examples:** + - `tags=sci` → Returns "Sci-Fi" (234 books), "Science Fiction" (156 books) + - `tags=fant` → Returns "Fantasy" (345 books), "High Fantasy" (89 books) + - `tags=mystery` → Returns "Mystery" (123 books), "Mystery/Thriller" (45 books) + + **Frontend Integration:** + - Call this endpoint when user types ≥2 characters in tags field + - Display results in `` or custom dropdown + - Show: "Genre Name (count)" format + - Allow user to select from suggestions + + **Success Criteria:** + - Status: 200 + - Returns array of tags values with counts + - Results sorted by relevance (similarity score) + - Only returns tagss matching the fuzzy search diff --git a/bruno/media-items/filters/Field Values Search - Languages.yml b/bruno/media-items/filters/Field Values Search - Languages.yml new file mode 100644 index 0000000..4efe18c --- /dev/null +++ b/bruno/media-items/filters/Field Values Search - Languages.yml @@ -0,0 +1,89 @@ +info: + name: Field Values Search - Languages + type: http + seq: 3 + +http: + method: GET + url: "{{base_url}}/api/media-items/search?library_id={{library_id}}&language=eng&limit=50" + params: + - name: library_id + value: "{{library_id}}" + type: query + - name: language + value: eng + type: query + - name: limit + value: "50" + type: query + auth: inherit + +settings: + encodeUrl: true + timeout: 0 + followRedirects: true + maxRedirects: 5 + +docs: |- + ## Field Values Search - Languages + + Fetches distinct language values for autocomplete dropdowns with counts and similarity scores. + + **Method:** GET + + **Endpoint:** /api/media-items/search + + **Authentication:** Required (Bearer token) + + **Query Parameters:** + - `library_id` (string, required): Library UUID to search within + - `language` (string, required): Language name/code to search for (fuzzy match) + - `limit` (integer, optional): Maximum results to return (default: 50) + + **How It Works:** + - Returns distinct language names from the library + - Fuzzy matches the search query against language names + - Includes count of books per language + - Includes similarity score (0-1, higher = better match) + - Sorted by similarity score, then by count + + **Use Case:** + - Populate autocomplete dropdown when user types in language filter field + - Show user available languages with book counts + - Help users discover similar language codes/names + + **Response:** HTTP 200 (OK) + ```json + { + "results": [ + { + "value": "English", + "count": 1245, + "score": 0.9 + }, + { + "value": "eng", + "count": 856, + "score": 0.85 + } + ], + "total": 2 + } + ``` + + **Examples:** + - `language=eng` → Returns "English" (1245 books), "eng" (856 books) + - `language=fre` → Returns "French" (234 books), "fre" (123 books) + - `language=german` → Returns "German" (189 books), "deutsch" (45 books) + + **Frontend Integration:** + - Call this endpoint when user types ≥2 characters in language field + - Display results in `` or custom dropdown + - Show: "Language Name (count)" format + - Allow user to select from suggestions + + **Success Criteria:** + - Status: 200 + - Returns array of language values with counts + - Results sorted by relevance (similarity score) + - Only returns languages matching the fuzzy search diff --git a/bruno/media-items/filters/Field Values Search - Series.yml b/bruno/media-items/filters/Field Values Search - Series.yml new file mode 100644 index 0000000..6162408 --- /dev/null +++ b/bruno/media-items/filters/Field Values Search - Series.yml @@ -0,0 +1,89 @@ +info: + name: Field Values Search - Series + type: http + seq: 3 + +http: + method: GET + url: "{{base_url}}/api/media-items/search?library_id={{library_id}}&series=haley&limit=50" + params: + - name: library_id + value: "{{library_id}}" + type: query + - name: series + value: haley + type: query + - name: limit + value: "50" + type: query + auth: inherit + +settings: + encodeUrl: true + timeout: 0 + followRedirects: true + maxRedirects: 5 + +docs: |- + ## Field Values Search - Series + + Fetches distinct series values for autocomplete dropdowns with counts and similarity scores. + + **Method:** GET + + **Endpoint:** /api/media-items/search + + **Authentication:** Required (Bearer token) + + **Query Parameters:** + - `library_id` (string, required): Library UUID to search within + - `series` (string, required): Series name to search for (fuzzy match) + - `limit` (integer, optional): Maximum results to return (default: 50) + + **How It Works:** + - Returns distinct series names from the library + - Fuzzy matches the search query against series names + - Includes count of books per series + - Includes similarity score (0-1, higher = better match) + - Sorted by similarity score, then by count + + **Use Case:** + - Populate autocomplete dropdown when user types in series filter field + - Show user available series with book counts + - Help users discover similar series names + + **Response:** HTTP 200 (OK) + ```json + { + "results": [ + { + "value": "Foundation", + "count": 7, + "score": 0.9 + }, + { + "value": "Foundation Series", + "count": 7, + "score": 0.85 + } + ], + "total": 2 + } + ``` + + **Examples:** + - `series=foundation` → Returns "Foundation" (7 books), "Foundation Series" (7 books) + - `series=harry` → Returns "Harry Potter" (10 books) + - `series=lord` → Returns "Lord of the Rings" (3 books) + + **Frontend Integration:** + - Call this endpoint when user types ≥2 characters in series field + - Display results in `` or custom dropdown + - Show: "Series Name (count)" format + - Allow user to select from suggestions + + **Success Criteria:** + - Status: 200 + - Returns array of series values with counts + - Results sorted by relevance (similarity score) + - Only returns series matching the fuzzy search diff --git a/bruno/media-items/filters/folder.yml b/bruno/media-items/filters/folder.yml new file mode 100644 index 0000000..654107d --- /dev/null +++ b/bruno/media-items/filters/folder.yml @@ -0,0 +1,7 @@ +info: + name: filters + type: folder + seq: 7 + +request: + auth: inherit diff --git a/bruno/media-items/scenarios/Search Media Items.yml b/bruno/media-items/search/Search Media Items.yml similarity index 99% rename from bruno/media-items/scenarios/Search Media Items.yml rename to bruno/media-items/search/Search Media Items.yml index e7be0d3..a028f61 100644 --- a/bruno/media-items/scenarios/Search Media Items.yml +++ b/bruno/media-items/search/Search Media Items.yml @@ -1,7 +1,7 @@ info: name: Search Media Items type: http - seq: 1 + seq: 2 http: method: GET diff --git a/bruno/media-items/scenarios/folder.yml b/bruno/media-items/search/folder.yml similarity index 54% rename from bruno/media-items/scenarios/folder.yml rename to bruno/media-items/search/folder.yml index 94a8030..999c511 100644 --- a/bruno/media-items/scenarios/folder.yml +++ b/bruno/media-items/search/folder.yml @@ -1,6 +1,6 @@ info: - name: scenarios + name: search type: folder - seq: 20 + seq: 6 request: {}