use new naming project

This commit is contained in:
Luke Pulverenti
2014-11-17 21:48:22 -05:00
parent 049ef9b4ec
commit 124754a04f
25 changed files with 167 additions and 149 deletions

View File

@@ -472,6 +472,7 @@ namespace MediaBrowser.Controller.Entities
}
else
{
newItems.Add(child);
validChildren.Add(child);
}
}

View File

@@ -61,7 +61,6 @@ namespace MediaBrowser.Controller.Entities
{
var standaloneTypes = new List<string>
{
CollectionType.AdultVideos,
CollectionType.Books,
CollectionType.HomeVideos,
CollectionType.Photos,

View File

@@ -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 =>
{

View File

@@ -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&lt;System.String&gt;.</returns>
IEnumerable<FileSystemInfo> GetAdditionalParts(string file,
VideoType type,
IEnumerable<FileSystemInfo> files);
}
}

View File

@@ -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);
}
}
}