Esempio n. 1
0
        public void UpdateFolders(int CurrentSortMethod, bool CurrentSortAsc, int CurrentLayout)
        {
            string currentFolder = GUIVideoFiles.GetCurrentFolder;

            if (currentFolder == string.Empty)
            {
                currentFolder = "root";
            }

            if (!OnResetFolderSettings())
            {
                return;
            }
            Log.Debug("UpdateFolders: currentFolder {0}", currentFolder);

            ArrayList strPathList = new ArrayList();

            FolderSettings.GetPath(GUIVideoFiles.GetCurrentFolder, ref strPathList, "VideoFiles");

            for (int iRow = 0; iRow < strPathList.Count; iRow++)
            {
                object o;
                FolderSettings.GetFolderSetting(strPathList[iRow] as string, "VideoFiles", typeof(GUIVideoFiles.MapSettings), out o);
                Log.Debug("UpdateFolders: GetFolderSetting {0}", strPathList[iRow] as string);

                if (o != null)
                {
                    GUIVideoFiles.MapSettings mapSettings = o as GUIVideoFiles.MapSettings;

                    if (mapSettings == null)
                    {
                        mapSettings = new GUIVideoFiles.MapSettings();
                    }

                    if (CurrentSortMethod != -1)
                    {
                        Log.Debug("UpdateFolders: old SortBy {0}, new SortBy {1}", mapSettings.SortBy, CurrentSortMethod);
                        mapSettings.SortBy        = CurrentSortMethod;
                        mapSettings.SortAscending = CurrentSortAsc;
                    }

                    if (CurrentLayout != -1)
                    {
                        Log.Debug("UpdateFolders: old ViewAs {0}, new ViewAs {1}", mapSettings.ViewAs, CurrentLayout);
                        mapSettings.ViewAs = CurrentLayout;
                    }

                    FolderSettings.AddFolderSetting(strPathList[iRow] as string, "VideoFiles", typeof(GUIVideoFiles.MapSettings), mapSettings);
                }
            }
        }
Esempio n. 2
0
        public void UpdateViews(int CurrentSortMethod, bool CurrentSortAsc)
        {
            string currentView = GUIVideoTitle.GetCurrentView;

            if (currentView == string.Empty)
            {
                return;
            }

            if (!OnResetFolderSettings())
            {
                return;
            }

            Log.Debug("UpdateViews: CurrentView {0}", currentView);

            ArrayList strPathList = new ArrayList();

            FolderSettings.GetPath(GUIVideoTitle.GetCurrentView, ref strPathList, "VideoViews");

            for (int iRow = 0; iRow < strPathList.Count; iRow++)
            {
                object o;
                FolderSettings.GetFolderSetting(strPathList[iRow] as string, "VideoViews", typeof(GUIVideoTitle.MapSettings), out o);
                Log.Debug("UpdateViews: GetViewSetting {0}", strPathList[iRow] as string);

                if (o != null)
                {
                    GUIVideoTitle.MapSettings mapSettings = o as GUIVideoTitle.MapSettings;

                    if (mapSettings == null)
                    {
                        mapSettings = new GUIVideoTitle.MapSettings();
                    }

                    if (CurrentSortMethod != -1)
                    {
                        Log.Debug("UpdateViews: Old SortBy {0}/{2}, new SortBy {1}/{3}", mapSettings.SortBy, CurrentSortMethod, mapSettings.SortBy, CurrentSortAsc);
                        mapSettings.SortBy        = CurrentSortMethod;
                        mapSettings.SortAscending = CurrentSortAsc;

                        FolderSettings.AddFolderSetting(strPathList[iRow] as string, "VideoViews", typeof(GUIVideoFiles.MapSettings), mapSettings);
                    }
                }
            }
        }