Fix the probing of m4a metadata

The composer is not set in some of my m4a files. For some reason
TagLibSharp returns the composer as an empty string in this case. This
causes an exception in PeopleHelper.AddPerson, and thus probing fails.

IMHO we can simply ignore empty values.

Fixes: #10061
This commit is contained in:
Jan Müller 2023-07-31 22:19:06 +02:00
parent d3c7af0d5c
commit 66ff724acf

View File

@ -223,30 +223,39 @@ namespace MediaBrowser.Providers.MediaInfo
var albumArtists = tags.AlbumArtists;
foreach (var albumArtist in albumArtists)
{
PeopleHelper.AddPerson(people, new PersonInfo
if (!string.IsNullOrEmpty(albumArtist))
{
Name = albumArtist,
Type = PersonKind.AlbumArtist
});
PeopleHelper.AddPerson(people, new PersonInfo
{
Name = albumArtist,
Type = PersonKind.AlbumArtist
});
}
}
var performers = tags.Performers;
foreach (var performer in performers)
{
PeopleHelper.AddPerson(people, new PersonInfo
if (!string.IsNullOrEmpty(performer))
{
Name = performer,
Type = PersonKind.Artist
});
PeopleHelper.AddPerson(people, new PersonInfo
{
Name = performer,
Type = PersonKind.Artist
});
}
}
foreach (var composer in tags.Composers)
{
PeopleHelper.AddPerson(people, new PersonInfo
if (!string.IsNullOrEmpty(composer))
{
Name = composer,
Type = PersonKind.Composer
});
PeopleHelper.AddPerson(people, new PersonInfo
{
Name = composer,
Type = PersonKind.Composer
});
}
}
_libraryManager.UpdatePeople(audio, people);