mirror of
https://github.com/jellyfin/jellyfin.git
synced 2024-11-16 02:18:54 -07:00
Fix runtime display
This commit is contained in:
parent
deb6e5a2ee
commit
132a40a673
@ -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;
|
||||
}
|
||||
|
||||
|
@ -13,6 +13,7 @@ namespace MediaBrowser.Api.Reports
|
||||
DateTime,
|
||||
Int,
|
||||
Image,
|
||||
Object
|
||||
Object,
|
||||
Minutes
|
||||
}
|
||||
}
|
||||
|
@ -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:
|
||||
|
@ -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;
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user