fixes #915 - Reading genre/studio/country from nfo by MediaBrowser not handled like XBMC

This commit is contained in:
Luke Pulverenti 2014-09-08 17:35:39 -04:00
parent f7041ccb4a
commit 09bffa1b56

View File

@ -343,7 +343,14 @@ namespace MediaBrowser.XbmcMetadata.Parsers
{ {
if (!string.IsNullOrWhiteSpace(val)) if (!string.IsNullOrWhiteSpace(val))
{ {
hasProductionLocations.AddProductionLocation(val); var parts = val.Split('/')
.Select(i => i.Trim())
.Where(i => !string.IsNullOrWhiteSpace(i));
foreach (var p in parts)
{
hasProductionLocations.AddProductionLocation(p);
}
} }
} }
break; break;
@ -426,7 +433,14 @@ namespace MediaBrowser.XbmcMetadata.Parsers
if (!string.IsNullOrWhiteSpace(val)) if (!string.IsNullOrWhiteSpace(val))
{ {
item.AddStudio(val); var parts = val.Split('/')
.Select(i => i.Trim())
.Where(i => !string.IsNullOrWhiteSpace(i));
foreach (var p in parts)
{
item.AddStudio(p);
}
} }
break; break;
} }
@ -730,9 +744,17 @@ namespace MediaBrowser.XbmcMetadata.Parsers
case "genre": case "genre":
{ {
var val = reader.ReadElementContentAsString(); var val = reader.ReadElementContentAsString();
if (!string.IsNullOrWhiteSpace(val)) if (!string.IsNullOrWhiteSpace(val))
{ {
item.AddGenre(val); var parts = val.Split('/')
.Select(i => i.Trim())
.Where(i => !string.IsNullOrWhiteSpace(i));
foreach (var p in parts)
{
item.AddGenre(p);
}
} }
break; break;
} }