Files
Deluan Quintão 48059a46a1 feat(insights): report Jellyfin, ffmpeg, mpv, DB size, scan timing and library totals (#6581)
* feat(insights): report Jellyfin, ffmpeg, DB size, scan timing and library totals

Adds to the anonymous insights payload: the Jellyfin API flags, whether ffmpeg is available and its major version, the database file size, the scanner's PurgeMissing/FollowSymlinks/IgnoreDotFolders/RespectNoMedia options, missing files and total library size summed across libraries, and the duration of the last full scan.

Nothing stored the duration of a full scan once a quick scan ran after it, so the scanner now saves it in the LastFullScanDuration property after each successful, non-selective full scan.

DSN parsing for the database file path moves to db.FilePath, shared with the CLI's existingDBFile, which now also handles file: URIs.

* feat(insights): report mpv and the last quick scan duration

Adds mpv availability and its major.minor version (every mpv release is 0.x, so the major alone says nothing), using new mpv.IsAvailable and mpv.Version helpers. ffmpeg and mpv now share one BinaryInfo shape in the payload.

The scanner also saves the duration of the last quick scan of all libraries. Selective scans, and quick scans that resume an interrupted full scan, record neither duration. Both durations are now reported in milliseconds, since most quick scans finish in under a second.

* refactor(mpv): drop an unneeded nosec on the version command

* fix(insights): only record durations of complete scans, and decode file: DSN paths

A scan that resumes an interrupted scan skips the folders that scan already processed, and a library that fails to start or to scan adds almost no time. The scanner now records a duration only when no library resumed prior work and none failed, and it marks libraries dropped in prepareLibrariesForScan as failed.

db.FilePath now matches SQLite for file: URIs: the path ends at '?' or '#', and %HH escapes are decoded.

* fix(scanner): skip the quick scan duration when a PID change forces a full rescan

* fix(db): drop the authority from file: URIs in FilePath

* feat(insights): send the raw ffmpeg and mpv version strings

Grouping versions in Navidrome fixes the buckets in each release and hides details such as ffmpeg 5.0 vs 5.1 or the build source. The raw token, capped at 64 characters, lets the insights server group them as needed.

* test(scanner): table the scan duration specs

One row per scan setup, each checking both durations, replaces 13 separate specs.
2026-11-29 14:09:48 -05:00
..