pub struct Plan {
pub items: Vec<Item>,
pub renamed: Vec<Renamed>,
pub rootless: Vec<PathBuf>,
pub rejected: Vec<Failed>,
pub covers_the_target_cannot_hold: usize,
pub tags_the_target_cannot_hold: usize,
}Expand description
Everything a copy would do, decided before anything is written.
Fields§
§items: Vec<Item>The files to write, in a stable order.
renamed: Vec<Renamed>Every component the destination filesystem forced a change to.
rootless: Vec<PathBuf>Selected files sitting under no watched root, which therefore have no tree to keep. Reported rather than dropped, and rather than invented a place for.
rejected: Vec<Failed>Sources or requested companion folders that cannot be read or converted as requested. The caller must refuse these before writing.
covers_the_target_cannot_hold: usizeAudio files being encoded whose embedded cover cannot follow them into
the target format, because ffmpeg refuses to mux a picture stream into
it — see transcode::Target::keeps_embedded_art. Counted rather
than named: the loss is the same whichever file it happens to.
Audio files being encoded into a target whose tag format has no room
for one of the tags they carry — see
transcode::Target::tags_it_would_drop. In practice this is wav
and its fixed legacy vocabulary; every other target takes an
arbitrary key and never adds to this count.
Implementations§
Source§impl Plan
impl Plan
Sourcepub fn prepare_playlists(
&mut self,
catalog: &Catalog,
tracks: &[Id],
) -> Result<usize, String>
pub fn prepare_playlists( &mut self, catalog: &Catalog, tracks: &[Id], ) -> Result<usize, String>
Rewrites selected M3U/M3U8 companions and adds a selection M3U8.
Source playlists are read as UTF-8 and left untouched. Entries not in this plan (including remote URLs) are omitted; the returned count makes that narrowing visible. Paths refer to adapted names and converted extensions, relative to each destination playlist. The generated selection follows the caller’s track order.
Source§impl Plan
How many files the plan would encode rather than copy.
impl Plan
How many files the plan would encode rather than copy.
Sourcepub fn converted(&self) -> usize
pub fn converted(&self) -> usize
Items that go through an encoder, and those that are copied as they are.
Reported separately because the difference is the one thing a user needs to see before a conversion starts: a library that is half MP3 already comes out half untouched, and a count that hid that would look like the conversion had silently skipped things.
Sourcepub fn size_is_estimated(&self) -> bool
pub fn size_is_estimated(&self) -> bool
true when any size in the plan is an encoder’s output, and therefore
a guess rather than a measurement.