mirror of
https://github.com/jellyfin/jellyfin.git
synced 2025-07-09 03:04:24 -04:00
Merge pull request #10870 from MaVdbussche/fix-trailers_urls
Fix NFO parser to be able to read corrct STRM URL format
This commit is contained in:
commit
64b0c82d68
@ -175,6 +175,7 @@
|
|||||||
- [Chris-Codes-It](https://github.com/Chris-Codes-It)
|
- [Chris-Codes-It](https://github.com/Chris-Codes-It)
|
||||||
- [Pithaya](https://github.com/Pithaya)
|
- [Pithaya](https://github.com/Pithaya)
|
||||||
- [Çağrı Sakaoğlu](https://github.com/ilovepilav)
|
- [Çağrı Sakaoğlu](https://github.com/ilovepilav)
|
||||||
|
_ [Barasingha](https://github.com/MaVdbussche)
|
||||||
- [Gauvino](https://github.com/Gauvino)
|
- [Gauvino](https://github.com/Gauvino)
|
||||||
|
|
||||||
# Emby Contributors
|
# Emby Contributors
|
||||||
|
@ -460,10 +460,28 @@ namespace MediaBrowser.XbmcMetadata.Parsers
|
|||||||
var trailer = reader.ReadNormalizedString();
|
var trailer = reader.ReadNormalizedString();
|
||||||
if (!string.IsNullOrEmpty(trailer))
|
if (!string.IsNullOrEmpty(trailer))
|
||||||
{
|
{
|
||||||
|
if (trailer.StartsWith("plugin://plugin.video.youtube/?action=play_video&videoid=", StringComparison.OrdinalIgnoreCase))
|
||||||
|
{
|
||||||
|
// Deprecated format
|
||||||
item.AddTrailerUrl(trailer.Replace(
|
item.AddTrailerUrl(trailer.Replace(
|
||||||
"plugin://plugin.video.youtube/?action=play_video&videoid=",
|
"plugin://plugin.video.youtube/?action=play_video&videoid=",
|
||||||
BaseNfoSaver.YouTubeWatchUrl,
|
BaseNfoSaver.YouTubeWatchUrl,
|
||||||
StringComparison.OrdinalIgnoreCase));
|
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;
|
break;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user