|
|
|
@ -99,7 +99,7 @@ namespace MediaBrowser.ServerApplication
|
|
|
|
|
var currentFolder = folder;
|
|
|
|
|
Task.Factory.StartNew(() =>
|
|
|
|
|
{
|
|
|
|
|
var prefs = ddlProfile.SelectedItem != null ? _displayPreferencesManager.GetDisplayPreferences(currentFolder.GetDisplayPreferencesId((ddlProfile.SelectedItem as User).Id), (ddlProfile.SelectedItem as User).Id, "LibraryExplorer") ?? new DisplayPreferences { SortBy = ItemSortBy.SortName } : new DisplayPreferences { SortBy = ItemSortBy.SortName };
|
|
|
|
|
var prefs = ddlProfile.SelectedItem != null ? _displayPreferencesManager.GetDisplayPreferences(currentFolder.DisplayPreferencesId, (ddlProfile.SelectedItem as User).Id, "LibraryExplorer") ?? new DisplayPreferences { SortBy = ItemSortBy.SortName } : new DisplayPreferences { SortBy = ItemSortBy.SortName };
|
|
|
|
|
var node = new TreeViewItem { Tag = currentFolder };
|
|
|
|
|
|
|
|
|
|
var subChildren = currentFolder.GetChildren(CurrentUser, true, prefs.IndexBy);
|
|
|
|
@ -152,7 +152,7 @@ namespace MediaBrowser.ServerApplication
|
|
|
|
|
var subFolder = item as Folder;
|
|
|
|
|
if (subFolder != null)
|
|
|
|
|
{
|
|
|
|
|
var prefs = _displayPreferencesManager.GetDisplayPreferences(subFolder.GetDisplayPreferencesId(user.Id), user.Id, "LibraryExplorer");
|
|
|
|
|
var prefs = _displayPreferencesManager.GetDisplayPreferences(subFolder.DisplayPreferencesId, user.Id, "LibraryExplorer");
|
|
|
|
|
|
|
|
|
|
AddChildren(node, OrderBy(subFolder.GetChildren(user, true), user, prefs.SortBy), user);
|
|
|
|
|
node.Header = item.Name + " (" + node.Items.Count + ")";
|
|
|
|
@ -200,7 +200,7 @@ namespace MediaBrowser.ServerApplication
|
|
|
|
|
ItemSortBy.Runtime
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
var prefs = _displayPreferencesManager.GetDisplayPreferences(folder.GetDisplayPreferencesId((ddlProfile.SelectedItem as User).Id), (ddlProfile.SelectedItem as User).Id, "LibraryExplorer");
|
|
|
|
|
var prefs = _displayPreferencesManager.GetDisplayPreferences(folder.DisplayPreferencesId, (ddlProfile.SelectedItem as User).Id, "LibraryExplorer");
|
|
|
|
|
|
|
|
|
|
ddlIndexBy.SelectedItem = prefs != null
|
|
|
|
|
? prefs.IndexBy ?? LocalizedStrings.Instance.GetString("NoneDispPref")
|
|
|
|
@ -359,7 +359,7 @@ namespace MediaBrowser.ServerApplication
|
|
|
|
|
var folder = treeItem != null
|
|
|
|
|
? treeItem.Tag as Folder
|
|
|
|
|
: null;
|
|
|
|
|
var prefs = folder != null ? _displayPreferencesManager.GetDisplayPreferences(folder.GetDisplayPreferencesId(CurrentUser.Id), CurrentUser.Id, "LibraryExplorer") : new DisplayPreferences { SortBy = ItemSortBy.SortName };
|
|
|
|
|
var prefs = folder != null ? _displayPreferencesManager.GetDisplayPreferences(folder.DisplayPreferencesId, CurrentUser.Id, "LibraryExplorer") : new DisplayPreferences { SortBy = ItemSortBy.SortName };
|
|
|
|
|
if (folder != null && prefs.IndexBy != ddlIndexBy.SelectedItem as string)
|
|
|
|
|
{
|
|
|
|
|
//grab UI context so we can update within the below task
|
|
|
|
@ -400,7 +400,7 @@ namespace MediaBrowser.ServerApplication
|
|
|
|
|
var folder = treeItem != null
|
|
|
|
|
? treeItem.Tag as Folder
|
|
|
|
|
: null;
|
|
|
|
|
var prefs = folder != null ? _displayPreferencesManager.GetDisplayPreferences(folder.GetDisplayPreferencesId(CurrentUser.Id), CurrentUser.Id, "LibraryExplorer") : new DisplayPreferences();
|
|
|
|
|
var prefs = folder != null ? _displayPreferencesManager.GetDisplayPreferences(folder.DisplayPreferencesId, CurrentUser.Id, "LibraryExplorer") : new DisplayPreferences();
|
|
|
|
|
if (folder != null && prefs.SortBy != ddlSortBy.SelectedItem as string)
|
|
|
|
|
{
|
|
|
|
|
//grab UI context so we can update within the below task
|
|
|
|
|