fix updating music videos (#174)

This commit is contained in:
Jason Dove
2021-04-17 10:24:16 -05:00
committed by GitHub
parent 7c07c5f522
commit 050aaaa288
2 changed files with 18 additions and 15 deletions
+17 -14
View File
@@ -698,25 +698,28 @@ namespace ErsatzTV.Core.Metadata
} }
} }
foreach (Actor actor in existing.Actors if (existing is not MusicVideoMetadata)
.Filter(a => incoming.Actors.All(a2 => a2.Name != a.Name))
.ToList())
{ {
existing.Actors.Remove(actor); foreach (Actor actor in existing.Actors
if (await _metadataRepository.RemoveActor(actor)) .Filter(a => incoming.Actors.All(a2 => a2.Name != a.Name))
.ToList())
{ {
updated = true; existing.Actors.Remove(actor);
if (await _metadataRepository.RemoveActor(actor))
{
updated = true;
}
} }
}
foreach (Actor actor in incoming.Actors foreach (Actor actor in incoming.Actors
.Filter(a => existing.Actors.All(a2 => a2.Name != a.Name)) .Filter(a => existing.Actors.All(a2 => a2.Name != a.Name))
.ToList()) .ToList())
{
existing.Actors.Add(actor);
if (await addActor(existing, actor))
{ {
updated = true; existing.Actors.Add(actor);
if (await addActor(existing, actor))
{
updated = true;
}
} }
} }
+1 -1
View File
@@ -60,7 +60,7 @@
} }
} }
} }
catch (Exception _) catch (Exception)
{ {
// ignore // ignore
} }