From 13254654b424fbbc05340d111506ea84c4351af6 Mon Sep 17 00:00:00 2001 From: Yuriy Liskov Date: Sun, 1 Dec 2024 18:12:53 +0200 Subject: [PATCH] browse: channel section sorting fix --- MediaServiceCore | 2 +- .../common/app/presenters/BrowsePresenter.java | 4 ++-- .../app/presenters/settings/MainUISettingsPresenter.java | 3 +-- .../smartyoutubetv2/common/misc/MediaServiceManager.java | 2 +- .../liskovsoft/smartyoutubetv2/common/prefs/MainUIData.java | 6 +----- smarttubetv/build.gradle | 4 ++-- 6 files changed, 8 insertions(+), 13 deletions(-) diff --git a/MediaServiceCore b/MediaServiceCore index 01eca3ddf1..96f7ed3ea7 160000 --- a/MediaServiceCore +++ b/MediaServiceCore @@ -1 +1 @@ -Subproject commit 01eca3ddf1de3974c8cb26f3957ae4fec0831077 +Subproject commit 96f7ed3ea7a06190ca1084c11f27fad515a2393f diff --git a/common/src/main/java/com/liskovsoft/smartyoutubetv2/common/app/presenters/BrowsePresenter.java b/common/src/main/java/com/liskovsoft/smartyoutubetv2/common/app/presenters/BrowsePresenter.java index 71efbe95e1..011e248bbd 100644 --- a/common/src/main/java/com/liskovsoft/smartyoutubetv2/common/app/presenters/BrowsePresenter.java +++ b/common/src/main/java/com/liskovsoft/smartyoutubetv2/common/app/presenters/BrowsePresenter.java @@ -219,7 +219,7 @@ private void initSectionCallbacks() { mGridMapping.put(MediaGroup.TYPE_SHORTS, mContentService.getShortsObserve()); mGridMapping.put(MediaGroup.TYPE_SUBSCRIPTIONS, mContentService.getSubscriptionsObserve()); mGridMapping.put(MediaGroup.TYPE_HISTORY, mContentService.getHistoryObserve()); - mGridMapping.put(MediaGroup.TYPE_CHANNEL_UPLOADS, mContentService.getSubscribedChannelsByUpdateObserve()); + mGridMapping.put(MediaGroup.TYPE_CHANNEL_UPLOADS, mContentService.getSubscribedChannelsByNewContentObserve()); mGridMapping.put(MediaGroup.TYPE_NOTIFICATIONS, mNotificationsService.getNotificationItemsObserve()); } @@ -316,7 +316,7 @@ public void updateChannelSorting() { mGridMapping.put(MediaGroup.TYPE_CHANNEL_UPLOADS, mContentService.getSubscribedChannelsByNameObserve()); break; case MainUIData.CHANNEL_SORTING_NEW_CONTENT: - mGridMapping.put(MediaGroup.TYPE_CHANNEL_UPLOADS, mContentService.getSubscribedChannelsByUpdateObserve()); + mGridMapping.put(MediaGroup.TYPE_CHANNEL_UPLOADS, mContentService.getSubscribedChannelsByNewContentObserve()); break; case MainUIData.CHANNEL_SORTING_LAST_VIEWED: mGridMapping.put(MediaGroup.TYPE_CHANNEL_UPLOADS, mContentService.getSubscribedChannelsByLastViewedObserve()); diff --git a/common/src/main/java/com/liskovsoft/smartyoutubetv2/common/app/presenters/settings/MainUISettingsPresenter.java b/common/src/main/java/com/liskovsoft/smartyoutubetv2/common/app/presenters/settings/MainUISettingsPresenter.java index 8c14095b66..7cadae46eb 100644 --- a/common/src/main/java/com/liskovsoft/smartyoutubetv2/common/app/presenters/settings/MainUISettingsPresenter.java +++ b/common/src/main/java/com/liskovsoft/smartyoutubetv2/common/app/presenters/settings/MainUISettingsPresenter.java @@ -165,8 +165,7 @@ private void appendChannelSortingCategory(AppDialogPresenter settingsPresenter) for (int[] pair : new int[][] { {R.string.sorting_last_viewed, MainUIData.CHANNEL_SORTING_LAST_VIEWED}, {R.string.sorting_alphabetically, MainUIData.CHANNEL_SORTING_NAME}, - //{R.string.sorting_by_new_content, MainUIData.CHANNEL_SORTING_NEW_CONTENT}, - }) { + {R.string.sorting_by_new_content, MainUIData.CHANNEL_SORTING_NEW_CONTENT}}) { options.add(UiOptionItem.from(getContext().getString(pair[0]), optionItem -> { mMainUIData.setChannelCategorySorting(pair[1]); BrowsePresenter.instance(getContext()).updateChannelSorting(); diff --git a/common/src/main/java/com/liskovsoft/smartyoutubetv2/common/misc/MediaServiceManager.java b/common/src/main/java/com/liskovsoft/smartyoutubetv2/common/misc/MediaServiceManager.java index 429c424427..7af6293eba 100644 --- a/common/src/main/java/com/liskovsoft/smartyoutubetv2/common/misc/MediaServiceManager.java +++ b/common/src/main/java/com/liskovsoft/smartyoutubetv2/common/misc/MediaServiceManager.java @@ -188,7 +188,7 @@ public void loadChannelUploads(MediaItem item, OnMediaGroup onMediaGroup) { public void loadSubscribedChannels(OnMediaGroup onMediaGroup) { RxHelper.disposeActions(mSubscribedChannelsAction); - Observable observable = mContentService.getSubscribedChannelsByUpdateObserve(); + Observable observable = mContentService.getSubscribedChannelsByNewContentObserve(); mSubscribedChannelsAction = observable .subscribe( diff --git a/common/src/main/java/com/liskovsoft/smartyoutubetv2/common/prefs/MainUIData.java b/common/src/main/java/com/liskovsoft/smartyoutubetv2/common/prefs/MainUIData.java index 64fd341855..d49a683af1 100644 --- a/common/src/main/java/com/liskovsoft/smartyoutubetv2/common/prefs/MainUIData.java +++ b/common/src/main/java/com/liskovsoft/smartyoutubetv2/common/prefs/MainUIData.java @@ -388,7 +388,7 @@ private void restoreState() { mUIScale = Helpers.parseFloat(split, 2, 1.0f); mColorSchemeIndex = Helpers.parseInt(split, 3, 1); mIsCardMultilineTitleEnabled = Helpers.parseBoolean(split, 4, true); - mChannelCategorySorting = Helpers.parseInt(split, 5, CHANNEL_SORTING_NEW_CONTENT); + mChannelCategorySorting = Helpers.parseInt(split, 5, CHANNEL_SORTING_LAST_VIEWED); mPlaylistsStyle = Helpers.parseInt(split, 6, PLAYLISTS_STYLE_GRID); mCardTitleLinesNum = Helpers.parseInt(split, 7, 1); mIsCardTextAutoScrollEnabled = Helpers.parseBoolean(split, 8, true); @@ -464,10 +464,6 @@ private void updateDefaultValues() { if (mChannelCategorySorting == CHANNEL_SORTING_DEFAULT) { mChannelCategorySorting = CHANNEL_SORTING_LAST_VIEWED; } - - if (mChannelCategorySorting == CHANNEL_SORTING_NEW_CONTENT) { - mChannelCategorySorting = CHANNEL_SORTING_LAST_VIEWED; - } } @Override diff --git a/smarttubetv/build.gradle b/smarttubetv/build.gradle index 798d94f899..9ae23e3df7 100644 --- a/smarttubetv/build.gradle +++ b/smarttubetv/build.gradle @@ -60,8 +60,8 @@ android { applicationId "com.liskovsoft.smarttubetv" minSdkVersion project.properties.minSdkVersion targetSdkVersion project.properties.targetSdkVersion - versionCode 1680 - versionName "24.90" + versionCode 1681 + versionName "24.91" testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner" buildConfigField "long", "TIMESTAMP", System.currentTimeMillis() + "L"