Просмотр исходного кода

Backport pull request #15786 from jellyfin/release-10.11.z

Fix parental rating filtering with sub-scores

Original-merge: 5804d6840c0276d3aef81bfec6af82e496672f01

Merged-by: crobibero <cody@robibe.ro>

Backported-by: Bond_009 <bond.009@outlook.com>
theguymadmax 22 часов назад
Родитель
Сommit
928a8458dd
1 измененных файлов с 8 добавлено и 3 удалено
  1. 8 3
      MediaBrowser.Controller/Entities/BaseItem.cs

+ 8 - 3
MediaBrowser.Controller/Entities/BaseItem.cs

@@ -1620,12 +1620,17 @@ namespace MediaBrowser.Controller.Entities
                 return isAllowed;
                 return isAllowed;
             }
             }
 
 
-            if (maxAllowedSubRating is not null)
+            if (!maxAllowedRating.HasValue)
             {
             {
-                return (ratingScore.SubScore ?? 0) <= maxAllowedSubRating && ratingScore.Score <= maxAllowedRating.Value;
+                return true;
+            }
+
+            if (ratingScore.Score != maxAllowedRating.Value)
+            {
+                return ratingScore.Score < maxAllowedRating.Value;
             }
             }
 
 
-            return !maxAllowedRating.HasValue || ratingScore.Score <= maxAllowedRating.Value;
+            return !maxAllowedSubRating.HasValue || (ratingScore.SubScore ?? 0) <= maxAllowedSubRating.Value;
         }
         }
 
 
         public ParentalRatingScore GetParentalRatingScore()
         public ParentalRatingScore GetParentalRatingScore()