diff --git a/Jellyfin.Plugin.YoutubeMetadata/Jellyfin.Plugin.YoutubeMetadata.csproj b/Jellyfin.Plugin.YoutubeMetadata/Jellyfin.Plugin.YoutubeMetadata.csproj index a87317a..63139ae 100644 --- a/Jellyfin.Plugin.YoutubeMetadata/Jellyfin.Plugin.YoutubeMetadata.csproj +++ b/Jellyfin.Plugin.YoutubeMetadata/Jellyfin.Plugin.YoutubeMetadata.csproj @@ -2,9 +2,9 @@ netstandard2.1 Jellyfin.Plugin.YoutubeMetadata - 1.0.2.1 - 1.0.2.1 - 1.0.2.1 + 1.0.2.2 + 1.0.2.2 + 1.0.2.2 @@ -14,10 +14,10 @@ - - - - - + + + + + diff --git a/Jellyfin.Plugin.YoutubeMetadata/Providers/YoutubeMetadataImageProvider.cs b/Jellyfin.Plugin.YoutubeMetadata/Providers/YoutubeMetadataImageProvider.cs index 9d986b8..4c2d841 100644 --- a/Jellyfin.Plugin.YoutubeMetadata/Providers/YoutubeMetadataImageProvider.cs +++ b/Jellyfin.Plugin.YoutubeMetadata/Providers/YoutubeMetadataImageProvider.cs @@ -34,7 +34,7 @@ public YoutubeMetadataImageProvider(IServerConfigurationManager config, IHttpCli /// // After embedded and fanart - public int Order => 2; + public int Order => 1; /// public IEnumerable GetSupportedImages(BaseItem item) @@ -49,7 +49,7 @@ public IEnumerable GetSupportedImages(BaseItem item) /// public async Task> GetImages(BaseItem item, CancellationToken cancellationToken) { - var id = YoutubeMetadataProvider.Current.GetYTID(item.Name); + var id = YoutubeMetadataProvider.Current.GetYTID(item.FileNameWithoutExtension); if (!string.IsNullOrWhiteSpace(id)) { @@ -84,6 +84,10 @@ public async Task> GetImages(BaseItem item, Cancell return GetImages(tnurls); } + else + { + _logger.LogInformation("Object is null!"); + } } return new List(); diff --git a/Jellyfin.Plugin.YoutubeMetadata/Providers/YoutubeProvider.cs b/Jellyfin.Plugin.YoutubeMetadata/Providers/YoutubeProvider.cs index 5acc6e4..387904a 100644 --- a/Jellyfin.Plugin.YoutubeMetadata/Providers/YoutubeProvider.cs +++ b/Jellyfin.Plugin.YoutubeMetadata/Providers/YoutubeProvider.cs @@ -68,21 +68,19 @@ private string GetPathByTitle(string title) /// /// Returns the Youtube ID from the file path. Matches last 11 character field inside square brackets. /// - /// + /// /// - internal string GetYTID(string title) + internal string GetYTID(string name) { - var filename = GetPathByTitle(title); - var match = Regex.Match(filename, YTID_RE); + var match = Regex.Match(name, YTID_RE); return match.Value; - } /// public async Task> GetMetadata(MovieInfo info, CancellationToken cancellationToken) { var result = new MetadataResult(); - var id = GetYTID(info.Name); + var id = GetYTID(GetPathByTitle(info.Name)); _logger.LogInformation(id);