remove dead interface objects

This commit is contained in:
Luke Pulverenti
2016-10-17 12:35:29 -04:00
parent ba613d5671
commit bba0c564c7
33 changed files with 101 additions and 301 deletions

View File

@@ -33,7 +33,7 @@ namespace MediaBrowser.Controller.Entities
/// <summary>
/// Class BaseItem
/// </summary>
public abstract class BaseItem : IHasProviderIds, ILibraryItem, IHasImages, IHasUserData, IHasMetadata, IHasLookupInfo<ItemLookupInfo>
public abstract class BaseItem : IHasProviderIds, IHasImages, IHasUserData, IHasMetadata, IHasLookupInfo<ItemLookupInfo>
{
protected BaseItem()
{

View File

@@ -7,7 +7,7 @@ namespace MediaBrowser.Controller.Entities
/// Plugins derive from and export this class to create a folder that will appear in the root along
/// with all the other actual physical folders in the system.
/// </summary>
public abstract class BasePluginFolder : Folder, ICollectionFolder, IByReferenceItem
public abstract class BasePluginFolder : Folder, ICollectionFolder
{
public virtual string CollectionType
{

View File

@@ -1,12 +0,0 @@

namespace MediaBrowser.Controller.Entities
{
/// <summary>
/// This is a marker class that tells us that a particular item type may be physically resolved
/// more than once within the library and we need to be sure to resolve them all to the same
/// instance of that item.
/// </summary>
public interface IByReferenceItem
{
}
}

View File

@@ -1,20 +0,0 @@
namespace MediaBrowser.Controller.Entities
{
/// <summary>
/// Interface IHasCriticRating
/// </summary>
public interface IHasCriticRating
{
/// <summary>
/// Gets or sets the critic rating.
/// </summary>
/// <value>The critic rating.</value>
float? CriticRating { get; set; }
/// <summary>
/// Gets or sets the critic rating summary.
/// </summary>
/// <value>The critic rating summary.</value>
string CriticRatingSummary { get; set; }
}
}

View File

@@ -1,12 +0,0 @@

namespace MediaBrowser.Controller.Entities
{
public interface IHasShortOverview
{
/// <summary>
/// Gets or sets the short overview.
/// </summary>
/// <value>The short overview.</value>
string ShortOverview { get; set; }
}
}

View File

@@ -1,28 +0,0 @@
using System;
namespace MediaBrowser.Controller.Entities
{
/// <summary>
/// Interface ILibraryItem
/// </summary>
public interface ILibraryItem
{
/// <summary>
/// Gets the name.
/// </summary>
/// <value>The name.</value>
string Name { get; }
/// <summary>
/// Gets the id.
/// </summary>
/// <value>The id.</value>
Guid Id { get; }
/// <summary>
/// Gets the path.
/// </summary>
/// <value>The path.</value>
string Path { get; }
}
}

View File

@@ -1,10 +0,0 @@
using System;
namespace MediaBrowser.Controller.Entities
{
public class ImageSourceInfo
{
public Guid ImagePathMD5 { get; set; }
public Guid ImageUrlMD5 { get; set; }
}
}

View File

@@ -15,7 +15,7 @@ namespace MediaBrowser.Controller.Entities.Movies
/// <summary>
/// Class Movie
/// </summary>
public class Movie : Video, IHasCriticRating, IHasSpecialFeatures, IHasBudget, IHasTrailers, IHasAwards, IHasMetascore, IHasLookupInfo<MovieInfo>, ISupportsBoxSetGrouping, IHasOriginalTitle
public class Movie : Video, IHasSpecialFeatures, IHasBudget, IHasTrailers, IHasAwards, IHasMetascore, IHasLookupInfo<MovieInfo>, ISupportsBoxSetGrouping, IHasOriginalTitle
{
public List<Guid> SpecialFeatureIds { get; set; }

View File

@@ -36,7 +36,7 @@ namespace MediaBrowser.Controller.Entities.TV
{
get
{
return true;
return false;
}
}

View File

@@ -10,7 +10,7 @@ namespace MediaBrowser.Controller.Entities
/// <summary>
/// Class Trailer
/// </summary>
public class Trailer : Video, IHasCriticRating, IHasBudget, IHasMetascore, IHasOriginalTitle, IHasLookupInfo<TrailerInfo>
public class Trailer : Video, IHasBudget, IHasMetascore, IHasOriginalTitle, IHasLookupInfo<TrailerInfo>
{
public Trailer()
{

View File

@@ -1668,16 +1668,7 @@ namespace MediaBrowser.Controller.Entities
{
var val = query.MinCriticRating.Value;
var hasCriticRating = item as IHasCriticRating;
if (hasCriticRating != null)
{
if (!(hasCriticRating.CriticRating.HasValue && hasCriticRating.CriticRating >= val))
{
return false;
}
}
else
if (!(item.CriticRating.HasValue && item.CriticRating >= val))
{
return false;
}

View File

@@ -24,7 +24,6 @@ namespace MediaBrowser.Controller.Entities
IHasAspectRatio,
ISupportsPlaceHolders,
IHasMediaSources,
IHasShortOverview,
IThemeMedia
{
[IgnoreDataMember]

View File

@@ -78,14 +78,17 @@ namespace MediaBrowser.Controller.LiveTv
protected override string CreateSortName()
{
double number = 0;
if (!string.IsNullOrEmpty(Number))
{
double.TryParse(Number, NumberStyles.Any, CultureInfo.InvariantCulture, out number);
double number = 0;
if (double.TryParse(Number, NumberStyles.Any, CultureInfo.InvariantCulture, out number))
{
return number.ToString("00000-") + (Name ?? string.Empty);
}
}
return number.ToString("00000-") + (Name ?? string.Empty);
return Number + "-" + (Name ?? string.Empty);
}
[IgnoreDataMember]

View File

@@ -132,10 +132,8 @@
<Compile Include="Entities\Game.cs" />
<Compile Include="Entities\GameGenre.cs" />
<Compile Include="Entities\GameSystem.cs" />
<Compile Include="Entities\IByReferenceItem.cs" />
<Compile Include="Entities\IHasAspectRatio.cs" />
<Compile Include="Entities\IHasBudget.cs" />
<Compile Include="Entities\IHasCriticRating.cs" />
<Compile Include="Entities\IHasDisplayOrder.cs" />
<Compile Include="Entities\IHasId.cs" />
<Compile Include="Entities\IHasImages.cs" />
@@ -146,15 +144,12 @@
<Compile Include="Entities\IHasProgramAttributes.cs" />
<Compile Include="Entities\IHasScreenshots.cs" />
<Compile Include="Entities\IHasSeries.cs" />
<Compile Include="Entities\IHasShortOverview.cs" />
<Compile Include="Entities\IHasSpecialFeatures.cs" />
<Compile Include="Entities\IHasStartDate.cs" />
<Compile Include="Entities\IHasTrailers.cs" />
<Compile Include="Entities\IHasUserData.cs" />
<Compile Include="Entities\IHiddenFromDisplay.cs" />
<Compile Include="Entities\IItemByName.cs" />
<Compile Include="Entities\ILibraryItem.cs" />
<Compile Include="Entities\ImageSourceInfo.cs" />
<Compile Include="Entities\IMetadataContainer.cs" />
<Compile Include="Entities\InternalItemsQuery.cs" />
<Compile Include="Entities\InternalPeopleQuery.cs" />

View File

@@ -185,14 +185,12 @@ namespace MediaBrowser.Controller.Providers
{
var text = reader.ReadElementContentAsString();
var hasCriticRating = item as IHasCriticRating;
if (hasCriticRating != null && !string.IsNullOrEmpty(text))
if (!string.IsNullOrEmpty(text))
{
float value;
if (float.TryParse(text, NumberStyles.Any, _usCulture, out value))
{
hasCriticRating.CriticRating = value;
item.CriticRating = value;
}
}
@@ -292,12 +290,7 @@ namespace MediaBrowser.Controller.Providers
if (!string.IsNullOrWhiteSpace(val))
{
var hasShortOverview = item as IHasShortOverview;
if (hasShortOverview != null)
{
hasShortOverview.ShortOverview = val;
}
item.ShortOverview = val;
}
break;
@@ -309,12 +302,7 @@ namespace MediaBrowser.Controller.Providers
if (!string.IsNullOrWhiteSpace(val))
{
var hasCriticRating = item as IHasCriticRating;
if (hasCriticRating != null)
{
hasCriticRating.CriticRatingSummary = val;
}
item.CriticRatingSummary = val;
}
break;

View File

@@ -12,7 +12,6 @@ namespace MediaBrowser.Controller.Providers
public Stream Stream { get; set; }
public ImageFormat Format { get; set; }
public bool HasImage { get; set; }
public string InternalCacheKey { get; set; }
public void SetFormatFromMimeType(string mimeType)
{

View File

@@ -69,28 +69,8 @@ namespace MediaBrowser.Controller.Providers
/// <summary>
/// Saves the image.
/// </summary>
/// <param name="item">The item.</param>
/// <param name="source">The source.</param>
/// <param name="mimeType">Type of the MIME.</param>
/// <param name="type">The type.</param>
/// <param name="imageIndex">Index of the image.</param>
/// <param name="internalCacheKey">The internal cache key.</param>
/// <param name="cancellationToken">The cancellation token.</param>
/// <returns>Task.</returns>
Task SaveImage(IHasImages item, Stream source, string mimeType, ImageType type, int? imageIndex, string internalCacheKey, CancellationToken cancellationToken);
/// <summary>
/// Saves the image.
/// </summary>
/// <param name="item">The item.</param>
/// <param name="source">The source.</param>
/// <param name="mimeType">Type of the MIME.</param>
/// <param name="type">The type.</param>
/// <param name="imageIndex">Index of the image.</param>
/// <param name="internalCacheKey">The internal cache key.</param>
/// <param name="cancellationToken">The cancellation token.</param>
/// <returns>Task.</returns>
Task SaveImage(IHasImages item, string source, string mimeType, ImageType type, int? imageIndex, string internalCacheKey, CancellationToken cancellationToken);
Task SaveImage(IHasImages item, string source, string mimeType, ImageType type, int? imageIndex, bool? saveLocallyWithMedia, CancellationToken cancellationToken);
/// <summary>
/// Adds the metadata providers.