pub struct Episode {Show 13 fields
pub title: String,
pub link: String,
pub enclosure_url: String,
pub byte_len: u64,
pub duration_secs: u64,
pub published_at: i64,
pub slug: Option<String>,
pub order: Option<u32>,
pub tracklist: Option<String>,
pub body: Option<String>,
pub links: Option<String>,
pub bundle_title: Option<String>,
pub special: bool,
}Expand description
One episode of musicforprogramming.net.
Fields§
§title: String§link: StringThe episode’s page on the site.
enclosure_url: StringThe audio enclosure URL, and the episode’s stable identity: enrichment records join to episodes by exact string equality against it.
byte_len: u64The byte length the feed declares for the enclosure.
duration_secs: u64The duration the feed declares in itunes:duration, in seconds.
An approximate total, never a measured audio length. Consumers must present it as approximate.
published_at: i64Publication time as whole seconds since the Unix epoch.
slug: Option<String>Site slug, when enrichment supplied one.
order: Option<u32>The site’s own catalog ordering, when enrichment supplied one.
tracklist: Option<String>Track listing as plain text, one track per line, when enrichment supplied one.
body: Option<String>Descriptive body as plain text, when enrichment supplied one.
links: Option<String>Related links as plain text, one per line, when enrichment supplied any.
bundle_title: Option<String>The site’s own title for this episode, when enrichment supplied one.
The feed says Episode 79: Corticyte where the site says 79: Corticyte, and
anything replicating the site’s presentation wants the latter, which
Episode::site_title resolves.
special: boolWhether the site flags this episode for distinct colouring.
Exactly one episode carries it today; absent enrichment every episode reports
false, so an unknown flag is never mistaken for a set one. Presentation only:
ordering, playback, and download all ignore it.
Implementations§
Source§impl Episode
impl Episode
Sourcepub fn id(&self) -> Cow<'_, str>
pub fn id(&self) -> Cow<'_, str>
The episode’s stable filesystem-safe identifier, used to name its on-disk artifacts
and as the slug clients pass over the wire.
The enrichment slug where one exists, a deterministic derivation from the enclosure URL otherwise, so the same episode resolves to the same name across runs whether or not enrichment succeeded. Borrowed from the slug in the enriched case, so scanning the catalog for one identifier allocates nothing.
Source§impl Episode
impl Episode
Sourcepub fn site_title(&self) -> &str
pub fn site_title(&self) -> &str
The title as the site itself writes it, which every view replicating the site draws.
Enrichment’s title where there is one, otherwise the feed’s with its Episode
prefix stripped, since the feed writes Episode 79: Corticyte where the site writes
79: Corticyte - so an un-enriched catalog degrades to the same shape rather than
a visibly different one.