aboutsummaryrefslogtreecommitdiff
path: root/MediaBrowser.Controller/Entities
diff options
context:
space:
mode:
authorLuke Pulverenti <luke.pulverenti@gmail.com>2015-09-16 21:33:46 -0400
committerLuke Pulverenti <luke.pulverenti@gmail.com>2015-09-16 21:33:46 -0400
commit29923506cada909aa3ebcb7714781663d1671d46 (patch)
tree29c32064d9105f8a1d2fa4127b3d8922ece19473 /MediaBrowser.Controller/Entities
parenta4a3a54dadd8a0871c815cd2e116f13f985e5b97 (diff)
rework subtitle editor
Diffstat (limited to 'MediaBrowser.Controller/Entities')
-rw-r--r--MediaBrowser.Controller/Entities/Folder.cs23
-rw-r--r--MediaBrowser.Controller/Entities/UserViewBuilder.cs14
2 files changed, 31 insertions, 6 deletions
diff --git a/MediaBrowser.Controller/Entities/Folder.cs b/MediaBrowser.Controller/Entities/Folder.cs
index bb23d3664..4cdc4657e 100644
--- a/MediaBrowser.Controller/Entities/Folder.cs
+++ b/MediaBrowser.Controller/Entities/Folder.cs
@@ -371,7 +371,7 @@ namespace MediaBrowser.Controller.Entities
public Task ValidateChildren(IProgress<double> progress, CancellationToken cancellationToken)
{
- return ValidateChildren(progress, cancellationToken, new MetadataRefreshOptions(new DirectoryService(FileSystem)));
+ return ValidateChildren(progress, cancellationToken, new MetadataRefreshOptions(new DirectoryService(FileSystem)));
}
/// <summary>
@@ -474,7 +474,7 @@ namespace MediaBrowser.Controller.Entities
currentChild.DateModified = child.DateModified;
}
- currentChild.IsOffline = false;
+ await UpdateIsOffline(currentChild, false).ConfigureAwait(false);
validChildren.Add(currentChild);
}
else
@@ -509,12 +509,12 @@ namespace MediaBrowser.Controller.Entities
else if (!string.IsNullOrEmpty(item.Path) && IsPathOffline(item.Path))
{
- item.IsOffline = true;
+ await UpdateIsOffline(item, true).ConfigureAwait(false);
validChildren.Add(item);
}
else
{
- item.IsOffline = false;
+ await UpdateIsOffline(item, false).ConfigureAwait(false);
actualRemovals.Add(item);
}
}
@@ -569,6 +569,17 @@ namespace MediaBrowser.Controller.Entities
progress.Report(100);
}
+ private Task UpdateIsOffline(BaseItem item, bool newValue)
+ {
+ if (item.IsOffline != newValue)
+ {
+ item.IsOffline = newValue;
+ return item.UpdateToRepository(ItemUpdateType.None, CancellationToken.None);
+ }
+
+ return Task.FromResult(true);
+ }
+
private async Task RefreshMetadataRecursive(MetadataRefreshOptions refreshOptions, bool recursive, IProgress<double> progress, CancellationToken cancellationToken)
{
var children = ActualChildren.ToList();
@@ -693,7 +704,7 @@ namespace MediaBrowser.Controller.Entities
/// <returns><c>true</c> if the specified path is offline; otherwise, <c>false</c>.</returns>
private bool IsPathOffline(string path)
{
- if (FileSystem.FileExists(path))
+ if (FileSystem.FileExists(path))
{
return false;
}
@@ -703,7 +714,7 @@ namespace MediaBrowser.Controller.Entities
// Depending on whether the path is local or unc, it may return either null or '\' at the top
while (!string.IsNullOrEmpty(path) && path.Length > 1)
{
- if (FileSystem.DirectoryExists(path))
+ if (FileSystem.DirectoryExists(path))
{
return false;
}
diff --git a/MediaBrowser.Controller/Entities/UserViewBuilder.cs b/MediaBrowser.Controller/Entities/UserViewBuilder.cs
index ce9a8903a..e05b838d0 100644
--- a/MediaBrowser.Controller/Entities/UserViewBuilder.cs
+++ b/MediaBrowser.Controller/Entities/UserViewBuilder.cs
@@ -1036,6 +1036,11 @@ namespace MediaBrowser.Controller.Entities
return false;
}
+ if (request.IsUnidentified.HasValue)
+ {
+ return false;
+ }
+
if (!string.IsNullOrWhiteSpace(request.Person))
{
return false;
@@ -1424,6 +1429,15 @@ namespace MediaBrowser.Controller.Entities
}
}
+ if (query.IsUnidentified.HasValue)
+ {
+ var val = query.IsUnidentified.Value;
+ if (item.IsUnidentified != val)
+ {
+ return false;
+ }
+ }
+
if (query.HasImdbId.HasValue)
{
var filterValue = query.HasImdbId.Value;