finish removing ChannelFolderItem

This commit is contained in:
Luke Pulverenti
2016-03-19 01:04:38 -04:00
parent cbac67b5ae
commit 7b93b7a33c
17 changed files with 184 additions and 105 deletions

View File

@@ -170,7 +170,7 @@ namespace MediaBrowser.Controller.Entities
public bool IsOffline { get; set; }
[IgnoreDataMember]
public SourceType SourceType { get; set; }
public virtual SourceType SourceType { get; set; }
/// <summary>
/// Returns the folder containing the item.
@@ -258,6 +258,11 @@ namespace MediaBrowser.Controller.Entities
{
get
{
if (SourceType == SourceType.Channel)
{
return false;
}
var locationType = LocationType;
return locationType != LocationType.Remote && locationType != LocationType.Virtual;
@@ -304,6 +309,11 @@ namespace MediaBrowser.Controller.Entities
public virtual bool CanDelete()
{
if (SourceType == SourceType.Channel)
{
return false;
}
var locationType = LocationType;
return locationType != LocationType.Remote &&
locationType != LocationType.Virtual;
@@ -463,6 +473,11 @@ namespace MediaBrowser.Controller.Entities
protected virtual string GetInternalMetadataPath(string basePath)
{
if (SourceType == SourceType.Channel)
{
return System.IO.Path.Combine(basePath, "channels", ChannelId, Id.ToString("N"));
}
var idString = Id.ToString("N");
basePath = System.IO.Path.Combine(basePath, "library");
@@ -1035,6 +1050,13 @@ namespace MediaBrowser.Controller.Entities
protected virtual string CreateUserDataKey()
{
if (SourceType == SourceType.Channel)
{
if (!string.IsNullOrWhiteSpace(ExternalId))
{
return ExternalId;
}
}
return Id.ToString();
}
@@ -1113,6 +1135,11 @@ namespace MediaBrowser.Controller.Entities
public virtual bool IsSaveLocalMetadataEnabled()
{
if (SourceType == SourceType.Channel)
{
return false;
}
return ConfigurationManager.Configuration.SaveLocalMeta;
}
@@ -1228,6 +1255,11 @@ namespace MediaBrowser.Controller.Entities
public virtual UnratedItem GetBlockUnratedType()
{
if (SourceType == SourceType.Channel)
{
return UnratedItem.ChannelContent;
}
return UnratedItem.Other;
}
@@ -1271,6 +1303,11 @@ namespace MediaBrowser.Controller.Entities
public virtual bool IsVisibleStandalone(User user)
{
if (SourceType == SourceType.Channel)
{
return IsVisibleStandaloneInternal(user, false) && ChannelVideoItem.IsChannelVisible(this, user);
}
return IsVisibleStandaloneInternal(user, true);
}