diff options
| author | ebr11 Eric Reed spam <ebr11 Eric Reed spam@reedsplace.com> | 2012-09-20 13:52:56 -0400 |
|---|---|---|
| committer | ebr11 Eric Reed spam <ebr11 Eric Reed spam@reedsplace.com> | 2012-09-20 13:52:56 -0400 |
| commit | ef07c2e6ab71552b088dc223666a18167ca31182 (patch) | |
| tree | 172a082ffb71dceda82b626b3e1e62f2027c2abc | |
| parent | e2ae376eef11dbb69c6d5d0ca31b202394452390 (diff) | |
Move PhysicalLocations to baseitem
| -rw-r--r-- | MediaBrowser.Controller/Entities/BaseItem.cs | 17 | ||||
| -rw-r--r-- | MediaBrowser.Controller/Entities/Folder.cs | 8 | ||||
| -rw-r--r-- | MediaBrowser.Controller/Resolvers/FolderResolver.cs | 2 | ||||
| -rw-r--r-- | MediaBrowser.sln | 27 |
4 files changed, 30 insertions, 24 deletions
diff --git a/MediaBrowser.Controller/Entities/BaseItem.cs b/MediaBrowser.Controller/Entities/BaseItem.cs index f845c0f97..4c9008b22 100644 --- a/MediaBrowser.Controller/Entities/BaseItem.cs +++ b/MediaBrowser.Controller/Entities/BaseItem.cs @@ -10,6 +10,15 @@ namespace MediaBrowser.Controller.Entities {
public abstract class BaseItem : BaseEntity, IHasProviderIds
{
+
+ public IEnumerable<string> PhysicalLocations
+ {
+ get
+ {
+ return _resolveArgs.PhysicalLocations;
+ }
+ }
+
public string SortName { get; set; }
/// <summary>
@@ -136,12 +145,12 @@ namespace MediaBrowser.Controller.Entities /// <summary>
/// Determine if we have changed vs the passed in copy
/// </summary>
- /// <param name="original"></param>
+ /// <param name="copy"></param>
/// <returns></returns>
- public virtual bool IsChanged(BaseItem original)
+ public virtual bool IsChanged(BaseItem copy)
{
- bool changed = original.DateModified != this.DateModified;
- changed |= original.DateCreated != this.DateCreated;
+ bool changed = copy.DateModified != this.DateModified;
+ if (changed) MediaBrowser.Common.Logging.Logger.LogDebugInfo(this.Name + " changed - original creation: " + this.DateCreated + " new creation: " + copy.DateCreated + " original modified: " + this.DateModified + " new modified: " + copy.DateModified);
return changed;
}
diff --git a/MediaBrowser.Controller/Entities/Folder.cs b/MediaBrowser.Controller/Entities/Folder.cs index 6cf47c2f2..07529c80f 100644 --- a/MediaBrowser.Controller/Entities/Folder.cs +++ b/MediaBrowser.Controller/Entities/Folder.cs @@ -32,8 +32,6 @@ namespace MediaBrowser.Controller.Entities #endregion
- public IEnumerable<string> PhysicalLocations { get; set; }
-
public override bool IsFolder
{
get
@@ -155,7 +153,7 @@ namespace MediaBrowser.Controller.Entities changedArgs.ItemsAdded.Add(child);
//refresh it
child.RefreshMetadata();
- //Logger.LogInfo("New Item Added to Library: ("+child.GetType().Name+") "+ child.Name + " (" + child.Path + ")");
+ Logger.LogInfo("New Item Added to Library: ("+child.GetType().Name+") "+ child.Name + " (" + child.Path + ")");
//save it in repo...
//and add it to our valid children
@@ -199,6 +197,8 @@ namespace MediaBrowser.Controller.Entities //now, if anything changed - replace our children
if (changed)
{
+ if (changedArgs.ItemsRemoved != null) foreach (var item in changedArgs.ItemsRemoved) Logger.LogDebugInfo("** " + item.Name + " Removed from library.");
+
lock (childLock)
ActualChildren = validChildren;
//and save children in repo...
@@ -613,7 +613,7 @@ namespace MediaBrowser.Controller.Entities }
//this should be functionally equivilent to what was here since it is IEnum and works on a thread-safe copy
- return RecursiveChildren.FirstOrDefault(i => i.Path.Equals(path, StringComparison.OrdinalIgnoreCase));
+ return RecursiveChildren.FirstOrDefault(i => i.PhysicalLocations.Contains(path, StringComparer.OrdinalIgnoreCase));
}
}
}
diff --git a/MediaBrowser.Controller/Resolvers/FolderResolver.cs b/MediaBrowser.Controller/Resolvers/FolderResolver.cs index 408e513d4..028c85f86 100644 --- a/MediaBrowser.Controller/Resolvers/FolderResolver.cs +++ b/MediaBrowser.Controller/Resolvers/FolderResolver.cs @@ -16,7 +16,7 @@ namespace MediaBrowser.Controller.Resolvers {
if (args.IsDirectory)
{
- return new Folder() { PhysicalLocations = args.PhysicalLocations };
+ return new Folder();
}
return null;
diff --git a/MediaBrowser.sln b/MediaBrowser.sln index b3f1b7835..51f450743 100644 --- a/MediaBrowser.sln +++ b/MediaBrowser.sln @@ -24,6 +24,10 @@ Global Release|Any CPU = Release|Any CPU
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
+ {156EA256-AD2D-4D2F-B116-2ED4B9EFD869}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
+ {156EA256-AD2D-4D2F-B116-2ED4B9EFD869}.Debug|Any CPU.Build.0 = Debug|Any CPU
+ {156EA256-AD2D-4D2F-B116-2ED4B9EFD869}.Release|Any CPU.ActiveCfg = Release|Any CPU
+ {156EA256-AD2D-4D2F-B116-2ED4B9EFD869}.Release|Any CPU.Build.0 = Release|Any CPU
{17E1F4E6-8ABD-4FE5-9ECF-43D4B6087BA2}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{17E1F4E6-8ABD-4FE5-9ECF-43D4B6087BA2}.Debug|Any CPU.Build.0 = Debug|Any CPU
{17E1F4E6-8ABD-4FE5-9ECF-43D4B6087BA2}.Release|Any CPU.ActiveCfg = Release|Any CPU
@@ -32,27 +36,20 @@ Global {4FD51AC5-2C16-4308-A993-C3A84F3B4582}.Debug|Any CPU.Build.0 = Debug|Any CPU
{4FD51AC5-2C16-4308-A993-C3A84F3B4582}.Release|Any CPU.ActiveCfg = Release|Any CPU
{4FD51AC5-2C16-4308-A993-C3A84F3B4582}.Release|Any CPU.Build.0 = Release|Any CPU
- {9142EEFA-7570-41E1-BFCC-468BB571AF2F}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
- {9142EEFA-7570-41E1-BFCC-468BB571AF2F}.Debug|Any CPU.Build.0 = Debug|Any CPU
- {9142EEFA-7570-41E1-BFCC-468BB571AF2F}.Release|Any CPU.ActiveCfg = Release|Any CPU
- {9142EEFA-7570-41E1-BFCC-468BB571AF2F}.Release|Any CPU.Build.0 = Release|Any CPU
- {7EEEB4BB-F3E8-48FC-B4C5-70F0FFF8329B}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
- {7EEEB4BB-F3E8-48FC-B4C5-70F0FFF8329B}.Debug|Any CPU.Build.0 = Debug|Any CPU
- {7EEEB4BB-F3E8-48FC-B4C5-70F0FFF8329B}.Release|Any CPU.ActiveCfg = Release|Any CPU
- {7EEEB4BB-F3E8-48FC-B4C5-70F0FFF8329B}.Release|Any CPU.Build.0 = Release|Any CPU
- {156EA256-AD2D-4D2F-B116-2ED4B9EFD869}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
- {156EA256-AD2D-4D2F-B116-2ED4B9EFD869}.Debug|Any CPU.Build.0 = Debug|Any CPU
- {156EA256-AD2D-4D2F-B116-2ED4B9EFD869}.Release|Any CPU.ActiveCfg = Release|Any CPU
- {156EA256-AD2D-4D2F-B116-2ED4B9EFD869}.Release|Any CPU.Build.0 = Release|Any CPU
{5624B7B5-B5A7-41D8-9F10-CC5611109619}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{5624B7B5-B5A7-41D8-9F10-CC5611109619}.Debug|Any CPU.Build.0 = Debug|Any CPU
{5624B7B5-B5A7-41D8-9F10-CC5611109619}.Release|Any CPU.ActiveCfg = Release|Any CPU
{5624B7B5-B5A7-41D8-9F10-CC5611109619}.Release|Any CPU.Build.0 = Release|Any CPU
+ {7EEEB4BB-F3E8-48FC-B4C5-70F0FFF8329B}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
+ {7EEEB4BB-F3E8-48FC-B4C5-70F0FFF8329B}.Debug|Any CPU.Build.0 = Debug|Any CPU
+ {7EEEB4BB-F3E8-48FC-B4C5-70F0FFF8329B}.Release|Any CPU.ActiveCfg = Release|Any CPU
+ {7EEEB4BB-F3E8-48FC-B4C5-70F0FFF8329B}.Release|Any CPU.Build.0 = Release|Any CPU
+ {9142EEFA-7570-41E1-BFCC-468BB571AF2F}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
+ {9142EEFA-7570-41E1-BFCC-468BB571AF2F}.Debug|Any CPU.Build.0 = Debug|Any CPU
+ {9142EEFA-7570-41E1-BFCC-468BB571AF2F}.Release|Any CPU.ActiveCfg = Release|Any CPU
+ {9142EEFA-7570-41E1-BFCC-468BB571AF2F}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
EndGlobalSection
- GlobalSection(Performance) = preSolution
- HasPerformanceSessions = true
- EndGlobalSection
EndGlobal
|
