consolidate internal interfaces

This commit is contained in:
Luke Pulverenti
2016-10-31 00:28:23 -04:00
parent 0579f245e4
commit 3bf72b71b3
28 changed files with 114 additions and 301 deletions

View File

@@ -123,8 +123,7 @@ namespace MediaBrowser.Server.Implementations.EntryPoints
return;
}
var themeMedia = item as IThemeMedia;
if (themeMedia != null && themeMedia.IsThemeMedia)
if (item.IsThemeMedia)
{
// Don't report theme song or local trailer playback
return;
@@ -156,8 +155,7 @@ namespace MediaBrowser.Server.Implementations.EntryPoints
return;
}
var themeMedia = item as IThemeMedia;
if (themeMedia != null && themeMedia.IsThemeMedia)
if (item.IsThemeMedia)
{
// Don't report theme song or local trailer playback
return;

View File

@@ -256,9 +256,8 @@ namespace MediaBrowser.Server.Implementations.EntryPoints.Notifications
}
var item = e.MediaInfo;
var themeMedia = item as IThemeMedia;
if (themeMedia != null && themeMedia.IsThemeMedia)
if ( item.IsThemeMedia)
{
// Don't report theme song or local trailer playback
return;

View File

@@ -367,7 +367,6 @@
<Compile Include="Persistence\SqliteUserDataRepository.cs" />
<Compile Include="Persistence\SqliteUserRepository.cs" />
<Compile Include="Sorting\StudioComparer.cs" />
<Compile Include="Sorting\VideoBitRateComparer.cs" />
<Compile Include="Sync\AppSyncProvider.cs" />
<Compile Include="Sync\CloudSyncProfile.cs" />
<Compile Include="Sync\IHasSyncQuality.cs" />

View File

@@ -1611,7 +1611,8 @@ namespace MediaBrowser.Server.Implementations.Session
IndexNumber = item.IndexNumber,
ParentIndexNumber = item.ParentIndexNumber,
PremiereDate = item.PremiereDate,
ProductionYear = item.ProductionYear
ProductionYear = item.ProductionYear,
IsThemeMedia = item.IsThemeMedia
};
info.PrimaryImageTag = GetImageCacheTag(item, ImageType.Primary);

View File

@@ -1,41 +0,0 @@
using MediaBrowser.Controller.Entities;
using MediaBrowser.Controller.Sorting;
using MediaBrowser.Model.Querying;
namespace MediaBrowser.Server.Implementations.Sorting
{
class VideoBitRateComparer : IBaseItemComparer
{
/// <summary>
/// Compares the specified x.
/// </summary>
/// <param name="x">The x.</param>
/// <param name="y">The y.</param>
/// <returns>System.Int32.</returns>
public int Compare(BaseItem x, BaseItem y)
{
return GetValue(x).CompareTo(GetValue(y));
}
private int GetValue(BaseItem item)
{
var video = item as Video;
if (video != null)
{
return video.VideoBitRate ?? 0;
}
return 0;
}
/// <summary>
/// Gets the name.
/// </summary>
/// <value>The name.</value>
public string Name
{
get { return ItemSortBy.VideoBitRate; }
}
}
}