Fix id tag setting IMDb id when it is TMDb id

pull/5467/head
David 4 years ago
parent 97fd136a8c
commit 8a74d76598

@ -47,12 +47,19 @@ namespace MediaBrowser.XbmcMetadata.Parsers
{ {
case "id": case "id":
{ {
// get ids from attributes
string? imdbId = reader.GetAttribute("IMDB"); string? imdbId = reader.GetAttribute("IMDB");
string? tmdbId = reader.GetAttribute("TMDB"); 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)) if (!string.IsNullOrWhiteSpace(imdbId))

Loading…
Cancel
Save