mirror of
https://github.com/jellyfin/jellyfin.git
synced 2025-12-18 06:53:07 +03:00
made Audio.Artist plural and removed duplicated of artists into the people collection
This commit is contained in:
@@ -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
|
||||
@@ -150,6 +153,20 @@ namespace MediaBrowser.Controller.Providers.MediaInfo
|
||||
FetchStudios(audio, tags, "publisher");
|
||||
}
|
||||
|
||||
/// <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>
|
||||
|
||||
Reference in New Issue
Block a user