diff options
Diffstat (limited to 'MediaBrowser.Controller/Library')
6 files changed, 2 insertions, 155 deletions
diff --git a/MediaBrowser.Controller/Library/EntityResolutionHelper.cs b/MediaBrowser.Controller/Library/EntityResolutionHelper.cs deleted file mode 100644 index 07e0b5a11..000000000 --- a/MediaBrowser.Controller/Library/EntityResolutionHelper.cs +++ /dev/null @@ -1,97 +0,0 @@ -using MediaBrowser.Controller.Entities; -using MediaBrowser.Controller.IO; -using System; -using System.Collections.Generic; -using System.IO; -using System.Linq; - -namespace MediaBrowser.Controller.Library -{ - /// <summary> - /// Class EntityResolutionHelper - /// </summary> - public static class EntityResolutionHelper - { - /// <summary> - /// Any extension in this list is considered a video file - can be added to at runtime for extensibility - /// </summary> - public static List<string> VideoFileExtensions = new List<string> - { - ".mkv", - ".m2t", - ".m2ts", - ".img", - ".iso", - ".ts", - ".rmvb", - ".mov", - ".avi", - ".mpg", - ".mpeg", - ".wmv", - ".mp4", - ".divx", - ".dvr-ms", - ".wtv", - ".ogm", - ".ogv", - ".asf", - ".m4v", - ".flv", - ".f4v", - ".3gp", - ".webm" - }; - - /// <summary> - /// Determines whether [is video file] [the specified path]. - /// </summary> - /// <param name="path">The path.</param> - /// <returns><c>true</c> if [is video file] [the specified path]; otherwise, <c>false</c>.</returns> - public static bool IsVideoFile(string path) - { - var extension = Path.GetExtension(path) ?? string.Empty; - return VideoFileExtensions.Contains(extension, StringComparer.OrdinalIgnoreCase); - } - - /// <summary> - /// Ensures DateCreated and DateModified have values - /// </summary> - /// <param name="item">The item.</param> - /// <param name="args">The args.</param> - public static void EnsureDates(BaseItem item, ItemResolveArgs args) - { - if (!Path.IsPathRooted(item.Path)) - { - return; - } - - // See if a different path came out of the resolver than what went in - if (!args.Path.Equals(item.Path, StringComparison.OrdinalIgnoreCase)) - { - var childData = args.IsDirectory ? args.GetFileSystemEntryByPath(item.Path) : null; - - if (childData.HasValue) - { - item.DateCreated = childData.Value.CreationTimeUtc; - item.DateModified = childData.Value.LastWriteTimeUtc; - } - else - { - var fileData = FileSystem.GetFileData(item.Path); - - if (fileData.HasValue) - { - item.DateCreated = fileData.Value.CreationTimeUtc; - item.DateModified = fileData.Value.LastWriteTimeUtc; - } - } - } - else - { - item.DateCreated = args.FileInfo.CreationTimeUtc; - item.DateModified = args.FileInfo.LastWriteTimeUtc; - } - } - } -} diff --git a/MediaBrowser.Controller/Library/IItemResolver.cs b/MediaBrowser.Controller/Library/IItemResolver.cs deleted file mode 100644 index 721b787d3..000000000 --- a/MediaBrowser.Controller/Library/IItemResolver.cs +++ /dev/null @@ -1,22 +0,0 @@ -using MediaBrowser.Controller.Entities; - -namespace MediaBrowser.Controller.Library -{ - /// <summary> - /// Interface IItemResolver - /// </summary> - public interface IItemResolver - { - /// <summary> - /// Resolves the path. - /// </summary> - /// <param name="args">The args.</param> - /// <returns>BaseItem.</returns> - BaseItem ResolvePath(ItemResolveArgs args); - /// <summary> - /// Gets the priority. - /// </summary> - /// <value>The priority.</value> - ResolverPriority Priority { get; } - } -} diff --git a/MediaBrowser.Controller/Library/ILibraryManager.cs b/MediaBrowser.Controller/Library/ILibraryManager.cs index 7ba60e921..3f1930209 100644 --- a/MediaBrowser.Controller/Library/ILibraryManager.cs +++ b/MediaBrowser.Controller/Library/ILibraryManager.cs @@ -1,5 +1,6 @@ using MediaBrowser.Controller.Entities; using MediaBrowser.Controller.IO; +using MediaBrowser.Controller.Resolvers; using MediaBrowser.Model.Entities; using System; using System.Collections.Generic; diff --git a/MediaBrowser.Controller/Library/IResolverIgnoreRule.cs b/MediaBrowser.Controller/Library/IResolverIgnoreRule.cs deleted file mode 100644 index c9c602089..000000000 --- a/MediaBrowser.Controller/Library/IResolverIgnoreRule.cs +++ /dev/null @@ -1,10 +0,0 @@ -namespace MediaBrowser.Controller.Library -{ - /// <summary> - /// Provides a base "rule" that anyone can use to have paths ignored by the resolver - /// </summary> - public interface IResolverIgnoreRule - { - bool ShouldIgnore(ItemResolveArgs args); - } -} diff --git a/MediaBrowser.Controller/Library/ResolverPriority.cs b/MediaBrowser.Controller/Library/ResolverPriority.cs deleted file mode 100644 index 1f266f371..000000000 --- a/MediaBrowser.Controller/Library/ResolverPriority.cs +++ /dev/null @@ -1,26 +0,0 @@ - -namespace MediaBrowser.Controller.Library -{ - /// <summary> - /// Enum ResolverPriority - /// </summary> - public enum ResolverPriority - { - /// <summary> - /// The first - /// </summary> - First = 1, - /// <summary> - /// The second - /// </summary> - Second = 2, - /// <summary> - /// The third - /// </summary> - Third = 3, - /// <summary> - /// The last - /// </summary> - Last = 4 - } -} diff --git a/MediaBrowser.Controller/Library/TVUtils.cs b/MediaBrowser.Controller/Library/TVUtils.cs index e0ef188b8..d6a922ff4 100644 --- a/MediaBrowser.Controller/Library/TVUtils.cs +++ b/MediaBrowser.Controller/Library/TVUtils.cs @@ -3,6 +3,7 @@ using System; using System.Collections.Generic; using System.Linq; using System.Text.RegularExpressions; +using MediaBrowser.Controller.Resolvers; namespace MediaBrowser.Controller.Library { |
