Repository navigation
Full Changelog: 1.16.2...2.0.0
spfk-metadata 2.0.0
2.0 makes saving metadata safe by default: a save writes only what changed, keeps what other apps
stored, never moves a WAV's audio, and reports exactly which parts it could not write. Released
together with spfk-metadata-base 2.0.0 (re-exported) and spfk-metadata-xmp 2.0.0.
Your data survives a save
- Other apps' metadata is kept: ID3 descriptions and languages, comments in several languages,
multi-valued tags, iTunes item names, WAV INFO and unknown chunks, cue notes (note/ltxt),
and iXML and BEXT bytes exactly as stored. - Unedited artwork is written back byte-for-byte; an MP3 keeps its ID3 version and gains no ID3v1 tag.
- A component that could not be read (tags, markers, artwork, BEXT, iXML) is never written back as
empty. The parse records it inreadStatus, and a save refuses that part. - Ogg and FLAC point chapters stay points; an overlong AIFF marker name is trimmed, not stored as "?".
- MP4 files no longer show an untitled first chapter.
Saving
- Every format saves in one write: MP3, FLAC, Ogg, MP4, AIFF, Matroska and WAV.
- WAV and AIFF saves never move the audio. When another format's audio has to move, the whole file
is written to a sibling and swapped in, so an interrupted save cannot leave it half written. - A save writes only the components whose dirty flag is set and whose content changed.
Partial saves and errors
- New
MetadataError.incompleteSave(written:failures:): a save that wrote some parts lists the
MetadataComponents it wrote and every part it left out (not read, not written, or unstorable).
A bare error now always means nothing was written. - New
saveFailed(URL)andopenFailed(URL).UnstorableMetadataErroris folded in as
MetadataError.unstorable. - The Finder tags and modification date always follow a container write.
Performance
- A WAV is parsed in one open instead of two, its length read from
fmt/data. - The parse no longer makes an artwork thumbnail; call
ArtworkDescription.createThumbnail()where
it is shown. Parse with a 4.8 MB cover: 17.3 → 3.0 ms. - WAV saves that move audio are several times faster.
Breaking changes
MetadataComponent(new, top level) replacesMetadataError.Component; the XMP case is.xmp.MetadataDirtyFlag.metadata→.tagsand.image→.artwork. Stored raw values are unchanged.ImageDescription→ArtworkDescription; theimageDescriptionproperty →artwork(coding key unchanged).UnstorableMetadataErrorremoved (useMetadataError.unstorable).EmbeddedMarkers→EmbeddedAudioMarkers.removePicture()removed (useEmbeddedArtwork.remove).TagGroupmoved out of spfk-metadata-base (it was ShadowTag-specific).- Error file-type payloads are
UTType?, notAudioFileType?. - The TagLib bridge is internal to the package.
Upgrading
- Raise floors to
from: "2.0.0"for spfk-metadata, spfk-metadata-base and spfk-metadata-xmp. - Catch
MetadataError.incompleteSaveand clear only the dirty flags itswrittencomponents cover
(MetadataDirtyFlag.isFullyWritten(by:)). - Stored descriptions decode unchanged:
readFailuresis written only when a read failed, and
renamed cases keep their raw values.