aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNiels van Velzen <nielsvanvelzen@users.noreply.github.com>2024-04-22 05:53:27 +0200
committerGitHub <noreply@github.com>2024-04-21 21:53:27 -0600
commita80968478a2620dd0c76c9069101231f086ddca5 (patch)
tree532948868fdd7faaf895b6bad3ab0f8c07245514
parentf3b4d72423de15f13b30bdf95b71d9450778d8be (diff)
Fix InvalidCastException in ItemUpdateController (#11398)
-rw-r--r--Jellyfin.Api/Controllers/ItemUpdateController.cs6
1 files changed, 3 insertions, 3 deletions
diff --git a/Jellyfin.Api/Controllers/ItemUpdateController.cs b/Jellyfin.Api/Controllers/ItemUpdateController.cs
index 83f308bb1..56ef5f8f1 100644
--- a/Jellyfin.Api/Controllers/ItemUpdateController.cs
+++ b/Jellyfin.Api/Controllers/ItemUpdateController.cs
@@ -288,7 +288,7 @@ public class ItemUpdateController : BaseJellyfinApiController
if (item is Series rseries)
{
- foreach (Season season in rseries.Children)
+ foreach (var season in rseries.Children.OfType<Season>())
{
season.OfficialRating = request.OfficialRating;
season.CustomRating = request.CustomRating;
@@ -296,7 +296,7 @@ public class ItemUpdateController : BaseJellyfinApiController
season.OnMetadataChanged();
await season.UpdateToRepositoryAsync(ItemUpdateType.MetadataEdit, CancellationToken.None).ConfigureAwait(false);
- foreach (Episode ep in season.Children)
+ foreach (var ep in season.Children.OfType<Episode>())
{
ep.OfficialRating = request.OfficialRating;
ep.CustomRating = request.CustomRating;
@@ -308,7 +308,7 @@ public class ItemUpdateController : BaseJellyfinApiController
}
else if (item is Season season)
{
- foreach (Episode ep in season.Children)
+ foreach (var ep in season.Children.OfType<Episode>())
{
ep.OfficialRating = request.OfficialRating;
ep.CustomRating = request.CustomRating;