diff --git a/README.md b/README.md index e8eff96..13ca67f 100644 --- a/README.md +++ b/README.md @@ -21,6 +21,8 @@ I made `jellyPod` to suite my tastes. Everything listed below is non-negotiable - The next album is chosen by release date and the next artist is chosen alphanumerically - Shuffle at every scope - You can easily shuffle artists, albums (from a given artist), or all tracks + - Shuffle buttons for single discographies/albums are hidden: scroll up to find them + - This makes playing sequentially the default - Multi-client/device support - `jellyPod` is not just a remote for your phone - The client to control is determined by your most recently active session under your Jellyfin user diff --git a/src/c/jellyPod.c b/src/c/jellyPod.c index 1726359..afd4a8e 100644 --- a/src/c/jellyPod.c +++ b/src/c/jellyPod.c @@ -68,6 +68,17 @@ static const char *get_current_scope_subscope() { } } +static uint16_t get_scope_shuffle_row_count(NavScope scope) { + switch (scope) { + case NAV_SCOPE_ALBUMS: + return 2; + case NAV_SCOPE_ALBUM_TRACKS: + return 1; + default: + return 0; + } +} + ////////////////////// PKJS ////////////////////// static void outbox_failed_handler(DictionaryIterator *iter, AppMessageResult reason, void *context) { @@ -118,6 +129,11 @@ static void inbox_received_handler(DictionaryIterator *iter, void *context) { snprintf(s_nav_history.last_subscope[s_current_menu_scope], sizeof(s_nav_history.last_subscope[s_current_menu_scope]), "%s", subscope); } } + // require the user to scroll up to reach shuffle rows + uint16_t shuffle_rows = get_scope_shuffle_row_count(s_current_menu_scope); + if (scroll_row < shuffle_rows) { + scroll_row = shuffle_rows; + } s_nav_history.scroll_row[s_current_menu_scope] = scroll_row; menu_layer_reload_data(s_menu_layer); menu_layer_set_selected_index(s_menu_layer, MenuIndex(0, scroll_row), MenuRowAlignTop, false); @@ -238,12 +254,8 @@ static uint16_t menu_get_num_rows(MenuLayer *menu_layer, uint16_t section_index, switch (s_current_menu_scope) { case NAV_SCOPE_MAIN: return 4; - case NAV_SCOPE_ALBUMS: - return s_menu_items_count + 2; // account for shuffle buttons insertion - case NAV_SCOPE_ALBUM_TRACKS: - return s_menu_items_count + 1; // account for shuffle button insertion default: - return s_menu_items_count; + return s_menu_items_count + get_scope_shuffle_row_count(s_current_menu_scope); } }