aboutsummaryrefslogtreecommitdiff
path: root/MediaBrowser.Server.Implementations/Library/LibraryManager.cs
diff options
context:
space:
mode:
authorLuke Pulverenti <luke.pulverenti@gmail.com>2015-04-15 17:59:20 -0400
committerLuke Pulverenti <luke.pulverenti@gmail.com>2015-04-15 17:59:20 -0400
commitc90cdef3ba630707d16c63dc4392fcc54bcf122d (patch)
tree1a90e8896cc0d998d1aa8a34e7f2dd43d3dd456a /MediaBrowser.Server.Implementations/Library/LibraryManager.cs
parent064b5e82e436c717f74a4d0a353e01e20da9752c (diff)
added user view setting
Diffstat (limited to 'MediaBrowser.Server.Implementations/Library/LibraryManager.cs')
-rw-r--r--MediaBrowser.Server.Implementations/Library/LibraryManager.cs11
1 files changed, 6 insertions, 5 deletions
diff --git a/MediaBrowser.Server.Implementations/Library/LibraryManager.cs b/MediaBrowser.Server.Implementations/Library/LibraryManager.cs
index 02c16d0d4..8285fb7e5 100644
--- a/MediaBrowser.Server.Implementations/Library/LibraryManager.cs
+++ b/MediaBrowser.Server.Implementations/Library/LibraryManager.cs
@@ -1678,11 +1678,6 @@ namespace MediaBrowser.Server.Implementations.Library
throw new ArgumentNullException("name");
}
- if (string.IsNullOrWhiteSpace(viewType))
- {
- throw new ArgumentNullException("viewType");
- }
-
var id = GetNewItemId("37_namedview_" + name + user.Id.ToString("N") + (parentId ?? string.Empty), typeof(UserView));
var path = Path.Combine(ConfigurationManager.ApplicationPaths.InternalMetadataPath, "views", id.ToString("N"));
@@ -1716,6 +1711,12 @@ namespace MediaBrowser.Server.Implementations.Library
isNew = true;
}
+ if (!string.Equals(viewType, item.ViewType, StringComparison.OrdinalIgnoreCase))
+ {
+ item.ViewType = viewType;
+ await item.UpdateToRepository(ItemUpdateType.MetadataEdit, cancellationToken).ConfigureAwait(false);
+ }
+
var refresh = isNew || (DateTime.UtcNow - item.DateLastSaved).TotalHours >= 12;
if (refresh)