File: 190a191 > bool preloadingNextPage; 552c553 < if (GetUserInputString(ref videosVKfilter, false)) SetVideosToFacade(currentVideoList, currentVideosDisplayMode); --- > if (GetUserInputString(ref videosVKfilter, false)) SetVideosToFacade(currentVideoList, currentVideosDisplayMode, true); 696c697 < case State.videos: SetVideosToFacade(currentVideoList, currentVideosDisplayMode); break; --- > case State.videos: SetVideosToFacade(currentVideoList, currentVideosDisplayMode, true); break; 1602c1603 < if (!success || !SetVideosToFacade(result as List, VideosMode.Category)) --- > if (!success || !SetVideosToFacade(result as List, VideosMode.Category, true)) 1798c1799 < SetVideosToFacade(resultList.ConvertAll(i => i as VideoInfo), mode); --- > SetVideosToFacade(resultList.ConvertAll(i => i as VideoInfo), mode, true); 1882c1883 < if (success) SetVideosToFacade(result as List, currentVideosDisplayMode); --- > if (success) SetVideosToFacade(result as List, currentVideosDisplayMode, true); 1898a1900,1912 > private void DisplayVideos_NextPagePreload() > { > Gui2UtilConnector.Instance.ExecuteInBackgroundAndCallback(delegate() > { > return SelectedSite.GetNextPageVideos(); > }, > delegate(bool success, object result) > { > if (success) SetVideosToFacade(result as List, currentVideosDisplayMode, false, true); > }, > Translation.Instance.GettingNextPageVideos, true); > preloadingNextPage = false; > } 1900c1914 < private bool SetVideosToFacade(List videos, VideosMode mode, bool append = false) --- > private bool SetVideosToFacade(List videos, VideosMode mode, bool viewToNewItemIndex, bool append = false) 1916a1931 > int currentItemIndex = GUI_facadeView.SelectedListItemIndex; 1977c1992,2002 < if (indextoSelect > -1 && indextoSelect < GUI_facadeView.Count) GUI_facadeView.SelectedListItemIndex = indextoSelect; --- > if (viewToNewItemIndex) > { > if (indextoSelect > -1 && indextoSelect < GUI_facadeView.Count) > GUI_facadeView.SelectedListItemIndex = indextoSelect; > } > else > { > indextoSelect = currentItemIndex; > if (indextoSelect > -1 && indextoSelect < GUI_facadeView.Count) > GUI_facadeView.SelectedListItemIndex = indextoSelect; > } 2077c2102 < SetVideosToFacade(currentVideoList, currentVideosDisplayMode); --- > SetVideosToFacade(currentVideoList, currentVideosDisplayMode, true); 2082a2108,2116 > // Dyamic preloading when user is near next page label (default offset 10) > /* > try > { > if (selectedSite.HasNextPage && CurrentState == State.videos) > { > int totalItems = GUI_facadeView.Count; > int selectedItemIndex = GUI_facadeView.SelectedListItemIndex; > int itemOffset = Math.Abs(totalItems - selectedItemIndex); 2082a2118,2120 > if (itemOffset <= 10 && itemOffset > 0) > { > MediaPortal.GUI.Library.Log.Debug(string.Format("Loading next page automatically..[offset: {0}]", itemOffset)); 2082a2122,2127 > preloadingNextPage = true; > GUIWindowManager.SendThreadCallback((p1, p2, o) => > { > DisplayVideos_NextPagePreload(); > return 0; > }, 0, 0, null); 2082a2129,2139 > MediaPortal.GUI.Library.Log.Debug("Successfully loaded next page automatically"); > } > } > } > catch (Exception e) > { > preloadingNextPage = false; > MediaPortal.GUI.Library.Log.Error("Error during preloading"); > MediaPortal.GUI.Library.Log.Error(e.Message); > } > */ 2082a2141,2144 > // Static preloading when user is over Next Page label > if (item.Label == Translation.Instance.NextPage) > { > MediaPortal.GUI.Library.Log.Debug("Loading next page automatically.."); 2082a2146 > GUIWindowManager.SendThreadCallback((p1, p2, o) => { DisplayVideos_NextPagePreload(); return 0; }, 0, 0, null); 2082a2148,2149 > MediaPortal.GUI.Library.Log.Debug("Successfully loaded next page automatically"); > }