Fix runtime display

This commit is contained in:
Tavares André 2015-05-18 20:37:29 +02:00
parent deb6e5a2ee
commit 132a40a673
4 changed files with 7 additions and 4 deletions

View File

@ -133,10 +133,10 @@ namespace MediaBrowser.Api.Reports
/// <summary> Gets runtime date time. </summary>
/// <param name="runtime"> The runtime. </param>
/// <returns> The runtime date time. </returns>
protected DateTime? GetRuntimeDateTime(long? runtime)
protected double? GetRuntimeDateTime(long? runtime)
{
if (runtime.HasValue)
return new DateTime(runtime.Value);
return Math.Ceiling(new TimeSpan(runtime.Value).TotalMinutes);
return null;
}

View File

@ -13,6 +13,7 @@ namespace MediaBrowser.Api.Reports
DateTime,
Int,
Image,
Object
Object,
Minutes
}
}

View File

@ -87,6 +87,8 @@ namespace MediaBrowser.Api.Reports
return string.Format("{0:t}", value);
case ReportFieldType.DateTime:
return string.Format("{0:d}", value);
case ReportFieldType.Minutes:
return string.Format("{0}mn", value);
case ReportFieldType.Int:
return string.Format("", value);
default:

View File

@ -403,7 +403,7 @@ namespace MediaBrowser.Api.Reports
case HeaderMetadata.Runtime:
column = (i, r) => this.GetRuntimeDateTime(i.RunTimeTicks);
reportHeader.HeaderFieldType = ReportFieldType.Time;
reportHeader.HeaderFieldType = ReportFieldType.Minutes;
reportHeader.SortField = "Runtime,SortName";
break;