Invert the if

pull/1629/head
Claus Vium 5 years ago
parent 26b4fb21fe
commit 15f7a2078b

@ -205,12 +205,18 @@ namespace MediaBrowser.Providers.TV.TheTVDB
var currentActor = episode.GuestStars[i];
var roleStartIndex = currentActor.IndexOf('(');
string name = currentActor;
string role = string.Empty;
if (roleStartIndex != -1)
if (roleStartIndex == -1)
{
result.AddPerson(new PersonInfo
{
Type = PersonType.GuestStar,
Name = currentActor,
Role = string.Empty
});
continue;
}
var roles = new List<string> {currentActor.Substring(roleStartIndex + 1)};
name = name.Substring(0, roleStartIndex).Trim();
// Fetch all roles
for (var j = i + 1; j < episode.GuestStars.Length; ++j)
@ -229,14 +235,11 @@ namespace MediaBrowser.Providers.TV.TheTVDB
roles.Add(currentRole);
}
role = string.Join(", ", roles);
}
result.AddPerson(new PersonInfo
{
Type = PersonType.GuestStar,
Name = name,
Role = role
Name = currentActor.Substring(0, roleStartIndex).Trim(),
Role = string.Join(", ", roles)
});
}

Loading…
Cancel
Save