diff options
| author | David <daullmer@gmail.com> | 2021-03-10 17:03:19 +0100 |
|---|---|---|
| committer | David <daullmer@gmail.com> | 2021-03-10 17:03:19 +0100 |
| commit | 8a74d7659819be55fd60dc8d272b0cca2f5178e2 (patch) | |
| tree | 532fe6bc278269aed261447b5051d81c134514ca | |
| parent | 97fd136a8ca6eaef2d77480d20c467498ddded72 (diff) | |
Fix id tag setting IMDb id when it is TMDb id
| -rw-r--r-- | MediaBrowser.XbmcMetadata/Parsers/MovieNfoParser.cs | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/MediaBrowser.XbmcMetadata/Parsers/MovieNfoParser.cs b/MediaBrowser.XbmcMetadata/Parsers/MovieNfoParser.cs index 2d0eb8433..d30190a7e 100644 --- a/MediaBrowser.XbmcMetadata/Parsers/MovieNfoParser.cs +++ b/MediaBrowser.XbmcMetadata/Parsers/MovieNfoParser.cs @@ -47,12 +47,19 @@ namespace MediaBrowser.XbmcMetadata.Parsers { case "id": { + // get ids from attributes string? imdbId = reader.GetAttribute("IMDB"); string? tmdbId = reader.GetAttribute("TMDB"); - if (string.IsNullOrWhiteSpace(imdbId)) + // read id from content + var contentId = reader.ReadElementContentAsString(); + if (contentId.Contains("tt", StringComparison.Ordinal) && string.IsNullOrEmpty(imdbId)) { - imdbId = reader.ReadElementContentAsString(); + imdbId = contentId; + } + else if (string.IsNullOrEmpty(tmdbId)) + { + tmdbId = contentId; } if (!string.IsNullOrWhiteSpace(imdbId)) |
