Admin-only endpoint that re-extracts metadata and cover art for a single book from the file on disk via MediaScanner.RescanMediaItem and returns the updated media item. Normal library scans skip unchanged files, so this gives a targeted way to backfill covers for previously imported books. Includes a Bruno request alongside the existing media-items collection.
36 lines
706 B
YAML
36 lines
706 B
YAML
info:
|
|
name: Rescan Media Item
|
|
type: http
|
|
seq: 9
|
|
|
|
http:
|
|
method: POST
|
|
url: "{{base_url}}/api/media-items/{{media_item_id}}/rescan"
|
|
headers:
|
|
- name: ""
|
|
value: application/json
|
|
auth: inherit
|
|
|
|
runtime:
|
|
scripts:
|
|
- type: tests
|
|
code: |-
|
|
test_rescan_media_item_success(status, headers, body) {
|
|
if (status !== 200) {
|
|
throw new Error("Expected status 200, got " + status);
|
|
|
|
settings:
|
|
encodeUrl: true
|
|
timeout: 0
|
|
followRedirects: true
|
|
maxRedirects: 5
|
|
|
|
docs: |-
|
|
## Rescan Media Item
|
|
|
|
Re-extracts metadata and cover art for a single media item from the file on disk.
|
|
|
|
**Method:** POST
|
|
|
|
**Endpoint:** /api/media-items/{id}/rescan
|