aboutsummaryrefslogtreecommitdiff
path: root/Emby.Server.Implementations/Library
diff options
context:
space:
mode:
authorLuke <luke.pulverenti@gmail.com>2017-02-24 15:21:11 -0500
committerGitHub <noreply@github.com>2017-02-24 15:21:11 -0500
commitcd6b7f3bdc5bcbc6c68131cc40b71b68ac1b73a6 (patch)
tree48b8f6d94e3f762a486aa1c4fa6937cf23c18dee /Emby.Server.Implementations/Library
parentc07e774ca9c0f234ec6899e17fc70301d1990290 (diff)
parent66a844e6399f1d79be8e10ea098ba6768e0d123b (diff)
Merge pull request #2489 from MediaBrowser/beta
Beta
Diffstat (limited to 'Emby.Server.Implementations/Library')
-rw-r--r--Emby.Server.Implementations/Library/LibraryManager.cs38
-rw-r--r--Emby.Server.Implementations/Library/UserViewManager.cs9
2 files changed, 15 insertions, 32 deletions
diff --git a/Emby.Server.Implementations/Library/LibraryManager.cs b/Emby.Server.Implementations/Library/LibraryManager.cs
index 616c6c1a2..56bffc233 100644
--- a/Emby.Server.Implementations/Library/LibraryManager.cs
+++ b/Emby.Server.Implementations/Library/LibraryManager.cs
@@ -409,17 +409,17 @@ namespace Emby.Server.Implementations.Library
if (options.DeleteFileLocation && locationType != LocationType.Remote && locationType != LocationType.Virtual)
{
- foreach (var path in item.GetDeletePaths().ToList())
+ foreach (var fileSystemInfo in item.GetDeletePaths().ToList())
{
- if (_fileSystem.DirectoryExists(path))
+ if (fileSystemInfo.IsDirectory)
{
- _logger.Debug("Deleting path {0}", path);
- _fileSystem.DeleteDirectory(path, true);
+ _logger.Debug("Deleting path {0}", fileSystemInfo.FullName);
+ _fileSystem.DeleteDirectory(fileSystemInfo.FullName, true);
}
- else if (_fileSystem.FileExists(path))
+ else
{
- _logger.Debug("Deleting path {0}", path);
- _fileSystem.DeleteFile(path);
+ _logger.Debug("Deleting path {0}", fileSystemInfo.FullName);
+ _fileSystem.DeleteFile(fileSystemInfo.FullName);
}
}
@@ -818,30 +818,6 @@ namespace Emby.Server.Implementations.Library
return _userRootFolder;
}
- public Guid? FindIdByPath(string path, bool? isFolder)
- {
- // If this returns multiple items it could be tricky figuring out which one is correct.
- // In most cases, the newest one will be and the others obsolete but not yet cleaned up
-
- var query = new InternalItemsQuery
- {
- Path = path,
- IsFolder = isFolder,
- SortBy = new[] { ItemSortBy.DateCreated },
- SortOrder = SortOrder.Descending,
- Limit = 1
- };
-
- var id = GetItemIds(query);
-
- if (id.Count == 0)
- {
- return null;
- }
-
- return id[0];
- }
-
public BaseItem FindByPath(string path, bool? isFolder)
{
// If this returns multiple items it could be tricky figuring out which one is correct.
diff --git a/Emby.Server.Implementations/Library/UserViewManager.cs b/Emby.Server.Implementations/Library/UserViewManager.cs
index f11cbd498..9e1291847 100644
--- a/Emby.Server.Implementations/Library/UserViewManager.cs
+++ b/Emby.Server.Implementations/Library/UserViewManager.cs
@@ -248,6 +248,13 @@ namespace Emby.Server.Implementations.Library
}
}
+ var isPlayed = request.IsPlayed;
+
+ if (parents.OfType<ICollectionFolder>().Any(i => string.Equals(i.CollectionType, CollectionType.Music, StringComparison.OrdinalIgnoreCase)))
+ {
+ isPlayed = null;
+ }
+
if (parents.Count == 0)
{
parents = user.RootFolder.GetChildren(user, true)
@@ -282,7 +289,7 @@ namespace Emby.Server.Implementations.Library
IsVirtualItem = false,
Limit = limit * 5,
SourceTypes = parents.Count == 0 ? new[] { SourceType.Library } : new SourceType[] { },
- IsPlayed = request.IsPlayed
+ IsPlayed = isPlayed
}, parents);
}