aboutsummaryrefslogtreecommitdiff
path: root/MediaBrowser.Controller/Providers/MediaInfo/FFProbeAudioInfoProvider.cs
diff options
context:
space:
mode:
Diffstat (limited to 'MediaBrowser.Controller/Providers/MediaInfo/FFProbeAudioInfoProvider.cs')
-rw-r--r--MediaBrowser.Controller/Providers/MediaInfo/FFProbeAudioInfoProvider.cs35
1 files changed, 26 insertions, 9 deletions
diff --git a/MediaBrowser.Controller/Providers/MediaInfo/FFProbeAudioInfoProvider.cs b/MediaBrowser.Controller/Providers/MediaInfo/FFProbeAudioInfoProvider.cs
index 542b8eed8..56e85eb1f 100644
--- a/MediaBrowser.Controller/Providers/MediaInfo/FFProbeAudioInfoProvider.cs
+++ b/MediaBrowser.Controller/Providers/MediaInfo/FFProbeAudioInfoProvider.cs
@@ -96,11 +96,7 @@ namespace MediaBrowser.Controller.Providers.MediaInfo
if (!string.IsNullOrWhiteSpace(composer))
{
- // Only use the comma as a delimeter if there are no slashes or pipes.
- // We want to be careful not to split names that have commas in them
- var delimeter = composer.IndexOf('/') == -1 && composer.IndexOf('|') == -1 ? new[] { ',' } : new[] { '/', '|' };
-
- foreach (var person in composer.Split(delimeter, StringSplitOptions.RemoveEmptyEntries))
+ foreach (var person in Split(composer))
{
var name = person.Trim();
@@ -112,12 +108,19 @@ namespace MediaBrowser.Controller.Providers.MediaInfo
}
audio.Album = GetDictionaryValue(tags, "album");
- audio.Artist = GetDictionaryValue(tags, "artist");
- if (!string.IsNullOrWhiteSpace(audio.Artist))
+ var artists = GetDictionaryValue(tags, "artist");
+ if (!string.IsNullOrWhiteSpace(artists))
{
- // Add to people too
- audio.AddPerson(new PersonInfo {Name = audio.Artist, Type = PersonType.MusicArtist});
+ foreach (var artist in Split(artists))
+ {
+ var name = artist.Trim();
+
+ if (!string.IsNullOrEmpty(name))
+ {
+ audio.AddArtist(name);
+ }
+ }
}
// Several different forms of albumartist
@@ -151,6 +154,20 @@ namespace MediaBrowser.Controller.Providers.MediaInfo
}
/// <summary>
+ /// Splits the specified val.
+ /// </summary>
+ /// <param name="val">The val.</param>
+ /// <returns>System.String[][].</returns>
+ private string[] Split(string val)
+ {
+ // Only use the comma as a delimeter if there are no slashes or pipes.
+ // We want to be careful not to split names that have commas in them
+ var delimeter = val.IndexOf('/') == -1 && val.IndexOf('|') == -1 ? new[] { ',' } : new[] { '/', '|' };
+
+ return val.Split(delimeter, StringSplitOptions.RemoveEmptyEntries);
+ }
+
+ /// <summary>
/// Gets the studios from the tags collection
/// </summary>
/// <param name="audio">The audio.</param>