mirror of
https://github.com/jellyfin/jellyfin.git
synced 2024-09-08 20:38:24 +02:00
handle comma delimited guest stars
This commit is contained in:
parent
89b8660fc8
commit
d06dca2d66
1 changed files with 7 additions and 4 deletions
|
@ -319,7 +319,9 @@ namespace MediaBrowser.Providers.TV
|
||||||
// Sometimes tvdb actors have leading spaces
|
// Sometimes tvdb actors have leading spaces
|
||||||
var persons = Regex.Matches(actors, @"([^|()]|\([^)]*\)*)+")
|
var persons = Regex.Matches(actors, @"([^|()]|\([^)]*\)*)+")
|
||||||
.Cast<Match>()
|
.Cast<Match>()
|
||||||
.Select(m => m.Value).Where(i => !string.IsNullOrWhiteSpace(i) && !string.IsNullOrEmpty(i));
|
.SelectMany(m => string.IsNullOrWhiteSpace(m.Value) ? new string[] { } : m.Value.Split(new[] { ',' }, StringSplitOptions.RemoveEmptyEntries))
|
||||||
|
.Where(i => !string.IsNullOrWhiteSpace(i) && !string.IsNullOrEmpty(i));
|
||||||
|
|
||||||
foreach (var person in persons.Select(str =>
|
foreach (var person in persons.Select(str =>
|
||||||
{
|
{
|
||||||
var nameGroup = str.Split(new[] { '(' }, 2, StringSplitOptions.RemoveEmptyEntries);
|
var nameGroup = str.Split(new[] { '(' }, 2, StringSplitOptions.RemoveEmptyEntries);
|
||||||
|
@ -340,7 +342,9 @@ namespace MediaBrowser.Providers.TV
|
||||||
// Sometimes tvdb actors have leading spaces
|
// Sometimes tvdb actors have leading spaces
|
||||||
var persons = Regex.Matches(extraActors, @"([^|()]|\([^)]*\)*)+")
|
var persons = Regex.Matches(extraActors, @"([^|()]|\([^)]*\)*)+")
|
||||||
.Cast<Match>()
|
.Cast<Match>()
|
||||||
.Select(m => m.Value).Where(i => !string.IsNullOrWhiteSpace(i) && !string.IsNullOrEmpty(i));
|
.SelectMany(m => string.IsNullOrWhiteSpace(m.Value) ? new string[] { } : m.Value.Split(new[] { ',' }, StringSplitOptions.RemoveEmptyEntries))
|
||||||
|
.Where(i => !string.IsNullOrWhiteSpace(i) && !string.IsNullOrEmpty(i));
|
||||||
|
|
||||||
foreach (var person in persons.Select(str =>
|
foreach (var person in persons.Select(str =>
|
||||||
{
|
{
|
||||||
var nameGroup = str.Split(new[] { '(' }, 2, StringSplitOptions.RemoveEmptyEntries);
|
var nameGroup = str.Split(new[] { '(' }, 2, StringSplitOptions.RemoveEmptyEntries);
|
||||||
|
@ -349,8 +353,7 @@ namespace MediaBrowser.Providers.TV
|
||||||
if (roles != null)
|
if (roles != null)
|
||||||
roles = roles.EndsWith(")") ? roles.Substring(0, roles.Length - 1) : roles;
|
roles = roles.EndsWith(")") ? roles.Substring(0, roles.Length - 1) : roles;
|
||||||
return new PersonInfo { Type = PersonType.GuestStar, Name = name, Role = roles };
|
return new PersonInfo { Type = PersonType.GuestStar, Name = name, Role = roles };
|
||||||
}).Where(person => !episode.People.Any(x => x.Type == person.Type && x.Name == person.Name))
|
}))
|
||||||
)
|
|
||||||
{
|
{
|
||||||
episode.AddPerson(person);
|
episode.AddPerson(person);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue