Fixed blank ForcedSortName

pull/702/head
Luke Pulverenti 12 years ago
parent 2beb589ee4
commit 1ea627a6e7

@ -409,7 +409,12 @@ namespace MediaBrowser.Controller.Entities
{ {
get get
{ {
return ForcedSortName ?? _sortName ?? (_sortName = CreateSortName()); if (!string.IsNullOrEmpty(ForcedSortName))
{
return ForcedSortName;
}
return _sortName ?? (_sortName = CreateSortName());
} }
} }

@ -173,8 +173,16 @@ namespace MediaBrowser.Controller.Providers
break; break;
} }
case "SortTitle": case "SortTitle":
item.ForcedSortName = reader.ReadElementContentAsString(); {
var val = reader.ReadElementContentAsString();
if (!string.IsNullOrWhiteSpace(val))
{
item.ForcedSortName = val;
}
break; break;
}
case "Overview": case "Overview":
case "Description": case "Description":
@ -503,7 +511,7 @@ namespace MediaBrowser.Controller.Providers
{ {
DateTime airDate; DateTime airDate;
if (DateTime.TryParse(firstAired, out airDate) && airDate.Year > 1850) if (DateTime.TryParseExact(firstAired, "yyyy-MM-dd", CultureInfo.InvariantCulture, DateTimeStyles.AssumeLocal, out airDate) && airDate.Year > 1850)
{ {
item.PremiereDate = airDate.ToUniversalTime(); item.PremiereDate = airDate.ToUniversalTime();
item.ProductionYear = airDate.Year; item.ProductionYear = airDate.Year;
@ -522,7 +530,7 @@ namespace MediaBrowser.Controller.Providers
{ {
DateTime airDate; DateTime airDate;
if (DateTime.TryParse(firstAired, out airDate) && airDate.Year > 1850) if (DateTime.TryParseExact(firstAired, "yyyy-MM-dd", CultureInfo.InvariantCulture, DateTimeStyles.AssumeLocal, out airDate) && airDate.Year > 1850)
{ {
item.EndDate = airDate.ToUniversalTime(); item.EndDate = airDate.ToUniversalTime();
} }

Loading…
Cancel
Save