From 3117db57c5c6d0f93efd59f9287cebd547a2a6e8 Mon Sep 17 00:00:00 2001 From: Kilian von Pflugk Date: Sun, 28 Jul 2024 18:53:23 +0200 Subject: [PATCH] only return timestamps for episodes --- .../Controllers/SkipIntroController.cs | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/ConfusedPolarBear.Plugin.IntroSkipper/Controllers/SkipIntroController.cs b/ConfusedPolarBear.Plugin.IntroSkipper/Controllers/SkipIntroController.cs index 47d9cb2..3d6ef46 100644 --- a/ConfusedPolarBear.Plugin.IntroSkipper/Controllers/SkipIntroController.cs +++ b/ConfusedPolarBear.Plugin.IntroSkipper/Controllers/SkipIntroController.cs @@ -86,6 +86,13 @@ public class SkipIntroController : ControllerBase [ActionName("UpdateTimestamps")] public ActionResult GetTimestamps([FromRoute] Guid id) { + // only get return content for episodes + var rawItem = Plugin.Instance!.GetItem(id); + if (rawItem == null || rawItem is not Episode episode) + { + return NotFound(); + } + var times = new TimeStamps(); if (Plugin.Instance!.Intros.TryGetValue(id, out var introValue)) {