From fc9a74fb09a79f5412ed8603b5decb379c4bd1f2 Mon Sep 17 00:00:00 2001 From: grimsi <9295182+grimsi@users.noreply.github.com> Date: Wed, 14 May 2025 01:33:19 +0200 Subject: [PATCH] Filter videos returned from IGDB because of Youtube age restrictions --- .../kotlin/de/grimsi/gameyfin/plugins/igdb/IgdbPlugin.kt | 8 +++++++- plugins/igdb/src/main/resources/MANIFEST.MF | 2 +- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/plugins/igdb/src/main/kotlin/de/grimsi/gameyfin/plugins/igdb/IgdbPlugin.kt b/plugins/igdb/src/main/kotlin/de/grimsi/gameyfin/plugins/igdb/IgdbPlugin.kt index b24c6f3..6c5e80a 100644 --- a/plugins/igdb/src/main/kotlin/de/grimsi/gameyfin/plugins/igdb/IgdbPlugin.kt +++ b/plugins/igdb/src/main/kotlin/de/grimsi/gameyfin/plugins/igdb/IgdbPlugin.kt @@ -81,6 +81,7 @@ class IgdbPlugin(wrapper: PluginWrapper) : GameyfinPlugin(wrapper) { "game_modes.name", "cover.image_id", "screenshots.image_id", + "videos.name", "videos.video_id", "involved_companies.company.slug", "involved_companies.company.name", @@ -149,7 +150,12 @@ class IgdbPlugin(wrapper: PluginWrapper) : GameyfinPlugin(wrapper) { themes = game.themesList.map { Mapper.theme(it) }.toSet(), keywords = game.keywordsList.map { it.name }.toSet(), screenshotUrls = game.screenshotsList.map { Mapper.screenshot(it) }.toSet(), - videoUrls = game.videosList.map { Mapper.video(it) }.toSet(), + videoUrls = game.videosList + // Lots of gameplay videos hosted on YouTube are blocked from viewing on external sites due to age ratings + // Trailers usually are not affected so we filter for them + // see https://support.google.com/youtube/answer/2802167 + .filter { it.name.equals("trailer", ignoreCase = true) } + .map { Mapper.video(it) }.toSet(), features = Mapper.gameFeatures(game), perspectives = game.playerPerspectivesList.map { Mapper.playerPerspective(it) }.toSet() ) diff --git a/plugins/igdb/src/main/resources/MANIFEST.MF b/plugins/igdb/src/main/resources/MANIFEST.MF index 923e6c7..eb00813 100644 --- a/plugins/igdb/src/main/resources/MANIFEST.MF +++ b/plugins/igdb/src/main/resources/MANIFEST.MF @@ -2,5 +2,5 @@ Manifest-Version: 1.0 Plugin-Class: de.grimsi.gameyfin.plugins.igdb.IgdbPlugin Plugin-Id: igdb Plugin-Description: IGDB Metadata -Plugin-Version: 1.0.0-alpha4 +Plugin-Version: 1.0.0-alpha5 Plugin-Provider: grimsi