diff options
| author | Luke Pulverenti <luke.pulverenti@gmail.com> | 2014-11-17 21:48:22 -0500 |
|---|---|---|
| committer | Luke Pulverenti <luke.pulverenti@gmail.com> | 2014-11-17 21:48:22 -0500 |
| commit | 124754a04f1a85fc949e229e45bfd67e5ac6ff62 (patch) | |
| tree | c5bad076801d85ae7eef9de7041efe407dacbd92 /MediaBrowser.Controller | |
| parent | 049ef9b4ecd2c884e0ddb062b606770ef7f2dfa9 (diff) | |
use new naming project
Diffstat (limited to 'MediaBrowser.Controller')
| -rw-r--r-- | MediaBrowser.Controller/Entities/Folder.cs | 1 | ||||
| -rw-r--r-- | MediaBrowser.Controller/Entities/UserView.cs | 1 | ||||
| -rw-r--r-- | MediaBrowser.Controller/Entities/Video.cs | 29 | ||||
| -rw-r--r-- | MediaBrowser.Controller/Library/ILibraryManager.cs | 25 | ||||
| -rw-r--r-- | MediaBrowser.Controller/Providers/DirectoryService.cs | 6 |
5 files changed, 19 insertions, 43 deletions
diff --git a/MediaBrowser.Controller/Entities/Folder.cs b/MediaBrowser.Controller/Entities/Folder.cs index d0f2e9dfa..34f52aac5 100644 --- a/MediaBrowser.Controller/Entities/Folder.cs +++ b/MediaBrowser.Controller/Entities/Folder.cs @@ -472,6 +472,7 @@ namespace MediaBrowser.Controller.Entities } else { + newItems.Add(child); validChildren.Add(child); } } diff --git a/MediaBrowser.Controller/Entities/UserView.cs b/MediaBrowser.Controller/Entities/UserView.cs index 4b29f49d8..7674dc1d3 100644 --- a/MediaBrowser.Controller/Entities/UserView.cs +++ b/MediaBrowser.Controller/Entities/UserView.cs @@ -61,7 +61,6 @@ namespace MediaBrowser.Controller.Entities { var standaloneTypes = new List<string> { - CollectionType.AdultVideos, CollectionType.Books, CollectionType.HomeVideos, CollectionType.Photos, diff --git a/MediaBrowser.Controller/Entities/Video.cs b/MediaBrowser.Controller/Entities/Video.cs index f2484aab8..1c59b8bfb 100644 --- a/MediaBrowser.Controller/Entities/Video.cs +++ b/MediaBrowser.Controller/Entities/Video.cs @@ -337,34 +337,7 @@ namespace MediaBrowser.Controller.Entities /// <returns>IEnumerable{Video}.</returns> private IEnumerable<Video> LoadAdditionalParts(IEnumerable<FileSystemInfo> fileSystemChildren, IDirectoryService directoryService) { - IEnumerable<FileSystemInfo> files; - - var path = Path; - - if (VideoType == VideoType.BluRay || VideoType == VideoType.Dvd) - { - files = fileSystemChildren.Where(i => - { - if ((i.Attributes & FileAttributes.Directory) == FileAttributes.Directory) - { - return !string.Equals(i.FullName, path, StringComparison.OrdinalIgnoreCase) && LibraryManager.IsMultiPartFolder(i.FullName); - } - - return false; - }); - } - else - { - files = fileSystemChildren.Where(i => - { - if ((i.Attributes & FileAttributes.Directory) == FileAttributes.Directory) - { - return false; - } - - return !string.Equals(i.FullName, path, StringComparison.OrdinalIgnoreCase) && LibraryManager.IsVideoFile(i.FullName) && LibraryManager.IsMultiPartFile(i.Name); - }); - } + var files = LibraryManager.GetAdditionalParts(Path, VideoType, fileSystemChildren); return LibraryManager.ResolvePaths<Video>(files, directoryService, null).Select(video => { diff --git a/MediaBrowser.Controller/Library/ILibraryManager.cs b/MediaBrowser.Controller/Library/ILibraryManager.cs index 615ddd90f..3367f98e4 100644 --- a/MediaBrowser.Controller/Library/ILibraryManager.cs +++ b/MediaBrowser.Controller/Library/ILibraryManager.cs @@ -367,20 +367,6 @@ namespace MediaBrowser.Controller.Library /// <param name="path">The path.</param> /// <returns><c>true</c> if [is audio file] [the specified path]; otherwise, <c>false</c>.</returns> bool IsAudioFile(string path); - - /// <summary> - /// Determines whether [is multi part file] [the specified path]. - /// </summary> - /// <param name="path">The path.</param> - /// <returns><c>true</c> if [is multi part file] [the specified path]; otherwise, <c>false</c>.</returns> - bool IsMultiPartFile(string path); - - /// <summary> - /// Determines whether [is multi part folder] [the specified path]. - /// </summary> - /// <param name="path">The path.</param> - /// <returns><c>true</c> if [is multi part folder] [the specified path]; otherwise, <c>false</c>.</returns> - bool IsMultiPartFolder(string path); /// <summary> /// Gets the season number from path. @@ -417,5 +403,16 @@ namespace MediaBrowser.Controller.Library /// <param name="name">The name.</param> /// <returns>ItemInfo.</returns> ItemLookupInfo ParseName(string name); + + /// <summary> + /// Gets the additional parts. + /// </summary> + /// <param name="file">The file.</param> + /// <param name="type">The type.</param> + /// <param name="files">The files.</param> + /// <returns>IEnumerable<System.String>.</returns> + IEnumerable<FileSystemInfo> GetAdditionalParts(string file, + VideoType type, + IEnumerable<FileSystemInfo> files); } }
\ No newline at end of file diff --git a/MediaBrowser.Controller/Providers/DirectoryService.cs b/MediaBrowser.Controller/Providers/DirectoryService.cs index 4fdc08da0..74a9c6606 100644 --- a/MediaBrowser.Controller/Providers/DirectoryService.cs +++ b/MediaBrowser.Controller/Providers/DirectoryService.cs @@ -11,6 +11,7 @@ namespace MediaBrowser.Controller.Providers { IEnumerable<FileSystemInfo> GetFileSystemEntries(string path); IEnumerable<FileSystemInfo> GetFiles(string path); + IEnumerable<FileSystemInfo> GetDirectories(string path); IEnumerable<FileSystemInfo> GetFiles(string path, bool clearCache); FileSystemInfo GetFile(string path); Dictionary<string, FileSystemInfo> GetFileSystemDictionary(string path); @@ -109,5 +110,10 @@ namespace MediaBrowser.Controller.Providers return entry; } + + public IEnumerable<FileSystemInfo> GetDirectories(string path) + { + return GetFileSystemEntries(path, false).Where(i => (i.Attributes & FileAttributes.Directory) == FileAttributes.Directory); + } } } |
