mirror of
https://github.com/jellyfin/jellyfin.git
synced 2025-07-09 03:04:24 -04:00
Adding support for proper trailer STRM URL format, along with the deprecated format
This commit is contained in:
parent
3ce16713dd
commit
7cd60aefb5
@ -460,10 +460,28 @@ namespace MediaBrowser.XbmcMetadata.Parsers
|
|||||||
var trailer = reader.ReadNormalizedString();
|
var trailer = reader.ReadNormalizedString();
|
||||||
if (!string.IsNullOrEmpty(trailer))
|
if (!string.IsNullOrEmpty(trailer))
|
||||||
{
|
{
|
||||||
item.AddTrailerUrl(trailer.Replace(
|
if (trailer.StartsWith("plugin://plugin.video.youtube/?action=play_video&videoid=", StringComparison.OrdinalIgnoreCase))
|
||||||
"plugin://plugin.video.youtube/?action=play_video&videoid=",
|
{
|
||||||
BaseNfoSaver.YouTubeWatchUrl,
|
// Deprecated format
|
||||||
StringComparison.OrdinalIgnoreCase));
|
item.AddTrailerUrl(trailer.Replace(
|
||||||
|
"plugin://plugin.video.youtube/?action=play_video&videoid=",
|
||||||
|
BaseNfoSaver.YouTubeWatchUrl,
|
||||||
|
StringComparison.OrdinalIgnoreCase));
|
||||||
|
|
||||||
|
var suggested_url = 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 {URL_NEW} instead is advised.", [trailer, suggested_url]);
|
||||||
|
}
|
||||||
|
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