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

@ -222,6 +222,8 @@ namespace MediaBrowser.Providers.MediaInfo
var people = new List<PersonInfo>();
var albumArtists = tags.AlbumArtists;
foreach (var albumArtist in albumArtists)
{
if (!string.IsNullOrEmpty(albumArtist))
{
PeopleHelper.AddPerson(people, new PersonInfo
{
@ -229,9 +231,12 @@ namespace MediaBrowser.Providers.MediaInfo
Type = PersonKind.AlbumArtist
});
}
}
var performers = tags.Performers;
foreach (var performer in performers)
{
if (!string.IsNullOrEmpty(performer))
{
PeopleHelper.AddPerson(people, new PersonInfo
{
@ -239,8 +244,11 @@ namespace MediaBrowser.Providers.MediaInfo
Type = PersonKind.Artist
});
}
}
foreach (var composer in tags.Composers)
{
if (!string.IsNullOrEmpty(composer))
{
PeopleHelper.AddPerson(people, new PersonInfo
{
@ -248,6 +256,7 @@ namespace MediaBrowser.Providers.MediaInfo
Type = PersonKind.Composer
});
}
}
_libraryManager.UpdatePeople(audio, people);
audio.Artists = performers;