Skip to content

Commit

Permalink
fixed menu sort option
Browse files Browse the repository at this point in the history
Signed-off-by: nuclearfog <[email protected]>
  • Loading branch information
nuclearfog committed Nov 23, 2021
1 parent 09556b6 commit 901c5cc
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -584,6 +584,15 @@ else if (item.getItemId() == R.id.menu_sort_by_filename) {
else if (item.getItemId() == R.id.menu_clear_popular) {
PopularStore.getInstance(this).removeAll();
refreshFragment(PLAYLIST_SONG);
}
// sort by track count
else if (item.getItemId() == R.id.menu_sort_by_number_of_songs) {
if (type == Type.ARTIST) {
if (mViewPager.getCurrentItem() == ARTIST_ALBUM) {
mPreferences.setArtistAlbumSortOrder(SortOrder.ArtistAlbumSortOrder.ALBUM_TRACK_COUNT);
refreshFragment(ARTIST_ALBUM);
}
}
} else {
return super.onOptionsItemSelected(item);
}
Expand Down
3 changes: 3 additions & 0 deletions app/src/main/java/com/andrew/apollo/utils/SortOrder.java
Original file line number Diff line number Diff line change
Expand Up @@ -152,5 +152,8 @@ public interface ArtistAlbumSortOrder {

/* Artist album sort order year */
String ALBUM_YEAR = MediaStore.Audio.Artists.Albums.FIRST_YEAR + " DESC";

/* Artist album sort order track count */
String ALBUM_TRACK_COUNT = MediaStore.Audio.Artists.Albums.NUMBER_OF_SONGS + " DESC";
}
}

0 comments on commit 901c5cc

Please sign in to comment.