normalize session object

This commit is contained in:
Luke Pulverenti
2017-06-09 15:26:54 -04:00
parent d76bcd8473
commit 282dce7f10
16 changed files with 76 additions and 369 deletions

View File

@@ -149,6 +149,7 @@ namespace MediaBrowser.Controller.Entities
public string[] PresetViews { get; set; }
public TrailerType[] TrailerTypes { get; set; }
public SourceType[] SourceTypes { get; set; }
public DayOfWeek[] AirDays { get; set; }
public SeriesStatus[] SeriesStatuses { get; set; }
@@ -214,6 +215,7 @@ namespace MediaBrowser.Controller.Entities
ExcludeInheritedTags = new string[] { };
PresetViews = new string[] { };
TrailerTypes = new TrailerType[] { };
SourceTypes = new SourceType[] { };
AirDays = new DayOfWeek[] { };
SeriesStatuses = new SeriesStatus[] { };
OrderBy = new List<Tuple<string, SortOrder>>();

View File

@@ -1,5 +1,5 @@
using MediaBrowser.Controller.Entities;
using MediaBrowser.Model.Entities;
using MediaBrowser.Model.Dto;
using System;
using System.Collections.Generic;
@@ -13,7 +13,7 @@ namespace MediaBrowser.Controller.Library
public List<User> Users { get; set; }
public long? PlaybackPositionTicks { get; set; }
public BaseItem Item { get; set; }
public BaseItemInfo MediaInfo { get; set; }
public BaseItemDto MediaInfo { get; set; }
public string MediaSourceId { get; set; }
public bool IsPaused { get; set; }
public bool IsAutomated { get; set; }

View File

@@ -1604,7 +1604,7 @@ namespace MediaBrowser.Controller.MediaEncoding
}
// Only do this for video files due to sometimes unpredictable codec names coming from BDInfo
if (state.VideoType == VideoType.VideoFile && string.IsNullOrWhiteSpace(encodingOptions.HardwareAccelerationType))
if (state.VideoType == VideoType.VideoFile && state.RunTimeTicks.HasValue && string.IsNullOrWhiteSpace(encodingOptions.HardwareAccelerationType))
{
foreach (var stream in state.MediaSource.MediaStreams)
{

View File

@@ -1,7 +1,7 @@
using MediaBrowser.Controller.Entities;
using MediaBrowser.Controller.Library;
using MediaBrowser.Controller.Security;
using MediaBrowser.Model.Entities;
using MediaBrowser.Model.Dto;
using MediaBrowser.Model.Events;
using MediaBrowser.Model.Session;
using MediaBrowser.Model.Users;
@@ -249,7 +249,7 @@ namespace MediaBrowser.Controller.Session
/// </summary>
/// <param name="sessionId">The session identifier.</param>
/// <param name="item">The item.</param>
void ReportNowViewingItem(string sessionId, BaseItemInfo item);
void ReportNowViewingItem(string sessionId, BaseItemDto item);
/// <summary>
/// Authenticates the new session.

View File

@@ -1,4 +1,4 @@
using MediaBrowser.Model.Entities;
using MediaBrowser.Model.Dto;
using MediaBrowser.Model.Session;
using System;
using System.Collections.Generic;
@@ -100,13 +100,13 @@ namespace MediaBrowser.Controller.Session
/// Gets or sets the name of the now viewing item.
/// </summary>
/// <value>The name of the now viewing item.</value>
public BaseItemInfo NowViewingItem { get; set; }
public BaseItemDto NowViewingItem { get; set; }
/// <summary>
/// Gets or sets the now playing item.
/// </summary>
/// <value>The now playing item.</value>
public BaseItemInfo NowPlayingItem { get; set; }
public BaseItemDto NowPlayingItem { get; set; }
public BaseItem FullNowPlayingItem { get; set; }