aboutsummaryrefslogtreecommitdiff
path: root/MediaBrowser.Controller/Entities/PeopleHelper.cs
diff options
context:
space:
mode:
authorShadowghost <Ghost_of_Stone@web.de>2022-12-07 17:40:24 +0100
committerShadowghost <Ghost_of_Stone@web.de>2022-12-07 17:40:24 +0100
commit2c86bd1875e6e85d5867618e992d850453dae663 (patch)
tree671070fb246fd3821bf6f1e58a01c402a2f969d1 /MediaBrowser.Controller/Entities/PeopleHelper.cs
parentdd5f90802e71083347b6095eb79a9de0b9d34615 (diff)
parent3cb7fe50127b1a8158186b390836ee25ae5a50fd (diff)
Merge branch 'master' into network-rewrite
Diffstat (limited to 'MediaBrowser.Controller/Entities/PeopleHelper.cs')
-rw-r--r--MediaBrowser.Controller/Entities/PeopleHelper.cs12
1 files changed, 4 insertions, 8 deletions
diff --git a/MediaBrowser.Controller/Entities/PeopleHelper.cs b/MediaBrowser.Controller/Entities/PeopleHelper.cs
index 8571bfcea..7f8dc069c 100644
--- a/MediaBrowser.Controller/Entities/PeopleHelper.cs
+++ b/MediaBrowser.Controller/Entities/PeopleHelper.cs
@@ -12,11 +12,7 @@ namespace MediaBrowser.Controller.Entities
public static void AddPerson(List<PersonInfo> people, PersonInfo person)
{
ArgumentNullException.ThrowIfNull(person);
-
- if (string.IsNullOrEmpty(person.Name))
- {
- throw new ArgumentException("The person's name was empty or null.", nameof(person));
- }
+ ArgumentException.ThrowIfNullOrEmpty(person.Name);
// Normalize
if (string.Equals(person.Role, PersonType.GuestStar, StringComparison.OrdinalIgnoreCase))
@@ -41,7 +37,7 @@ namespace MediaBrowser.Controller.Entities
{
var existing = people.FirstOrDefault(p => p.Name.Equals(person.Name, StringComparison.OrdinalIgnoreCase) && p.Type.Equals(PersonType.Actor, StringComparison.OrdinalIgnoreCase));
- if (existing != null)
+ if (existing is not null)
{
existing.Type = PersonType.GuestStar;
MergeExisting(existing, person);
@@ -53,7 +49,7 @@ namespace MediaBrowser.Controller.Entities
{
// If the actor already exists without a role and we have one, fill it in
var existing = people.FirstOrDefault(p => p.Name.Equals(person.Name, StringComparison.OrdinalIgnoreCase) && (p.Type.Equals(PersonType.Actor, StringComparison.OrdinalIgnoreCase) || p.Type.Equals(PersonType.GuestStar, StringComparison.OrdinalIgnoreCase)));
- if (existing == null)
+ if (existing is null)
{
// Wasn't there - add it
people.Add(person);
@@ -76,7 +72,7 @@ namespace MediaBrowser.Controller.Entities
string.Equals(p.Type, person.Type, StringComparison.OrdinalIgnoreCase));
// Check for dupes based on the combination of Name and Type
- if (existing == null)
+ if (existing is null)
{
people.Add(person);
}