aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCody Robibero <cody@robibe.ro>2024-02-02 16:58:08 -0700
committerGitHub <noreply@github.com>2024-02-02 16:58:08 -0700
commit64b0c82d6819fceaf5b1c96ee4bbb92ccb0f929a (patch)
tree889cc309fea196a586e474835cf5417b0dc0d348
parentbf4c3bb1e466f0af93b68b40ba1295ac16253513 (diff)
parente0cafe418c3890f62736bc418298d6d7df2f38fb (diff)
Merge pull request #10870 from MaVdbussche/fix-trailers_urls
Fix NFO parser to be able to read corrct STRM URL format
-rw-r--r--CONTRIBUTORS.md1
-rw-r--r--MediaBrowser.XbmcMetadata/Parsers/BaseNfoParser.cs26
2 files changed, 23 insertions, 4 deletions
diff --git a/CONTRIBUTORS.md b/CONTRIBUTORS.md
index 457f59e0f..76e2b4ebc 100644
--- a/CONTRIBUTORS.md
+++ b/CONTRIBUTORS.md
@@ -175,6 +175,7 @@
- [Chris-Codes-It](https://github.com/Chris-Codes-It)
- [Pithaya](https://github.com/Pithaya)
- [Çağrı Sakaoğlu](https://github.com/ilovepilav)
+ _ [Barasingha](https://github.com/MaVdbussche)
- [Gauvino](https://github.com/Gauvino)
# Emby Contributors
diff --git a/MediaBrowser.XbmcMetadata/Parsers/BaseNfoParser.cs b/MediaBrowser.XbmcMetadata/Parsers/BaseNfoParser.cs
index 70e5b66c1..97cdc6854 100644
--- a/MediaBrowser.XbmcMetadata/Parsers/BaseNfoParser.cs
+++ b/MediaBrowser.XbmcMetadata/Parsers/BaseNfoParser.cs
@@ -460,10 +460,28 @@ namespace MediaBrowser.XbmcMetadata.Parsers
var trailer = reader.ReadNormalizedString();
if (!string.IsNullOrEmpty(trailer))
{
- item.AddTrailerUrl(trailer.Replace(
- "plugin://plugin.video.youtube/?action=play_video&videoid=",
- BaseNfoSaver.YouTubeWatchUrl,
- StringComparison.OrdinalIgnoreCase));
+ if (trailer.StartsWith("plugin://plugin.video.youtube/?action=play_video&videoid=", StringComparison.OrdinalIgnoreCase))
+ {
+ // Deprecated format
+ item.AddTrailerUrl(trailer.Replace(
+ "plugin://plugin.video.youtube/?action=play_video&videoid=",
+ BaseNfoSaver.YouTubeWatchUrl,
+ StringComparison.OrdinalIgnoreCase));
+
+ var suggestedUrl = trailer.Replace(
+ "plugin://plugin.video.youtube/?action=play_video&videoid=",
+ "plugin://plugin.video.youtube/play/?video_id=",
+ StringComparison.OrdinalIgnoreCase);
+ Logger.LogWarning("Trailer URL uses a deprecated format : {Url}. Using {NewUrl} instead is advised.", trailer, suggestedUrl);
+ }
+ else if (trailer.StartsWith("plugin://plugin.video.youtube/play/?video_id=", StringComparison.OrdinalIgnoreCase))
+ {
+ // Proper format
+ item.AddTrailerUrl(trailer.Replace(
+ "plugin://plugin.video.youtube/play/?video_id=",
+ BaseNfoSaver.YouTubeWatchUrl,
+ StringComparison.OrdinalIgnoreCase));
+ }
}
break;