music indexer: index videos (concerts/clips) in artist/album dirs
Videos (all phone-compatible .mp4, plus common containers) that live in an artist or album folder are now indexed alongside audio: - Move 'mp4' out of AUDIO_EXT into a new VIDEO_EXT (mp4/m4v/mkv/mov/webm/avi) — it was wrongly treated as an audio track before. - ffprobeVideo captures file/title/durationSec/width/height per video. - meta.json gains an optional `videos: IndexVideo[]`; a folder with only videos now still gets a meta.json. Manifest entries gain optional `videos: N`. - Video files join the album version signature (changes bump `v` for resync). - New `videosIndexed` status counter + resync-log line. Location is inherent in the folder rel (always an artist/album dir), so no extra location field is needed. MUSIC_API.md documents the videos field + manifest count. No poster/thumbnail generation yet (folder cover is reused). Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
+18
-4
@@ -65,6 +65,7 @@ GET /api/music/manifest
|
||||
"albums": {
|
||||
"Albums/AC-DC/[1980] Back in Black": { "v": "50856380f1ca8f9", "cover": true, "tracks": 10 },
|
||||
"DJ Sets/Dave Clarke": { "v": "a1b2c3d4e5f6a7b", "cover": false, "tracks": 3 },
|
||||
"Albums/Metallica/[1989] Live Shit": { "v": "beefbeefbeefbee", "cover": true, "tracks": 0, "videos": 2 },
|
||||
"Albums/AC-DC": { "v": "c0ffee1234567890", "cover": true, "tracks": 0, "disco": true }
|
||||
// …
|
||||
}
|
||||
@@ -72,7 +73,9 @@ GET /api/music/manifest
|
||||
```
|
||||
`404` if the index has never been built (see §3). Entries with **`tracks: 0`** are container folders (e.g. an
|
||||
**artist** folder). An entry with **`disco: true`** is an artist folder that has a discography — fetch its
|
||||
grouping via `/discography` (§2.4).
|
||||
grouping via `/discography` (§2.4). **`videos: N`** (optional) counts video files (concerts, clips) that live
|
||||
directly in that artist/album folder — their per-file metadata is in that folder's `meta.json` (§2.2). A folder
|
||||
may have any mix of `tracks`, `videos`, and `disco`.
|
||||
|
||||
### 2.2 Album metadata
|
||||
|
||||
@@ -96,11 +99,22 @@ Returns the album's `meta.json`. Sends `ETag: <v>`; a request with `If-None-Matc
|
||||
"durationSec": 312
|
||||
}
|
||||
// …
|
||||
],
|
||||
"videos": [ // present only for folders that contain video files
|
||||
{
|
||||
"file": "1989 - Seattle.mp4", // filename within the folder
|
||||
"title": "Live Shit: Seattle", // from the container title tag, if any
|
||||
"durationSec": 8130,
|
||||
"width": 1280,
|
||||
"height": 720
|
||||
}
|
||||
// …
|
||||
]
|
||||
}
|
||||
```
|
||||
All track fields except `file` are optional (absent when the tag is missing).
|
||||
To stream a track: `GET /api/music/stream?path=Music/<rel>/<file>`.
|
||||
All track/video fields except `file` are optional (absent when the tag/stream info is missing). `videos` is
|
||||
omitted entirely when the folder has none.
|
||||
To stream a track or video: `GET /api/music/stream?path=Music/<rel>/<file>` (byte-range; works for `.mp4`).
|
||||
|
||||
### 2.3 Cover
|
||||
|
||||
@@ -160,7 +174,7 @@ GET /api/music/reindex/status → IndexStatus snapshot
|
||||
"running": true,
|
||||
"startedAt": 1785034701973, "finishedAt": null,
|
||||
"foldersScanned": 45, "albumsBuilt": 12, "albumsSkipped": 3,
|
||||
"tracksIndexed": 320, "coversSaved": 12, "discographies": 3,
|
||||
"tracksIndexed": 320, "videosIndexed": 4, "coversSaved": 12, "discographies": 3,
|
||||
"currentPath": "Albums/AC-DC/[1980] Back in Black",
|
||||
"error": null
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user