factor all files into file system stamp
This commit is contained in:
parent
2c0010850f
commit
e5b383e477
|
@ -269,17 +269,29 @@ namespace MediaBrowser.Controller.Entities
|
||||||
private Guid GetFileSystemStamp()
|
private Guid GetFileSystemStamp()
|
||||||
{
|
{
|
||||||
// If there's no path or the item is a file, there's nothing to do
|
// If there's no path or the item is a file, there's nothing to do
|
||||||
if (LocationType != LocationType.FileSystem || !ResolveArgs.IsDirectory)
|
if (LocationType != LocationType.FileSystem)
|
||||||
{
|
{
|
||||||
return Guid.Empty;
|
return Guid.Empty;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
try
|
||||||
|
{
|
||||||
|
if (!ResolveArgs.IsDirectory)
|
||||||
|
{
|
||||||
|
return Guid.Empty;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
catch (IOException ex)
|
||||||
|
{
|
||||||
|
Logger.ErrorException("Error determining if path is directory: {0}", ex, ResolveArgs.Path);
|
||||||
|
throw;
|
||||||
|
}
|
||||||
|
|
||||||
var sb = new StringBuilder();
|
var sb = new StringBuilder();
|
||||||
|
|
||||||
// Record the name of each file
|
// Record the name of each file
|
||||||
// Need to sort these because accoring to msdn docs, our i/o methods are not guaranteed in any order
|
// Need to sort these because accoring to msdn docs, our i/o methods are not guaranteed in any order
|
||||||
foreach (var file in ResolveArgs.FileSystemChildren
|
foreach (var file in ResolveArgs.FileSystemChildren
|
||||||
.Where(i => (i.Attributes & FileAttributes.System) != FileAttributes.System)
|
|
||||||
.OrderBy(f => f.Name))
|
.OrderBy(f => f.Name))
|
||||||
{
|
{
|
||||||
sb.Append(file.Name);
|
sb.Append(file.Name);
|
||||||
|
@ -491,48 +503,6 @@ namespace MediaBrowser.Controller.Entities
|
||||||
[IgnoreDataMember]
|
[IgnoreDataMember]
|
||||||
public Folder Parent { get; set; }
|
public Folder Parent { get; set; }
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// Gets the collection folder parent.
|
|
||||||
/// </summary>
|
|
||||||
/// <value>The collection folder parent.</value>
|
|
||||||
[IgnoreDataMember]
|
|
||||||
public Folder CollectionFolder
|
|
||||||
{
|
|
||||||
get
|
|
||||||
{
|
|
||||||
if (this is AggregateFolder)
|
|
||||||
{
|
|
||||||
return null;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (IsFolder)
|
|
||||||
{
|
|
||||||
var iCollectionFolder = this as ICollectionFolder;
|
|
||||||
|
|
||||||
if (iCollectionFolder != null)
|
|
||||||
{
|
|
||||||
return (Folder)this;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
var parent = Parent;
|
|
||||||
|
|
||||||
while (parent != null)
|
|
||||||
{
|
|
||||||
var iCollectionFolder = parent as ICollectionFolder;
|
|
||||||
|
|
||||||
if (iCollectionFolder != null)
|
|
||||||
{
|
|
||||||
return parent;
|
|
||||||
}
|
|
||||||
|
|
||||||
parent = parent.Parent;
|
|
||||||
}
|
|
||||||
|
|
||||||
return null;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// When the item first debuted. For movies this could be premiere date, episodes would be first aired
|
/// When the item first debuted. For movies this could be premiere date, episodes would be first aired
|
||||||
/// </summary>
|
/// </summary>
|
||||||
|
|
Loading…
Reference in New Issue
Block a user