Skip to content

Commit

Permalink
browse: channel section sorting fix
Browse files Browse the repository at this point in the history
  • Loading branch information
yuliskov committed Dec 1, 2024
1 parent 2d061da commit 1325465
Show file tree
Hide file tree
Showing 6 changed files with 8 additions and 13 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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());
}

Expand Down Expand Up @@ -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());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -188,7 +188,7 @@ public void loadChannelUploads(MediaItem item, OnMediaGroup onMediaGroup) {
public void loadSubscribedChannels(OnMediaGroup onMediaGroup) {
RxHelper.disposeActions(mSubscribedChannelsAction);

Observable<MediaGroup> observable = mContentService.getSubscribedChannelsByUpdateObserve();
Observable<MediaGroup> observable = mContentService.getSubscribedChannelsByNewContentObserve();

mSubscribedChannelsAction = observable
.subscribe(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down Expand Up @@ -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
Expand Down
4 changes: 2 additions & 2 deletions smarttubetv/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -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"

Expand Down

0 comments on commit 1325465

Please sign in to comment.