|
|
|
@ -1342,9 +1342,8 @@ namespace MediaBrowser.MediaEncoding.Probing
|
|
|
|
|
return null;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
return value.Split('/', StringSplitOptions.RemoveEmptyEntries)
|
|
|
|
|
.Select(i => i.Trim())
|
|
|
|
|
.FirstOrDefault(i => !string.IsNullOrWhiteSpace(i));
|
|
|
|
|
return value.Split('/', StringSplitOptions.RemoveEmptyEntries | StringSplitOptions.TrimEntries)
|
|
|
|
|
.FirstOrDefault();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
@ -1353,17 +1352,13 @@ namespace MediaBrowser.MediaEncoding.Probing
|
|
|
|
|
/// <param name="val">The val.</param>
|
|
|
|
|
/// <param name="allowCommaDelimiter">if set to <c>true</c> [allow comma delimiter].</param>
|
|
|
|
|
/// <returns>System.String[][].</returns>
|
|
|
|
|
private IEnumerable<string> Split(string val, bool allowCommaDelimiter)
|
|
|
|
|
private string[] Split(string val, bool allowCommaDelimiter)
|
|
|
|
|
{
|
|
|
|
|
// Only use the comma as a delimiter if there are no slashes or pipes.
|
|
|
|
|
// We want to be careful not to split names that have commas in them
|
|
|
|
|
var delimiter = !allowCommaDelimiter || _nameDelimiters.Any(i => val.Contains(i, StringComparison.Ordinal)) ?
|
|
|
|
|
_nameDelimiters :
|
|
|
|
|
new[] { ',' };
|
|
|
|
|
|
|
|
|
|
return val.Split(delimiter, StringSplitOptions.RemoveEmptyEntries)
|
|
|
|
|
.Where(i => !string.IsNullOrWhiteSpace(i))
|
|
|
|
|
.Select(i => i.Trim());
|
|
|
|
|
return !allowCommaDelimiter || _nameDelimiters.Any(i => val.Contains(i, StringComparison.Ordinal)) ?
|
|
|
|
|
val.Split(_nameDelimiters, StringSplitOptions.RemoveEmptyEntries | StringSplitOptions.TrimEntries) :
|
|
|
|
|
val.Split(',', StringSplitOptions.RemoveEmptyEntries | StringSplitOptions.TrimEntries);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
private IEnumerable<string> SplitDistinctArtists(string val, char[] delimiters, bool splitFeaturing)
|
|
|
|
@ -1387,9 +1382,7 @@ namespace MediaBrowser.MediaEncoding.Probing
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
var artists = val.Split(delimiters, StringSplitOptions.RemoveEmptyEntries)
|
|
|
|
|
.Where(i => !string.IsNullOrWhiteSpace(i))
|
|
|
|
|
.Select(i => i.Trim());
|
|
|
|
|
var artists = val.Split(delimiters, StringSplitOptions.RemoveEmptyEntries | StringSplitOptions.TrimEntries);
|
|
|
|
|
|
|
|
|
|
artistsFound.AddRange(artists);
|
|
|
|
|
return artistsFound.DistinctNames();
|
|
|
|
@ -1514,15 +1507,12 @@ namespace MediaBrowser.MediaEncoding.Probing
|
|
|
|
|
|
|
|
|
|
if (tags.TryGetValue("WM/Genre", out var genres) && !string.IsNullOrWhiteSpace(genres))
|
|
|
|
|
{
|
|
|
|
|
var genreList = genres.Split(new[] { ';', '/', ',' }, StringSplitOptions.RemoveEmptyEntries)
|
|
|
|
|
.Where(i => !string.IsNullOrWhiteSpace(i))
|
|
|
|
|
.Select(i => i.Trim())
|
|
|
|
|
.ToList();
|
|
|
|
|
var genreList = genres.Split(new[] { ';', '/', ',' }, StringSplitOptions.RemoveEmptyEntries | StringSplitOptions.TrimEntries);
|
|
|
|
|
|
|
|
|
|
// If this is empty then don't overwrite genres that might have been fetched earlier
|
|
|
|
|
if (genreList.Count > 0)
|
|
|
|
|
if (genreList.Length > 0)
|
|
|
|
|
{
|
|
|
|
|
video.Genres = genreList.ToArray();
|
|
|
|
|
video.Genres = genreList;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
@ -1533,10 +1523,9 @@ namespace MediaBrowser.MediaEncoding.Probing
|
|
|
|
|
|
|
|
|
|
if (tags.TryGetValue("WM/MediaCredits", out var people) && !string.IsNullOrEmpty(people))
|
|
|
|
|
{
|
|
|
|
|
video.People = people.Split(new[] { ';', '/' }, StringSplitOptions.RemoveEmptyEntries)
|
|
|
|
|
.Where(i => !string.IsNullOrWhiteSpace(i))
|
|
|
|
|
.Select(i => new BaseItemPerson { Name = i.Trim(), Type = PersonKind.Actor })
|
|
|
|
|
.ToArray();
|
|
|
|
|
video.People = Array.ConvertAll(
|
|
|
|
|
people.Split(new[] { ';', '/' }, StringSplitOptions.RemoveEmptyEntries | StringSplitOptions.TrimEntries),
|
|
|
|
|
i => new BaseItemPerson { Name = i, Type = PersonKind.Actor });
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (tags.TryGetValue("WM/OriginalReleaseTime", out var year) && int.TryParse(year, NumberStyles.Integer, CultureInfo.InvariantCulture, out var parsedYear))
|
|
|
|
|