youtube feeder improvement
Publish image / publish (push) Failing after 13s

This commit is contained in:
Worph
2026-08-25 12:55:10 +02:00
parent 33f31d0d8b
commit dbf9f80b14
3 changed files with 598 additions and 10 deletions
@@ -55,3 +55,28 @@ pub const MAX_REFS_PER_RECORDING: usize = 3;
// MusicBrainz's published rate ceiling, from the crate that owns that client.
pub use musicbrainz_feeder::consts::{MB_BURST, MB_RATE_PER_SEC, MB_TIMEOUT_SECS};
/// Ceiling on raw free-text video hits emitted for one query.
///
/// The music paths thin their results with a *verification* — channel identity
/// plus duration — and refuse everything that fails it. The raw tier has no
/// such filter by construction, so the only bound available is a count. 20 is a
/// search page's worth: enough for the section to be useful, few enough that
/// one query does not pull a hundred thumbnails into the gateway's blockstore
/// (`poster_url` is fetched **and seeded** by the core, unlike a `cover`
/// locator, which stays lazy).
pub const YT_VIDEO_SEARCH_MAX: usize = 20;
/// Left half of a raw video tier record id (`yt~<videoId>`).
///
/// The music tier keys a record on `<mbRecordingId>~<videoId>` because the same
/// video can legitimately be the reference for more than one recording. The raw
/// tier has no such second axis — a video is itself and nothing else — so the
/// left half is a constant, which makes the id a pure function of the video id
/// and lets the gateway dedupe the same hit across different search terms.
///
/// ⚠ It must stay parseable by [`crate::youtube::split_track_record_id`]: the
/// `~` split is what keeps `compute_outcomes` a zero-I/O pure function for both
/// tiers. A left half that could collide with a MusicBrainz id would be a bug;
/// `yt` cannot, since MBIDs are UUIDs.
pub const VIDEO_RECORD_NS: &str = "yt";