Merge pull request #2787 from MediaBrowser/dev

update themes
release-10.1.0
Luke 8 years ago committed by GitHub
commit 923dd52444

@ -2593,7 +2593,7 @@ namespace Emby.Server.Implementations.Library
{ {
var namingOptions = GetNamingOptions(); var namingOptions = GetNamingOptions();
var files = owner.DetectIsInMixedFolder() ? new List<FileSystemMetadata>() : fileSystemChildren.Where(i => i.IsDirectory) var files = owner.IsInMixedFolder ? new List<FileSystemMetadata>() : fileSystemChildren.Where(i => i.IsDirectory)
.Where(i => string.Equals(i.Name, BaseItem.TrailerFolderName, StringComparison.OrdinalIgnoreCase)) .Where(i => string.Equals(i.Name, BaseItem.TrailerFolderName, StringComparison.OrdinalIgnoreCase))
.SelectMany(i => _fileSystem.GetFiles(i.FullName, _videoFileExtensions, false, false)) .SelectMany(i => _fileSystem.GetFiles(i.FullName, _videoFileExtensions, false, false))
.ToList(); .ToList();

@ -128,12 +128,6 @@ namespace MediaBrowser.Controller.Entities
[IgnoreDataMember] [IgnoreDataMember]
public bool IsInMixedFolder { get; set; } public bool IsInMixedFolder { get; set; }
[IgnoreDataMember]
protected virtual bool SupportsIsInMixedFolderDetection
{
get { return false; }
}
[IgnoreDataMember] [IgnoreDataMember]
public virtual bool SupportsPlayedStatus public virtual bool SupportsPlayedStatus
{ {
@ -152,16 +146,6 @@ namespace MediaBrowser.Controller.Entities
} }
} }
public bool DetectIsInMixedFolder()
{
if (SupportsIsInMixedFolderDetection)
{
}
return IsInMixedFolder;
}
[IgnoreDataMember] [IgnoreDataMember]
public virtual bool SupportsRemoteImageDownloading public virtual bool SupportsRemoteImageDownloading
{ {
@ -1156,7 +1140,7 @@ namespace MediaBrowser.Controller.Entities
{ {
if (SupportsThemeMedia) if (SupportsThemeMedia)
{ {
if (!DetectIsInMixedFolder()) if (!IsInMixedFolder)
{ {
themeSongsChanged = await RefreshThemeSongs(this, options, fileSystemChildren, cancellationToken).ConfigureAwait(false); themeSongsChanged = await RefreshThemeSongs(this, options, fileSystemChildren, cancellationToken).ConfigureAwait(false);
@ -1311,12 +1295,9 @@ namespace MediaBrowser.Controller.Entities
{ {
var current = this; var current = this;
if (!SupportsIsInMixedFolderDetection) if (current.IsInMixedFolder != newItem.IsInMixedFolder)
{ {
if (current.IsInMixedFolder != newItem.IsInMixedFolder) return false;
{
return false;
}
} }
return true; return true;

@ -100,7 +100,7 @@ namespace MediaBrowser.Controller.Entities
public override IEnumerable<FileSystemMetadata> GetDeletePaths() public override IEnumerable<FileSystemMetadata> GetDeletePaths()
{ {
if (!DetectIsInMixedFolder()) if (!IsInMixedFolder)
{ {
return new[] { return new[] {
new FileSystemMetadata new FileSystemMetadata

@ -152,7 +152,7 @@ namespace MediaBrowser.Controller.Entities
/// <value><c>true</c> if [supports local metadata]; otherwise, <c>false</c>.</value> /// <value><c>true</c> if [supports local metadata]; otherwise, <c>false</c>.</value>
bool SupportsLocalMetadata { get; } bool SupportsLocalMetadata { get; }
bool DetectIsInMixedFolder(); bool IsInMixedFolder { get; }
/// <summary> /// <summary>
/// Gets a value indicating whether this instance is locked. /// Gets a value indicating whether this instance is locked.

@ -55,22 +55,13 @@ namespace MediaBrowser.Controller.Entities.Movies
return value; return value;
} }
[IgnoreDataMember]
protected override bool SupportsIsInMixedFolderDetection
{
get
{
return false;
}
}
protected override async Task<bool> RefreshedOwnedItems(MetadataRefreshOptions options, List<FileSystemMetadata> fileSystemChildren, CancellationToken cancellationToken) protected override async Task<bool> RefreshedOwnedItems(MetadataRefreshOptions options, List<FileSystemMetadata> fileSystemChildren, CancellationToken cancellationToken)
{ {
var hasChanges = await base.RefreshedOwnedItems(options, fileSystemChildren, cancellationToken).ConfigureAwait(false); var hasChanges = await base.RefreshedOwnedItems(options, fileSystemChildren, cancellationToken).ConfigureAwait(false);
// Must have a parent to have special features // Must have a parent to have special features
// In other words, it must be part of the Parent/Child tree // In other words, it must be part of the Parent/Child tree
if (LocationType == LocationType.FileSystem && GetParent() != null && !DetectIsInMixedFolder()) if (LocationType == LocationType.FileSystem && GetParent() != null && !IsInMixedFolder)
{ {
var specialFeaturesChanged = await RefreshSpecialFeatures(options, fileSystemChildren, cancellationToken).ConfigureAwait(false); var specialFeaturesChanged = await RefreshSpecialFeatures(options, fileSystemChildren, cancellationToken).ConfigureAwait(false);
@ -108,7 +99,7 @@ namespace MediaBrowser.Controller.Entities.Movies
{ {
var info = GetItemLookupInfo<MovieInfo>(); var info = GetItemLookupInfo<MovieInfo>();
if (!DetectIsInMixedFolder()) if (!IsInMixedFolder)
{ {
var name = System.IO.Path.GetFileName(ContainingFolderPath); var name = System.IO.Path.GetFileName(ContainingFolderPath);
@ -145,7 +136,7 @@ namespace MediaBrowser.Controller.Entities.Movies
else else
{ {
// Try to get the year from the folder name // Try to get the year from the folder name
if (!DetectIsInMixedFolder()) if (!IsInMixedFolder)
{ {
info = LibraryManager.ParseName(System.IO.Path.GetFileName(ContainingFolderPath)); info = LibraryManager.ParseName(System.IO.Path.GetFileName(ContainingFolderPath));

@ -24,15 +24,6 @@ namespace MediaBrowser.Controller.Entities
} }
} }
[IgnoreDataMember]
protected override bool SupportsIsInMixedFolderDetection
{
get
{
return false;
}
}
public override UnratedItem GetBlockUnratedType() public override UnratedItem GetBlockUnratedType()
{ {
return UnratedItem.Music; return UnratedItem.Music;
@ -61,7 +52,7 @@ namespace MediaBrowser.Controller.Entities
else else
{ {
// Try to get the year from the folder name // Try to get the year from the folder name
if (!DetectIsInMixedFolder()) if (!IsInMixedFolder)
{ {
info = LibraryManager.ParseName(System.IO.Path.GetFileName(ContainingFolderPath)); info = LibraryManager.ParseName(System.IO.Path.GetFileName(ContainingFolderPath));

@ -47,7 +47,7 @@ namespace MediaBrowser.Controller.Entities
info.IsLocalTrailer = TrailerTypes.Contains(TrailerType.LocalTrailer); info.IsLocalTrailer = TrailerTypes.Contains(TrailerType.LocalTrailer);
if (!DetectIsInMixedFolder() && LocationType == LocationType.FileSystem) if (!IsInMixedFolder && LocationType == LocationType.FileSystem)
{ {
info.Name = System.IO.Path.GetFileName(ContainingFolderPath); info.Name = System.IO.Path.GetFileName(ContainingFolderPath);
} }
@ -73,7 +73,7 @@ namespace MediaBrowser.Controller.Entities
else else
{ {
// Try to get the year from the folder name // Try to get the year from the folder name
if (!DetectIsInMixedFolder()) if (!IsInMixedFolder)
{ {
info = LibraryManager.ParseName(System.IO.Path.GetFileName(ContainingFolderPath)); info = LibraryManager.ParseName(System.IO.Path.GetFileName(ContainingFolderPath));

@ -77,15 +77,6 @@ namespace MediaBrowser.Controller.Entities
} }
} }
[IgnoreDataMember]
protected override bool SupportsIsInMixedFolderDetection
{
get
{
return true;
}
}
public override string CreatePresentationUniqueKey() public override string CreatePresentationUniqueKey()
{ {
if (!string.IsNullOrWhiteSpace(PrimaryVersionId)) if (!string.IsNullOrWhiteSpace(PrimaryVersionId))
@ -500,7 +491,7 @@ namespace MediaBrowser.Controller.Entities
public override IEnumerable<FileSystemMetadata> GetDeletePaths() public override IEnumerable<FileSystemMetadata> GetDeletePaths()
{ {
if (!DetectIsInMixedFolder()) if (!IsInMixedFolder)
{ {
return new[] { return new[] {
new FileSystemMetadata new FileSystemMetadata

@ -53,15 +53,6 @@ namespace MediaBrowser.Controller.LiveTv
} }
} }
[IgnoreDataMember]
protected override bool SupportsIsInMixedFolderDetection
{
get
{
return false;
}
}
[IgnoreDataMember] [IgnoreDataMember]
public override bool SupportsPlayedStatus public override bool SupportsPlayedStatus
{ {

@ -10,7 +10,7 @@ namespace MediaBrowser.Controller.Providers
{ {
Path = item.Path; Path = item.Path;
ContainingFolderPath = item.ContainingFolderPath; ContainingFolderPath = item.ContainingFolderPath;
IsInMixedFolder = item.DetectIsInMixedFolder(); IsInMixedFolder = item.IsInMixedFolder;
var video = item as Video; var video = item as Video;
if (video != null) if (video != null)

@ -144,7 +144,7 @@ namespace MediaBrowser.LocalMetadata.Images
} }
var imagePrefix = item.FileNameWithoutExtension + "-"; var imagePrefix = item.FileNameWithoutExtension + "-";
var isInMixedFolder = item.DetectIsInMixedFolder(); var isInMixedFolder = item.IsInMixedFolder;
PopulatePrimaryImages(item, images, files, imagePrefix, isInMixedFolder); PopulatePrimaryImages(item, images, files, imagePrefix, isInMixedFolder);

@ -65,7 +65,7 @@ namespace MediaBrowser.LocalMetadata.Savers
public static string GetGameSavePath(Game item) public static string GetGameSavePath(Game item)
{ {
if (item.DetectIsInMixedFolder()) if (item.IsInMixedFolder)
{ {
return Path.ChangeExtension(item.Path, ".xml"); return Path.ChangeExtension(item.Path, ".xml");
} }

@ -355,7 +355,7 @@ namespace MediaBrowser.Providers.Manager
return Path.Combine(seriesFolder, imageFilename); return Path.Combine(seriesFolder, imageFilename);
} }
if (item.DetectIsInMixedFolder()) if (item.IsInMixedFolder)
{ {
return GetSavePathForItemInMixedFolder(item, type, "landscape", extension); return GetSavePathForItemInMixedFolder(item, type, "landscape", extension);
} }
@ -432,7 +432,7 @@ namespace MediaBrowser.Providers.Manager
path = Path.Combine(_fileSystem.GetDirectoryName(item.Path), "metadata", filename + extension); path = Path.Combine(_fileSystem.GetDirectoryName(item.Path), "metadata", filename + extension);
} }
else if (item.DetectIsInMixedFolder()) else if (item.IsInMixedFolder)
{ {
path = GetSavePathForItemInMixedFolder(item, type, filename, extension); path = GetSavePathForItemInMixedFolder(item, type, filename, extension);
} }
@ -499,7 +499,7 @@ namespace MediaBrowser.Providers.Manager
if (imageIndex.Value == 0) if (imageIndex.Value == 0)
{ {
if (item.DetectIsInMixedFolder()) if (item.IsInMixedFolder)
{ {
return new[] { GetSavePathForItemInMixedFolder(item, type, "fanart", extension) }; return new[] { GetSavePathForItemInMixedFolder(item, type, "fanart", extension) };
} }
@ -525,7 +525,7 @@ namespace MediaBrowser.Providers.Manager
var outputIndex = imageIndex.Value; var outputIndex = imageIndex.Value;
if (item.DetectIsInMixedFolder()) if (item.IsInMixedFolder)
{ {
return new[] { GetSavePathForItemInMixedFolder(item, type, "fanart" + outputIndex.ToString(UsCulture), extension) }; return new[] { GetSavePathForItemInMixedFolder(item, type, "fanart" + outputIndex.ToString(UsCulture), extension) };
} }
@ -568,7 +568,7 @@ namespace MediaBrowser.Providers.Manager
return new[] { Path.Combine(seasonFolder, imageFilename) }; return new[] { Path.Combine(seasonFolder, imageFilename) };
} }
if (item.DetectIsInMixedFolder() || item is MusicVideo) if (item.IsInMixedFolder || item is MusicVideo)
{ {
return new[] { GetSavePathForItemInMixedFolder(item, type, string.Empty, extension) }; return new[] { GetSavePathForItemInMixedFolder(item, type, string.Empty, extension) };
} }

@ -1,3 +1,3 @@
using System.Reflection; using System.Reflection;
[assembly: AssemblyVersion("3.2.26.8")] [assembly: AssemblyVersion("3.2.26.9")]

Loading…
Cancel
Save