feat(core,app,android,ios): quality badges from file names

Release names say what their files are — 2160p, HDR, 10-bit, Dual-Audio —
and nothing showed it. naming::quality reads those words, whatever they
are separated by, and Title::quality keeps what more than half a title's
files state, so one odd special does not mark a show down. The facts line
of a title's page ends with them: 4K, 1080p, HDR, 10-bit, Dual audio.
Release groups' names are never read.
This commit is contained in:
nvrl committed 2026-10-29 16:56:19 +01:00
1 parent a7b87cdc79
commit f4c08d03c7
7 files changed
+183 -2

No files matched your search

+10
View File
@@ -587,6 +587,10 @@ pub struct TitleRecord {
/// Minutes: an episode's length for a series, the running time of a film.
#[uniffi(default = None)]
pub runtime: Option<u32>,
/// What most of its files' names say about them — `4K`, `HDR`, `10-bit`,
/// `Dual audio` — in that order. Never a release group's name.
#[uniffi(default = [])]
pub quality: Vec<String>,
}
/// Playback preferences that outlive one file, one title and one launch.
@@ -3656,6 +3660,12 @@ fn title_record(
franchise: Vec::new(),
logo_url: metadata.and_then(|found| found.logo_url.clone()),
runtime: details.and_then(|details| details.runtime),
quality: title
.quality()
.badges()
.into_iter()
.map(str::to_owned)
.collect(),
continue_index: title.continue_with().and_then(|episode| {
let at = title.position_of(&episode.node.share_id, &episode.node.link_id)?;
u32::try_from(at).ok()