diff options
| author | ebr11 Eric Reed spam <ebr11 Eric Reed spam@reedsplace.com> | 2012-09-17 16:24:01 -0400 |
|---|---|---|
| committer | ebr11 Eric Reed spam <ebr11 Eric Reed spam@reedsplace.com> | 2012-09-17 16:24:01 -0400 |
| commit | f385fe2f201c6727b04acb4b8b57f2b9fc086dd4 (patch) | |
| tree | 39e0870bd19769d31d5330944145fecc48118c22 /MediaBrowser.Controller/Library/ItemResolveEventArgs.cs | |
| parent | fe427bc7f4f1a709c43c8ecb035b07325ed710b9 (diff) | |
| parent | 946c0e8256d61d5084efdd2196eef455fa13b89b (diff) | |
Merge with default
Diffstat (limited to 'MediaBrowser.Controller/Library/ItemResolveEventArgs.cs')
| -rw-r--r-- | MediaBrowser.Controller/Library/ItemResolveEventArgs.cs | 43 |
1 files changed, 26 insertions, 17 deletions
diff --git a/MediaBrowser.Controller/Library/ItemResolveEventArgs.cs b/MediaBrowser.Controller/Library/ItemResolveEventArgs.cs index 5d207de13..4194517be 100644 --- a/MediaBrowser.Controller/Library/ItemResolveEventArgs.cs +++ b/MediaBrowser.Controller/Library/ItemResolveEventArgs.cs @@ -1,5 +1,7 @@ using MediaBrowser.Controller.Entities;
using MediaBrowser.Controller.IO;
+using System.Collections.Generic;
+using System.Linq;
using System;
using System.IO;
@@ -12,32 +14,39 @@ namespace MediaBrowser.Controller.Library {
public WIN32_FIND_DATA[] FileSystemChildren { get; set; }
- public WIN32_FIND_DATA? GetFileSystemEntry(string path)
+ protected List<string> _additionalLocations = new List<string>();
+ public List<string> AdditionalLocations
{
- for (int i = 0; i < FileSystemChildren.Length; i++)
+ get
{
- WIN32_FIND_DATA entry = FileSystemChildren[i];
-
- if (entry.Path.Equals(path, StringComparison.OrdinalIgnoreCase))
- {
- return entry;
- }
+ return _additionalLocations;
+ }
+ set
+ {
+ _additionalLocations = value;
}
-
- return null;
}
- public bool ContainsFile(string name)
+ public IEnumerable<string> PhysicalLocations
{
- for (int i = 0; i < FileSystemChildren.Length; i++)
+ get
{
- if (FileSystemChildren[i].cFileName.Equals(name, StringComparison.OrdinalIgnoreCase))
- {
- return true;
- }
+ return (new List<string>() {this.Path}).Concat(AdditionalLocations);
}
+ }
- return false;
+ public bool IsBDFolder { get; set; }
+ public bool IsDVDFolder { get; set; }
+
+ public WIN32_FIND_DATA? GetFileSystemEntry(string path)
+ {
+ WIN32_FIND_DATA entry = FileSystemChildren.FirstOrDefault(f => f.Path.Equals(path, StringComparison.OrdinalIgnoreCase));
+ return entry.cFileName != null ? (WIN32_FIND_DATA?)entry : null;
+ }
+
+ public bool ContainsFile(string name)
+ {
+ return FileSystemChildren.FirstOrDefault(f => f.cFileName.Equals(name, StringComparison.OrdinalIgnoreCase)).cFileName != null;
}
public bool ContainsFolder(string name)
|
