support additional id formats for movies and series

pull/702/head
Luke Pulverenti 9 years ago
parent 687c17c4c6
commit 79dc9f29d9

@ -36,13 +36,24 @@ namespace MediaBrowser.XbmcMetadata.Parsers
switch (reader.Name) switch (reader.Name)
{ {
case "id": case "id":
var id = reader.ReadElementContentAsString();
if (!string.IsNullOrWhiteSpace(id))
{ {
item.SetProviderId(MetadataProviders.Imdb, id); string imdbId = reader.GetAttribute("IMDB");
} string tmdbId = reader.GetAttribute("TMDB");
break;
if (string.IsNullOrWhiteSpace(imdbId))
{
imdbId = reader.ReadElementContentAsString();
}
if (!string.IsNullOrWhiteSpace(imdbId))
{
item.SetProviderId(MetadataProviders.Imdb, imdbId);
}
if (!string.IsNullOrWhiteSpace(tmdbId))
{
item.SetProviderId(MetadataProviders.Tmdb, tmdbId);
}
break;
}
case "set": case "set":
{ {
var movie = item as Movie; var movie = item as Movie;

@ -27,13 +27,29 @@ namespace MediaBrowser.XbmcMetadata.Parsers
switch (reader.Name) switch (reader.Name)
{ {
case "id": case "id":
string id = reader.ReadElementContentAsString();
if (!string.IsNullOrWhiteSpace(id))
{ {
item.SetProviderId(MetadataProviders.Tvdb, id); string imdbId = reader.GetAttribute("IMDB");
} string tmdbId = reader.GetAttribute("TMDB");
break; string tvdbId = reader.GetAttribute("TVDB");
if (string.IsNullOrWhiteSpace(tvdbId))
{
tvdbId = reader.ReadElementContentAsString();
}
if (!string.IsNullOrWhiteSpace(imdbId))
{
item.SetProviderId(MetadataProviders.Imdb, imdbId);
}
if (!string.IsNullOrWhiteSpace(tmdbId))
{
item.SetProviderId(MetadataProviders.Tmdb, tmdbId);
}
if (!string.IsNullOrWhiteSpace(tvdbId))
{
item.SetProviderId(MetadataProviders.Tvcom, tvdbId);
}
break;
}
case "airs_dayofweek": case "airs_dayofweek":
{ {
item.AirDays = TVUtils.GetAirDays(reader.ReadElementContentAsString()); item.AirDays = TVUtils.GetAirDays(reader.ReadElementContentAsString());

Loading…
Cancel
Save