aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLuke Pulverenti <luke.pulverenti@gmail.com>2013-06-13 16:16:05 -0400
committerLuke Pulverenti <luke.pulverenti@gmail.com>2013-06-13 16:16:05 -0400
commite5b383e47746248ed5c9d12afb365c2ea48905b4 (patch)
tree8197247279572f087cf4733d37a0e8b7b2f3a521
parent2c0010850fbc77354b64244b81e74d1cbe8462a4 (diff)
factor all files into file system stamp
-rw-r--r--MediaBrowser.Controller/Entities/BaseItem.cs58
1 files changed, 14 insertions, 44 deletions
diff --git a/MediaBrowser.Controller/Entities/BaseItem.cs b/MediaBrowser.Controller/Entities/BaseItem.cs
index 264f66945..4c5575ae3 100644
--- a/MediaBrowser.Controller/Entities/BaseItem.cs
+++ b/MediaBrowser.Controller/Entities/BaseItem.cs
@@ -269,17 +269,29 @@ namespace MediaBrowser.Controller.Entities
private Guid GetFileSystemStamp()
{
// 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;
}
+
+ 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();
// 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
foreach (var file in ResolveArgs.FileSystemChildren
- .Where(i => (i.Attributes & FileAttributes.System) != FileAttributes.System)
.OrderBy(f => f.Name))
{
sb.Append(file.Name);
@@ -492,48 +504,6 @@ namespace MediaBrowser.Controller.Entities
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>
/// When the item first debuted. For movies this could be premiere date, episodes would be first aired
/// </summary>
/// <value>The premiere date.</value>