mirror of
https://github.com/Serial-ATA/lofty-rs
synced 2024-12-13 14:12:31 +00:00
Don't error out on an empty tag
This commit is contained in:
parent
e1c02113ff
commit
d2a6e35537
2 changed files with 4 additions and 4 deletions
|
@ -27,7 +27,7 @@ impl ApeTag {
|
|||
R: Read + Seek,
|
||||
{
|
||||
Ok(Self {
|
||||
inner: ape::read_from(reader)?,
|
||||
inner: ape::read_from(reader).unwrap_or_else(|| ape::Tag::new()),
|
||||
_format: TagType::Ape,
|
||||
})
|
||||
}
|
||||
|
|
|
@ -30,15 +30,15 @@ impl Id3v2Tag {
|
|||
{
|
||||
match format {
|
||||
Id3Format::Mp3 => Ok(Self {
|
||||
inner: Id3v2InnerTag::read_from(reader)?,
|
||||
inner: Id3v2InnerTag::read_from(reader).unwrap_or_else(|| Id3v2InnerTag::new()),
|
||||
_format: TagType::Id3v2(format),
|
||||
}),
|
||||
Id3Format::Riff => Ok(Self {
|
||||
inner: Id3v2InnerTag::read_from_wav_reader(reader)?,
|
||||
inner: Id3v2InnerTag::read_from_wav_reader(reader).unwrap_or_else(|| Id3v2InnerTag::new()),
|
||||
_format: TagType::Id3v2(format),
|
||||
}),
|
||||
Id3Format::Aiff => Ok(Self {
|
||||
inner: Id3v2InnerTag::read_from_aiff_reader(reader)?,
|
||||
inner: Id3v2InnerTag::read_from_aiff_reader(reader).unwrap_or_else(|| Id3v2InnerTag::new()),
|
||||
_format: TagType::Id3v2(format),
|
||||
}),
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue