mirror of
https://github.com/BrenBroZAYT/gameyfin.git
synced 2026-06-13 16:40:01 +00:00
Filter videos returned from IGDB because of Youtube age restrictions
This commit is contained in:
@@ -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()
|
||||
)
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user