Files
bookhoard/bruno/media-items/List Media Items Sorted.yml
T
john-okeefe 58a30b6561 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
2026-04-19 18:08:39 -04:00

82 lines
2.5 KiB
YAML

info:
name: List Media Items with Sorting
type: http
seq: 2
http:
method: GET
url: "{{base_url}}/api/media-items?library_id={{ebook_library_id}}&sort=title+ASC&limit=10&offset=0"
headers:
- name: ""
value: application/json
params:
- name: library_id
value: "{{ebook_library_id}}"
type: query
- name: sort
value: title+ASC
type: query
- name: limit
value: "10"
type: query
- name: offset
value: "0"
type: query
auth: inherit
settings:
encodeUrl: true
timeout: 0
followRedirects: true
maxRedirects: 5
docs: |-
## List Media Items with Sorting
**Method:** GET
**Endpoint:** /api/media-items
**Authentication:** Required (Bearer token)
**Query Parameters:**
- `library_id` (string, required): UUID of the library
- `sort` (string, optional): Sort field and direction
- Available options:
- `created_at ASC` - Oldest added first
- `created_at DESC` - Newest added first (default)
- `title ASC` - Title A-Z
- `title DESC` - Title Z-A
- `author ASC` - Author A-Z
- `author DESC` - Author Z-A
- `series ASC` - Series order
- `series DESC` - Series reverse order
- `date_published ASC` - Oldest published first
- `date_published DESC` - Newest published first
- `copyright_year ASC` - Oldest copyright first
- `copyright_year DESC` - Newest copyright first
- `page_count ASC` - Shortest first
- `page_count DESC` - Longest first
- `tags ASC` - Genre A-Z
- `tags DESC` - Genre Z-A
- `limit` (integer, optional): Number of items to return (default: 50, max: 1000)
- `offset` (integer, optional): Number of items to skip (default: 0)
**Response:** Object containing array of media items
**Status Codes:**
- 200: Success
- 400: Bad request (invalid parameters)
- 401: Unauthorized
- 500: Internal server error
**Examples:**
- Sort by title: `/api/media-items?library_id=xxx&sort=title+ASC`
- Sort by author descending: `/api/media-items?library_id=xxx&sort=author+DESC`
- Sort by page count: `/api/media-items?library_id=xxx&sort=page_count+ASC`
**Sorting Behavior:**
- All sorts are secondary-sorted by series_number then title for consistency
- NULL values are sorted last for ascending, first for descending
- Sorting is case-insensitive for text fields