removed dead db fields

This commit is contained in:
Luke Pulverenti 2015-09-29 13:35:23 -04:00
parent 6e222eaaf4
commit 35fc099114
32 changed files with 70 additions and 235 deletions

View File

@ -211,11 +211,6 @@ namespace MediaBrowser.Api
UpdateItem(request, item); UpdateItem(request, item);
if (isLockedChanged && item.IsLocked)
{
item.IsUnidentified = false;
}
await item.UpdateToRepository(ItemUpdateType.MetadataEdit, CancellationToken.None).ConfigureAwait(false); await item.UpdateToRepository(ItemUpdateType.MetadataEdit, CancellationToken.None).ConfigureAwait(false);
if (request.People != null) if (request.People != null)
@ -321,13 +316,8 @@ namespace MediaBrowser.Api
SetProductionLocations(item, request); SetProductionLocations(item, request);
var hasLang = item as IHasPreferredMetadataLanguage; item.PreferredMetadataCountryCode = request.PreferredMetadataCountryCode;
item.PreferredMetadataLanguage = request.PreferredMetadataLanguage;
if (hasLang != null)
{
hasLang.PreferredMetadataCountryCode = request.PreferredMetadataCountryCode;
hasLang.PreferredMetadataLanguage = request.PreferredMetadataLanguage;
}
var hasDisplayOrder = item as IHasDisplayOrder; var hasDisplayOrder = item as IHasDisplayOrder;
if (hasDisplayOrder != null) if (hasDisplayOrder != null)

View File

@ -43,7 +43,6 @@ namespace MediaBrowser.Api.Reports
MusicArtist, MusicArtist,
AudioAlbum, AudioAlbum,
Locked, Locked,
Unidentified,
ImagePrimary, ImagePrimary,
ImageBackdrop, ImageBackdrop,
ImageLogo, ImageLogo,

View File

@ -17,7 +17,6 @@ namespace MediaBrowser.Api.Reports
TrailersImage, TrailersImage,
SpecialsImage, SpecialsImage,
LockDataImage, LockDataImage,
UnidentifiedImage,
TagsPrimaryImage, TagsPrimaryImage,
TagsBackdropImage, TagsBackdropImage,
TagsLogoImage, TagsLogoImage,

View File

@ -105,7 +105,6 @@ namespace MediaBrowser.Api.Reports
{ {
HeaderMetadata.Status, HeaderMetadata.Status,
HeaderMetadata.Locked, HeaderMetadata.Locked,
HeaderMetadata.Unidentified,
HeaderMetadata.ImagePrimary, HeaderMetadata.ImagePrimary,
HeaderMetadata.ImageBackdrop, HeaderMetadata.ImageBackdrop,
HeaderMetadata.ImageLogo, HeaderMetadata.ImageLogo,
@ -122,7 +121,6 @@ namespace MediaBrowser.Api.Reports
{ {
HeaderMetadata.Status, HeaderMetadata.Status,
HeaderMetadata.Locked, HeaderMetadata.Locked,
HeaderMetadata.Unidentified,
HeaderMetadata.ImagePrimary, HeaderMetadata.ImagePrimary,
HeaderMetadata.ImageBackdrop, HeaderMetadata.ImageBackdrop,
HeaderMetadata.ImageLogo, HeaderMetadata.ImageLogo,
@ -143,7 +141,6 @@ namespace MediaBrowser.Api.Reports
{ {
HeaderMetadata.Status, HeaderMetadata.Status,
HeaderMetadata.Locked, HeaderMetadata.Locked,
HeaderMetadata.Unidentified,
HeaderMetadata.ImagePrimary, HeaderMetadata.ImagePrimary,
HeaderMetadata.ImageBackdrop, HeaderMetadata.ImageBackdrop,
HeaderMetadata.ImageLogo, HeaderMetadata.ImageLogo,
@ -161,7 +158,6 @@ namespace MediaBrowser.Api.Reports
{ {
HeaderMetadata.Status, HeaderMetadata.Status,
HeaderMetadata.Locked, HeaderMetadata.Locked,
HeaderMetadata.Unidentified,
HeaderMetadata.ImagePrimary, HeaderMetadata.ImagePrimary,
HeaderMetadata.ImageBackdrop, HeaderMetadata.ImageBackdrop,
HeaderMetadata.ImageLogo, HeaderMetadata.ImageLogo,
@ -177,7 +173,6 @@ namespace MediaBrowser.Api.Reports
{ {
HeaderMetadata.Status, HeaderMetadata.Status,
HeaderMetadata.Locked, HeaderMetadata.Locked,
HeaderMetadata.Unidentified,
HeaderMetadata.ImagePrimary, HeaderMetadata.ImagePrimary,
HeaderMetadata.ImageBackdrop, HeaderMetadata.ImageBackdrop,
HeaderMetadata.ImageLogo, HeaderMetadata.ImageLogo,
@ -198,7 +193,6 @@ namespace MediaBrowser.Api.Reports
{ {
HeaderMetadata.Status, HeaderMetadata.Status,
HeaderMetadata.Locked, HeaderMetadata.Locked,
HeaderMetadata.Unidentified,
HeaderMetadata.ImagePrimary, HeaderMetadata.ImagePrimary,
HeaderMetadata.ImageBackdrop, HeaderMetadata.ImageBackdrop,
HeaderMetadata.ImageLogo, HeaderMetadata.ImageLogo,
@ -223,7 +217,6 @@ namespace MediaBrowser.Api.Reports
{ {
HeaderMetadata.Status, HeaderMetadata.Status,
HeaderMetadata.Locked, HeaderMetadata.Locked,
HeaderMetadata.Unidentified,
HeaderMetadata.ImagePrimary, HeaderMetadata.ImagePrimary,
HeaderMetadata.ImageBackdrop, HeaderMetadata.ImageBackdrop,
HeaderMetadata.ImageLogo, HeaderMetadata.ImageLogo,
@ -241,7 +234,6 @@ namespace MediaBrowser.Api.Reports
{ {
HeaderMetadata.Status, HeaderMetadata.Status,
HeaderMetadata.Locked, HeaderMetadata.Locked,
HeaderMetadata.Unidentified,
HeaderMetadata.ImagePrimary, HeaderMetadata.ImagePrimary,
HeaderMetadata.ImageBackdrop, HeaderMetadata.ImageBackdrop,
HeaderMetadata.ImageLogo, HeaderMetadata.ImageLogo,
@ -260,7 +252,6 @@ namespace MediaBrowser.Api.Reports
{ {
HeaderMetadata.Status, HeaderMetadata.Status,
HeaderMetadata.Locked, HeaderMetadata.Locked,
HeaderMetadata.Unidentified,
HeaderMetadata.ImagePrimary, HeaderMetadata.ImagePrimary,
HeaderMetadata.ImageBackdrop, HeaderMetadata.ImageBackdrop,
HeaderMetadata.ImageLogo, HeaderMetadata.ImageLogo,
@ -284,7 +275,6 @@ namespace MediaBrowser.Api.Reports
{ {
HeaderMetadata.Status, HeaderMetadata.Status,
HeaderMetadata.Locked, HeaderMetadata.Locked,
HeaderMetadata.Unidentified,
HeaderMetadata.ImagePrimary, HeaderMetadata.ImagePrimary,
HeaderMetadata.ImageBackdrop, HeaderMetadata.ImageBackdrop,
HeaderMetadata.ImageLogo, HeaderMetadata.ImageLogo,
@ -315,11 +305,9 @@ namespace MediaBrowser.Api.Reports
{ {
HeaderMetadata.Status, HeaderMetadata.Status,
HeaderMetadata.Locked, HeaderMetadata.Locked,
HeaderMetadata.Unidentified,
HeaderMetadata.ImagePrimary, HeaderMetadata.ImagePrimary,
HeaderMetadata.ImageBackdrop, HeaderMetadata.ImageBackdrop,
HeaderMetadata.ImageLogo, HeaderMetadata.ImageLogo,
HeaderMetadata.Unidentified,
HeaderMetadata.ImagePrimary, HeaderMetadata.ImagePrimary,
HeaderMetadata.ImageBackdrop, HeaderMetadata.ImageBackdrop,
HeaderMetadata.ImageLogo, HeaderMetadata.ImageLogo,
@ -376,12 +364,6 @@ namespace MediaBrowser.Api.Reports
option.Header.CanGroup = false; option.Header.CanGroup = false;
option.Header.DisplayType = ReportDisplayType.Export; option.Header.DisplayType = ReportDisplayType.Export;
break; break;
case HeaderMetadata.Unidentified:
option.Column = (i, r) => this.GetBoolString(r.IsUnidentified);
option.Header.ItemViewType = ItemViewType.UnidentifiedImage;
option.Header.CanGroup = false;
option.Header.DisplayType = ReportDisplayType.Export;
break;
case HeaderMetadata.ImagePrimary: case HeaderMetadata.ImagePrimary:
option.Column = (i, r) => this.GetBoolString(r.HasImageTagsPrimary); option.Column = (i, r) => this.GetBoolString(r.HasImageTagsPrimary);
option.Header.ItemViewType = ItemViewType.TagsPrimaryImage; option.Header.ItemViewType = ItemViewType.TagsPrimaryImage;
@ -633,7 +615,6 @@ namespace MediaBrowser.Api.Reports
{ {
Id = item.Id.ToString("N"), Id = item.Id.ToString("N"),
HasLockData = item.IsLocked, HasLockData = item.IsLocked,
IsUnidentified = item.IsUnidentified,
HasLocalTrailer = hasTrailers != null ? hasTrailers.GetTrailerIds().Count() > 0 : false, HasLocalTrailer = hasTrailers != null ? hasTrailers.GetTrailerIds().Count() > 0 : false,
HasImageTagsPrimary = (item.ImageInfos != null && item.ImageInfos.Count(n => n.Type == ImageType.Primary) > 0), HasImageTagsPrimary = (item.ImageInfos != null && item.ImageInfos.Count(n => n.Type == ImageType.Primary) > 0),
HasImageTagsBackdrop = (item.ImageInfos != null && item.ImageInfos.Count(n => n.Type == ImageType.Backdrop) > 0), HasImageTagsBackdrop = (item.ImageInfos != null && item.ImageInfos.Count(n => n.Type == ImageType.Backdrop) > 0),

View File

@ -56,10 +56,6 @@ namespace MediaBrowser.Api.Reports
/// <value> true if this object has specials, false if not. </value> /// <value> true if this object has specials, false if not. </value>
public bool HasSpecials { get; set; } public bool HasSpecials { get; set; }
/// <summary> Gets or sets a value indicating whether this object is unidentified. </summary>
/// <value> true if this object is unidentified, false if not. </value>
public bool IsUnidentified { get; set; }
/// <summary> Gets or sets the columns. </summary> /// <summary> Gets or sets the columns. </summary>
/// <value> The columns. </value> /// <value> The columns. </value>
public List<ReportItem> Columns { get; set; } public List<ReportItem> Columns { get; set; }

View File

@ -226,7 +226,6 @@ namespace MediaBrowser.Api.Reports
NameStartsWithOrGreater = request.NameStartsWithOrGreater, NameStartsWithOrGreater = request.NameStartsWithOrGreater,
HasImdbId = request.HasImdbId, HasImdbId = request.HasImdbId,
IsYearMismatched = request.IsYearMismatched, IsYearMismatched = request.IsYearMismatched,
IsUnidentified = request.IsUnidentified,
IsPlaceHolder = request.IsPlaceHolder, IsPlaceHolder = request.IsPlaceHolder,
IsLocked = request.IsLocked, IsLocked = request.IsLocked,
IsInBoxSet = request.IsInBoxSet, IsInBoxSet = request.IsInBoxSet,

View File

@ -299,9 +299,6 @@ namespace MediaBrowser.Api.UserLibrary
[ApiMember(Name = "IsLocked", Description = "Optional filter by items that are locked.", IsRequired = false, DataType = "string", ParameterType = "query", Verb = "GET")] [ApiMember(Name = "IsLocked", Description = "Optional filter by items that are locked.", IsRequired = false, DataType = "string", ParameterType = "query", Verb = "GET")]
public bool? IsLocked { get; set; } public bool? IsLocked { get; set; }
[ApiMember(Name = "IsUnidentified", Description = "Optional filter by items that are unidentified by internet metadata providers.", IsRequired = false, DataType = "string", ParameterType = "query", Verb = "GET")]
public bool? IsUnidentified { get; set; }
[ApiMember(Name = "IsPlaceHolder", Description = "Optional filter by items that are placeholders", IsRequired = false, DataType = "string", ParameterType = "query", Verb = "GET")] [ApiMember(Name = "IsPlaceHolder", Description = "Optional filter by items that are placeholders", IsRequired = false, DataType = "string", ParameterType = "query", Verb = "GET")]
public bool? IsPlaceHolder { get; set; } public bool? IsPlaceHolder { get; set; }

View File

@ -192,7 +192,6 @@ namespace MediaBrowser.Api.UserLibrary
NameStartsWithOrGreater = request.NameStartsWithOrGreater, NameStartsWithOrGreater = request.NameStartsWithOrGreater,
HasImdbId = request.HasImdbId, HasImdbId = request.HasImdbId,
IsYearMismatched = request.IsYearMismatched, IsYearMismatched = request.IsYearMismatched,
IsUnidentified = request.IsUnidentified,
IsPlaceHolder = request.IsPlaceHolder, IsPlaceHolder = request.IsPlaceHolder,
IsLocked = request.IsLocked, IsLocked = request.IsLocked,
IsInBoxSet = request.IsInBoxSet, IsInBoxSet = request.IsInBoxSet,

View File

@ -10,8 +10,6 @@ namespace MediaBrowser.Controller.Channels
{ {
public class Channel : Folder public class Channel : Folder
{ {
public string OriginalChannelName { get; set; }
public override bool IsVisible(User user) public override bool IsVisible(User user)
{ {
if (user.Policy.BlockedChannels != null) if (user.Policy.BlockedChannels != null)

View File

@ -55,6 +55,9 @@ namespace MediaBrowser.Controller.Entities
public static string ThemeSongFilename = "theme"; public static string ThemeSongFilename = "theme";
public static string ThemeVideosFolderName = "backdrops"; public static string ThemeVideosFolderName = "backdrops";
public string PreferredMetadataCountryCode { get; set; }
public string PreferredMetadataLanguage { get; set; }
public List<ItemImageInfo> ImageInfos { get; set; } public List<ItemImageInfo> ImageInfos { get; set; }
/// <summary> /// <summary>
@ -333,8 +336,6 @@ namespace MediaBrowser.Controller.Entities
[IgnoreDataMember] [IgnoreDataMember]
public bool IsLocked { get; set; } public bool IsLocked { get; set; }
public bool IsUnidentified { get; set; }
/// <summary> /// <summary>
/// Gets or sets the locked fields. /// Gets or sets the locked fields.
@ -973,18 +974,11 @@ namespace MediaBrowser.Controller.Entities
/// <returns>System.String.</returns> /// <returns>System.String.</returns>
public string GetPreferredMetadataLanguage() public string GetPreferredMetadataLanguage()
{ {
string lang = null; string lang = PreferredMetadataLanguage;
var hasLang = this as IHasPreferredMetadataLanguage;
if (hasLang != null)
{
lang = hasLang.PreferredMetadataLanguage;
}
if (string.IsNullOrWhiteSpace(lang)) if (string.IsNullOrWhiteSpace(lang))
{ {
lang = Parents.OfType<IHasPreferredMetadataLanguage>() lang = Parents
.Select(i => i.PreferredMetadataLanguage) .Select(i => i.PreferredMetadataLanguage)
.FirstOrDefault(i => !string.IsNullOrWhiteSpace(i)); .FirstOrDefault(i => !string.IsNullOrWhiteSpace(i));
} }
@ -1010,18 +1004,11 @@ namespace MediaBrowser.Controller.Entities
/// <returns>System.String.</returns> /// <returns>System.String.</returns>
public string GetPreferredMetadataCountryCode() public string GetPreferredMetadataCountryCode()
{ {
string lang = null; string lang = PreferredMetadataCountryCode;
var hasLang = this as IHasPreferredMetadataLanguage;
if (hasLang != null)
{
lang = hasLang.PreferredMetadataCountryCode;
}
if (string.IsNullOrWhiteSpace(lang)) if (string.IsNullOrWhiteSpace(lang))
{ {
lang = Parents.OfType<IHasPreferredMetadataLanguage>() lang = Parents
.Select(i => i.PreferredMetadataCountryCode) .Select(i => i.PreferredMetadataCountryCode)
.FirstOrDefault(i => !string.IsNullOrWhiteSpace(i)); .FirstOrDefault(i => !string.IsNullOrWhiteSpace(i));
} }

View File

@ -7,7 +7,7 @@ using MediaBrowser.Model.Users;
namespace MediaBrowser.Controller.Entities namespace MediaBrowser.Controller.Entities
{ {
public class Book : BaseItem, IHasTags, IHasPreferredMetadataLanguage, IHasLookupInfo<BookInfo>, IHasSeries public class Book : BaseItem, IHasTags, IHasLookupInfo<BookInfo>, IHasSeries
{ {
public override string MediaType public override string MediaType
{ {
@ -25,14 +25,6 @@ namespace MediaBrowser.Controller.Entities
public string SeriesName { get; set; } public string SeriesName { get; set; }
public string PreferredMetadataLanguage { get; set; }
/// <summary>
/// Gets or sets the preferred metadata country code.
/// </summary>
/// <value>The preferred metadata country code.</value>
public string PreferredMetadataCountryCode { get; set; }
public Book() public Book()
{ {
Tags = new List<string>(); Tags = new List<string>();

View File

@ -19,7 +19,7 @@ namespace MediaBrowser.Controller.Entities
/// <summary> /// <summary>
/// Class Folder /// Class Folder
/// </summary> /// </summary>
public class Folder : BaseItem, IHasThemeMedia, IHasTags, IHasPreferredMetadataLanguage public class Folder : BaseItem, IHasThemeMedia, IHasTags
{ {
public static IUserManager UserManager { get; set; } public static IUserManager UserManager { get; set; }
public static IUserViewManager UserViewManager { get; set; } public static IUserViewManager UserViewManager { get; set; }
@ -28,14 +28,6 @@ namespace MediaBrowser.Controller.Entities
public List<Guid> ThemeVideoIds { get; set; } public List<Guid> ThemeVideoIds { get; set; }
public List<string> Tags { get; set; } public List<string> Tags { get; set; }
public string PreferredMetadataLanguage { get; set; }
/// <summary>
/// Gets or sets the preferred metadata country code.
/// </summary>
/// <value>The preferred metadata country code.</value>
public string PreferredMetadataCountryCode { get; set; }
public Folder() public Folder()
{ {
LinkedChildren = new List<LinkedChild>(); LinkedChildren = new List<LinkedChild>();

View File

@ -8,19 +8,11 @@ using System.Linq;
namespace MediaBrowser.Controller.Entities namespace MediaBrowser.Controller.Entities
{ {
public class Game : BaseItem, IHasTrailers, IHasThemeMedia, IHasTags, IHasScreenshots, ISupportsPlaceHolders, IHasPreferredMetadataLanguage, IHasLookupInfo<GameInfo> public class Game : BaseItem, IHasTrailers, IHasThemeMedia, IHasTags, IHasScreenshots, ISupportsPlaceHolders, IHasLookupInfo<GameInfo>
{ {
public List<Guid> ThemeSongIds { get; set; } public List<Guid> ThemeSongIds { get; set; }
public List<Guid> ThemeVideoIds { get; set; } public List<Guid> ThemeVideoIds { get; set; }
public string PreferredMetadataLanguage { get; set; }
/// <summary>
/// Gets or sets the preferred metadata country code.
/// </summary>
/// <value>The preferred metadata country code.</value>
public string PreferredMetadataCountryCode { get; set; }
public Game() public Game()
{ {
MultiPartGameFiles = new List<string>(); MultiPartGameFiles = new List<string>();

View File

@ -44,12 +44,6 @@ namespace MediaBrowser.Controller.Entities
/// <returns><c>true</c> if XXXX, <c>false</c> otherwise.</returns> /// <returns><c>true</c> if XXXX, <c>false</c> otherwise.</returns>
bool BeforeMetadataRefresh(); bool BeforeMetadataRefresh();
/// <summary>
/// Gets or sets a value indicating whether this instance is unidentified.
/// </summary>
/// <value><c>true</c> if this instance is unidentified; otherwise, <c>false</c>.</value>
bool IsUnidentified { get; set; }
/// <summary> /// <summary>
/// Afters the metadata refresh. /// Afters the metadata refresh.
/// </summary> /// </summary>

View File

@ -1,21 +0,0 @@

namespace MediaBrowser.Controller.Entities
{
/// <summary>
/// Interface IHasPreferredMetadataLanguage
/// </summary>
public interface IHasPreferredMetadataLanguage
{
/// <summary>
/// Gets or sets the preferred metadata language.
/// </summary>
/// <value>The preferred metadata language.</value>
string PreferredMetadataLanguage { get; set; }
/// <summary>
/// Gets or sets the preferred metadata country code.
/// </summary>
/// <value>The preferred metadata country code.</value>
string PreferredMetadataCountryCode { get; set; }
}
}

View File

@ -52,7 +52,6 @@ namespace MediaBrowser.Controller.Entities
public bool? IsHD { get; set; } public bool? IsHD { get; set; }
public bool? IsInBoxSet { get; set; } public bool? IsInBoxSet { get; set; }
public bool? IsLocked { get; set; } public bool? IsLocked { get; set; }
public bool? IsUnidentified { get; set; }
public bool? IsPlaceHolder { get; set; } public bool? IsPlaceHolder { get; set; }
public bool? IsYearMismatched { get; set; } public bool? IsYearMismatched { get; set; }

View File

@ -20,7 +20,6 @@ namespace MediaBrowser.Controller.Entities.TV
public List<Guid> SpecialFeatureIds { get; set; } public List<Guid> SpecialFeatureIds { get; set; }
public string OriginalTitle { get; set; } public string OriginalTitle { get; set; }
public int SeasonCount { get; set; }
public int? AnimeSeriesIndex { get; set; } public int? AnimeSeriesIndex { get; set; }

View File

@ -1036,11 +1036,6 @@ namespace MediaBrowser.Controller.Entities
return false; return false;
} }
if (request.IsUnidentified.HasValue)
{
return false;
}
if (!string.IsNullOrWhiteSpace(request.Person)) if (!string.IsNullOrWhiteSpace(request.Person))
{ {
return false; return false;
@ -1429,15 +1424,6 @@ namespace MediaBrowser.Controller.Entities
} }
} }
if (query.IsUnidentified.HasValue)
{
var val = query.IsUnidentified.Value;
if (item.IsUnidentified != val)
{
return false;
}
}
if (query.HasImdbId.HasValue) if (query.HasImdbId.HasValue)
{ {
var filterValue = query.HasImdbId.Value; var filterValue = query.HasImdbId.Value;

View File

@ -23,7 +23,6 @@ namespace MediaBrowser.Controller.Entities
ISupportsPlaceHolders, ISupportsPlaceHolders,
IHasMediaSources, IHasMediaSources,
IHasShortOverview, IHasShortOverview,
IHasPreferredMetadataLanguage,
IThemeMedia, IThemeMedia,
IArchivable IArchivable
{ {
@ -48,13 +47,6 @@ namespace MediaBrowser.Controller.Entities
public string ShortOverview { get; set; } public string ShortOverview { get; set; }
public ExtraType? ExtraType { get; set; } public ExtraType? ExtraType { get; set; }
/// <summary>
/// Gets or sets the preferred metadata country code.
/// </summary>
/// <value>The preferred metadata country code.</value>
public string PreferredMetadataCountryCode { get; set; }
public string PreferredMetadataLanguage { get; set; }
/// <summary> /// <summary>
/// Gets or sets the timestamp. /// Gets or sets the timestamp.
/// </summary> /// </summary>

View File

@ -144,7 +144,6 @@
<Compile Include="Entities\IHasMediaSources.cs" /> <Compile Include="Entities\IHasMediaSources.cs" />
<Compile Include="Entities\IHasMetascore.cs" /> <Compile Include="Entities\IHasMetascore.cs" />
<Compile Include="Entities\IHasOriginalTitle.cs" /> <Compile Include="Entities\IHasOriginalTitle.cs" />
<Compile Include="Entities\IHasPreferredMetadataLanguage.cs" />
<Compile Include="Entities\IHasProductionLocations.cs" /> <Compile Include="Entities\IHasProductionLocations.cs" />
<Compile Include="Entities\IHasProgramAttributes.cs" /> <Compile Include="Entities\IHasProgramAttributes.cs" />
<Compile Include="Entities\IHasScreenshots.cs" /> <Compile Include="Entities\IHasScreenshots.cs" />

View File

@ -304,11 +304,7 @@ namespace MediaBrowser.Controller.Providers
{ {
var val = reader.ReadElementContentAsString(); var val = reader.ReadElementContentAsString();
var hasLanguage = item as IHasPreferredMetadataLanguage; item.PreferredMetadataLanguage = val;
if (hasLanguage != null)
{
hasLanguage.PreferredMetadataLanguage = val;
}
break; break;
} }
@ -317,11 +313,7 @@ namespace MediaBrowser.Controller.Providers
{ {
var val = reader.ReadElementContentAsString(); var val = reader.ReadElementContentAsString();
var hasLanguage = item as IHasPreferredMetadataLanguage; item.PreferredMetadataCountryCode = val;
if (hasLanguage != null)
{
hasLanguage.PreferredMetadataCountryCode = val;
}
break; break;
} }

View File

@ -426,17 +426,13 @@ namespace MediaBrowser.LocalMetadata.Savers
} }
} }
var hasLanguage = item as IHasPreferredMetadataLanguage; if (!string.IsNullOrEmpty(item.PreferredMetadataLanguage))
if (hasLanguage != null)
{ {
if (!string.IsNullOrEmpty(hasLanguage.PreferredMetadataLanguage)) builder.Append("<Language>" + SecurityElement.Escape(item.PreferredMetadataLanguage) + "</Language>");
{ }
builder.Append("<Language>" + SecurityElement.Escape(hasLanguage.PreferredMetadataLanguage) + "</Language>"); if (!string.IsNullOrEmpty(item.PreferredMetadataCountryCode))
} {
if (!string.IsNullOrEmpty(hasLanguage.PreferredMetadataCountryCode)) builder.Append("<CountryCode>" + SecurityElement.Escape(item.PreferredMetadataCountryCode) + "</CountryCode>");
{
builder.Append("<CountryCode>" + SecurityElement.Escape(hasLanguage.PreferredMetadataCountryCode) + "</CountryCode>");
}
} }
// Use original runtime here, actual file runtime later in MediaInfo // Use original runtime here, actual file runtime later in MediaInfo

View File

@ -275,12 +275,6 @@ namespace MediaBrowser.Model.Dto
/// <value>The production year.</value> /// <value>The production year.</value>
public int? ProductionYear { get; set; } public int? ProductionYear { get; set; }
/// <summary>
/// Gets or sets the season count.
/// </summary>
/// <value>The season count.</value>
public int? SeasonCount { get; set; }
/// <summary> /// <summary>
/// Gets or sets the players supported by a game. /// Gets or sets the players supported by a game.
/// </summary> /// </summary>

View File

@ -483,13 +483,7 @@ namespace MediaBrowser.Providers.Manager
} }
} }
var isUnidentified = failedProviderCount > 0 && successfulProviderCount == 0; //var isUnidentified = failedProviderCount > 0 && successfulProviderCount == 0;
if (item.IsUnidentified != isUnidentified)
{
item.IsUnidentified = isUnidentified;
refreshResult.UpdateType = refreshResult.UpdateType | ItemUpdateType.MetadataImport;
}
foreach (var provider in customProviders.Where(i => !(i is IPreRefreshProvider))) foreach (var provider in customProviders.Where(i => !(i is IPreRefreshProvider)))
{ {

View File

@ -227,14 +227,8 @@ namespace MediaBrowser.Providers.Manager
target.DateCreated = source.DateCreated; target.DateCreated = source.DateCreated;
} }
var sourceHasLanguageSettings = source as IHasPreferredMetadataLanguage; target.PreferredMetadataCountryCode = source.PreferredMetadataCountryCode;
var targetHasLanguageSettings = target as IHasPreferredMetadataLanguage; target.PreferredMetadataLanguage = source.PreferredMetadataLanguage;
if (sourceHasLanguageSettings != null && targetHasLanguageSettings != null)
{
targetHasLanguageSettings.PreferredMetadataCountryCode = sourceHasLanguageSettings.PreferredMetadataCountryCode;
targetHasLanguageSettings.PreferredMetadataLanguage = sourceHasLanguageSettings.PreferredMetadataLanguage;
}
var sourceHasDisplayOrder = source as IHasDisplayOrder; var sourceHasDisplayOrder = source as IHasDisplayOrder;
var targetHasDisplayOrder = target as IHasDisplayOrder; var targetHasDisplayOrder = target as IHasDisplayOrder;

View File

@ -62,11 +62,6 @@ namespace MediaBrowser.Providers.TV
var sourceItem = source.Item; var sourceItem = source.Item;
var targetItem = target.Item; var targetItem = target.Item;
if (replaceData || targetItem.SeasonCount == 0)
{
targetItem.SeasonCount = sourceItem.SeasonCount;
}
if (replaceData || string.IsNullOrEmpty(targetItem.AirTime)) if (replaceData || string.IsNullOrEmpty(targetItem.AirTime))
{ {
targetItem.AirTime = sourceItem.AirTime; targetItem.AirTime = sourceItem.AirTime;

View File

@ -68,12 +68,6 @@ namespace MediaBrowser.Providers.TV
var physicalEpisodes = episodes.Where(i => i.LocationType != LocationType.Virtual) var physicalEpisodes = episodes.Where(i => i.LocationType != LocationType.Virtual)
.ToList(); .ToList();
series.SeasonCount = episodes
.Select(i => i.ParentIndexNumber ?? 0)
.Where(i => i != 0)
.Distinct()
.Count();
series.SpecialFeatureIds = physicalEpisodes series.SpecialFeatureIds = physicalEpisodes
.Where(i => i.ParentIndexNumber.HasValue && i.ParentIndexNumber.Value == 0) .Where(i => i.ParentIndexNumber.HasValue && i.ParentIndexNumber.Value == 0)
.Select(i => i.Id) .Select(i => i.Id)

View File

@ -303,7 +303,7 @@ namespace MediaBrowser.Server.Implementations.Channels
try try
{ {
var files = _fileSystem.GetFiles(parentPath); var files = _fileSystem.GetFiles(parentPath);
if (string.Equals(item.MediaType, MediaType.Video, StringComparison.OrdinalIgnoreCase)) if (string.Equals(item.MediaType, MediaType.Video, StringComparison.OrdinalIgnoreCase))
{ {
@ -396,7 +396,7 @@ namespace MediaBrowser.Server.Implementations.Channels
{ {
_logger.Debug("Creating directory {0}", path); _logger.Debug("Creating directory {0}", path);
_fileSystem.CreateDirectory(path); _fileSystem.CreateDirectory(path);
fileInfo = new DirectoryInfo(path); fileInfo = new DirectoryInfo(path);
if (!fileInfo.Exists) if (!fileInfo.Exists)
@ -417,16 +417,22 @@ namespace MediaBrowser.Server.Implementations.Channels
Id = id, Id = id,
DateCreated = _fileSystem.GetCreationTimeUtc(fileInfo), DateCreated = _fileSystem.GetCreationTimeUtc(fileInfo),
DateModified = _fileSystem.GetLastWriteTimeUtc(fileInfo), DateModified = _fileSystem.GetLastWriteTimeUtc(fileInfo),
Path = path Path = path,
ChannelId = channelInfo.Name.GetMD5().ToString("N")
}; };
isNew = true; isNew = true;
} }
var channelId = channelInfo.Name.GetMD5().ToString("N");
if (!string.Equals(item.ChannelId, channelId, StringComparison.OrdinalIgnoreCase))
{
isNew = true;
}
item.OfficialRating = GetOfficialRating(channelInfo.ParentalRating); item.OfficialRating = GetOfficialRating(channelInfo.ParentalRating);
item.Overview = channelInfo.Description; item.Overview = channelInfo.Description;
item.HomePageUrl = channelInfo.HomePageUrl; item.HomePageUrl = channelInfo.HomePageUrl;
item.OriginalChannelName = channelInfo.Name;
if (string.IsNullOrEmpty(item.Name)) if (string.IsNullOrEmpty(item.Name))
{ {
@ -1067,7 +1073,7 @@ namespace MediaBrowser.Server.Implementations.Channels
{ {
try try
{ {
_fileSystem.CreateDirectory(Path.GetDirectoryName(path)); _fileSystem.CreateDirectory(Path.GetDirectoryName(path));
_jsonSerializer.SerializeToFile(result, path); _jsonSerializer.SerializeToFile(result, path);
} }
@ -1296,7 +1302,7 @@ namespace MediaBrowser.Server.Implementations.Channels
internal IChannel GetChannelProvider(Channel channel) internal IChannel GetChannelProvider(Channel channel)
{ {
return GetAllChannels().First(i => string.Equals(i.Name, channel.OriginalChannelName, StringComparison.OrdinalIgnoreCase)); return GetAllChannels().First(i => string.Equals(i.Name.GetMD5().ToString("N"), channel.ChannelId, StringComparison.OrdinalIgnoreCase) || string.Equals(i.Name, channel.Name, StringComparison.OrdinalIgnoreCase));
} }
private IEnumerable<BaseItem> ApplyFilters(IEnumerable<BaseItem> items, IEnumerable<ItemFilter> filters, User user) private IEnumerable<BaseItem> ApplyFilters(IEnumerable<BaseItem> items, IEnumerable<ItemFilter> filters, User user)
@ -1447,7 +1453,7 @@ namespace MediaBrowser.Server.Implementations.Channels
options.RequestHeaders[header.Key] = header.Value; options.RequestHeaders[header.Key] = header.Value;
} }
_fileSystem.CreateDirectory(Path.GetDirectoryName(destination)); _fileSystem.CreateDirectory(Path.GetDirectoryName(destination));
// Determine output extension // Determine output extension
var response = await _httpClient.GetTempFileResponse(options).ConfigureAwait(false); var response = await _httpClient.GetTempFileResponse(options).ConfigureAwait(false);
@ -1485,7 +1491,7 @@ namespace MediaBrowser.Server.Implementations.Channels
throw new ApplicationException("Unexpected response type encountered: " + response.ContentType); throw new ApplicationException("Unexpected response type encountered: " + response.ContentType);
} }
_fileSystem.CopyFile(response.TempFilePath, destination, true); _fileSystem.CopyFile(response.TempFilePath, destination, true);
try try
{ {

View File

@ -1042,13 +1042,8 @@ namespace MediaBrowser.Server.Implementations.Dto
dto.MediaType = item.MediaType; dto.MediaType = item.MediaType;
dto.LocationType = item.LocationType; dto.LocationType = item.LocationType;
var hasLang = item as IHasPreferredMetadataLanguage; dto.PreferredMetadataCountryCode = item.PreferredMetadataCountryCode;
dto.PreferredMetadataLanguage = item.PreferredMetadataLanguage;
if (hasLang != null)
{
dto.PreferredMetadataCountryCode = hasLang.PreferredMetadataCountryCode;
dto.PreferredMetadataLanguage = hasLang.PreferredMetadataLanguage;
}
var hasCriticRating = item as IHasCriticRating; var hasCriticRating = item as IHasCriticRating;
if (hasCriticRating != null) if (hasCriticRating != null)
@ -1427,8 +1422,6 @@ namespace MediaBrowser.Server.Implementations.Dto
dto.AirTime = series.AirTime; dto.AirTime = series.AirTime;
dto.SeriesStatus = series.Status; dto.SeriesStatus = series.Status;
dto.SeasonCount = series.SeasonCount;
if (fields.Contains(ItemFields.Settings)) if (fields.Contains(ItemFields.Settings))
{ {
dto.DisplaySpecialsWithSeasons = series.DisplaySpecialsWithSeasons; dto.DisplaySpecialsWithSeasons = series.DisplaySpecialsWithSeasons;

View File

@ -72,7 +72,7 @@ namespace MediaBrowser.Server.Implementations.Persistence
private IDbCommand _deletePeopleCommand; private IDbCommand _deletePeopleCommand;
private IDbCommand _savePersonCommand; private IDbCommand _savePersonCommand;
private const int LatestSchemaVersion = 10; private const int LatestSchemaVersion = 11;
/// <summary> /// <summary>
/// Initializes a new instance of the <see cref="SqliteItemRepository"/> class. /// Initializes a new instance of the <see cref="SqliteItemRepository"/> class.
@ -184,6 +184,9 @@ namespace MediaBrowser.Server.Implementations.Persistence
_connection.AddColumn(_logger, "TypedBaseItems", "EpisodeTitle", "Text"); _connection.AddColumn(_logger, "TypedBaseItems", "EpisodeTitle", "Text");
_connection.AddColumn(_logger, "TypedBaseItems", "IsRepeat", "BIT"); _connection.AddColumn(_logger, "TypedBaseItems", "IsRepeat", "BIT");
_connection.AddColumn(_logger, "TypedBaseItems", "PreferredMetadataLanguage", "Text");
_connection.AddColumn(_logger, "TypedBaseItems", "PreferredMetadataCountryCode", "Text");
PrepareStatements(); PrepareStatements();
@ -216,7 +219,9 @@ namespace MediaBrowser.Server.Implementations.Persistence
"CommunityRating", "CommunityRating",
"CustomRating", "CustomRating",
"IndexNumber", "IndexNumber",
"IsLocked" "IsLocked",
"PreferredMetadataLanguage",
"PreferredMetadataCountryCode"
}; };
/// <summary> /// <summary>
@ -267,7 +272,9 @@ namespace MediaBrowser.Server.Implementations.Persistence
"DateModified", "DateModified",
"ForcedSortName", "ForcedSortName",
"IsOffline", "IsOffline",
"LocationType" "LocationType",
"PreferredMetadataLanguage",
"PreferredMetadataCountryCode"
}; };
_saveItemCommand = _connection.CreateCommand(); _saveItemCommand = _connection.CreateCommand();
_saveItemCommand.CommandText = "replace into TypedBaseItems (" + string.Join(",", saveColumns.ToArray()) + ") values ("; _saveItemCommand.CommandText = "replace into TypedBaseItems (" + string.Join(",", saveColumns.ToArray()) + ") values (";
@ -451,6 +458,9 @@ namespace MediaBrowser.Server.Implementations.Persistence
_saveItemCommand.GetParameter(index++).Value = item.IsOffline; _saveItemCommand.GetParameter(index++).Value = item.IsOffline;
_saveItemCommand.GetParameter(index++).Value = item.LocationType.ToString(); _saveItemCommand.GetParameter(index++).Value = item.LocationType.ToString();
_saveItemCommand.GetParameter(index++).Value = item.PreferredMetadataLanguage;
_saveItemCommand.GetParameter(index++).Value = item.PreferredMetadataCountryCode;
_saveItemCommand.Transaction = transaction; _saveItemCommand.Transaction = transaction;
_saveItemCommand.ExecuteNonQuery(); _saveItemCommand.ExecuteNonQuery();
@ -647,6 +657,16 @@ namespace MediaBrowser.Server.Implementations.Persistence
item.IsLocked = reader.GetBoolean(18); item.IsLocked = reader.GetBoolean(18);
} }
if (!reader.IsDBNull(19))
{
item.PreferredMetadataLanguage = reader.GetString(19);
}
if (!reader.IsDBNull(20))
{
item.PreferredMetadataCountryCode = reader.GetString(20);
}
return item; return item;
} }

View File

@ -394,11 +394,7 @@ namespace MediaBrowser.XbmcMetadata.Parsers
{ {
var val = reader.ReadElementContentAsString(); var val = reader.ReadElementContentAsString();
var hasLanguage = item as IHasPreferredMetadataLanguage; item.PreferredMetadataLanguage = val;
if (hasLanguage != null)
{
hasLanguage.PreferredMetadataLanguage = val;
}
break; break;
} }
@ -407,11 +403,7 @@ namespace MediaBrowser.XbmcMetadata.Parsers
{ {
var val = reader.ReadElementContentAsString(); var val = reader.ReadElementContentAsString();
var hasLanguage = item as IHasPreferredMetadataLanguage; item.PreferredMetadataCountryCode = val;
if (hasLanguage != null)
{
hasLanguage.PreferredMetadataCountryCode = val;
}
break; break;
} }

View File

@ -599,17 +599,13 @@ namespace MediaBrowser.XbmcMetadata.Savers
writer.WriteElementString("tvcomid", tvcom); writer.WriteElementString("tvcomid", tvcom);
} }
var hasLanguage = item as IHasPreferredMetadataLanguage; if (!string.IsNullOrEmpty(item.PreferredMetadataLanguage))
if (hasLanguage != null)
{ {
if (!string.IsNullOrEmpty(hasLanguage.PreferredMetadataLanguage)) writer.WriteElementString("language", item.PreferredMetadataLanguage);
{ }
writer.WriteElementString("language", hasLanguage.PreferredMetadataLanguage); if (!string.IsNullOrEmpty(item.PreferredMetadataCountryCode))
} {
if (!string.IsNullOrEmpty(hasLanguage.PreferredMetadataCountryCode)) writer.WriteElementString("countrycode", item.PreferredMetadataCountryCode);
{
writer.WriteElementString("countrycode", hasLanguage.PreferredMetadataCountryCode);
}
} }
if (item.PremiereDate.HasValue && !(item is Episode)) if (item.PremiereDate.HasValue && !(item is Episode))