feat(DM): instant cache load, manual refresh, full-screen season selector, season persistence fix

- Cache loads synchronously on onShow for instant startup, no auto fetch
- Added manual Refresh button, removed auto refresh that blocked UI
- Made UI non-blocking during fetch (episode list usable while fetching)
- Fixed season loss after player/downloader by preserving season in static s_preserved_season surviving G memset
- Season selector now full-screen overlay parented to lv_scr_act()
- Removed DL Missing batch button and bottom help/status label per UX request
- load_state no longer overwrites browsing season with last_slug season
This commit is contained in:
Adolfo
2026-07-30 16:13:47 -04:00
parent 7ef8e272fc
commit d4a257a01c
6 changed files with 262 additions and 149 deletions
+15 -2
View File
@@ -37,6 +37,14 @@ static bool try_external_downloader(int idx) {
char fpath[300];
make_sd_path(fpath, sizeof(fpath), ep->slug);
// Preserve browsing season so we return to same season after downloader closes – survive G memset via static
dm_preserve_season(ep->season);
int saved_season = G.cur_season;
G.cur_season = ep->season;
save_state();
G.cur_ep_idx = idx;
(void)saved_season;
tt_lvgl_lock(portMAX_DELAY);
close_overlay();
if(G.dl_overlay) hide_dl_overlay();
@@ -51,7 +59,7 @@ static bool try_external_downloader(int idx) {
tt_bundle_put_string(b, "path", fpath);
tt_bundle_put_bool(b, "override", false);
ESP_LOGI(TAG, "Starting external SdDownloader for %s -> %s", ep->slug, fpath);
ESP_LOGI(TAG, "Starting external SdDownloader for %s -> %s season %d", ep->slug, fpath, G.cur_season);
G.pending_dl_idx = idx;
tt_lvgl_lock(portMAX_DELAY);
@@ -118,6 +126,10 @@ bool download_missing_season_start(int season){
G.dl_missing_total=missing;
G.dl_missing_done=0;
G.dl_missing_failed=0;
// Preserve season in persisted state and static before leaving
dm_preserve_season(season);
G.cur_season = season;
save_state();
int first = find_next_missing_in_season(season);
if(first==-1){
G.dl_missing_active=false;
@@ -173,11 +185,12 @@ void start_idx_internal(int idx){
tt_bundle_put_int32(b, "pos_sec", saved);
tt_bundle_put_int32(b, "position", saved);
tt_bundle_put_int32(b, "volume", G.volume);
ESP_LOGI(TAG, "Launching Mp3Player for %s pos %d", fpath, saved);
ESP_LOGI(TAG, "Launching Mp3Player for %s pos %d season %d", fpath, saved, ep->season);
G.pending_dl_idx = idx;
G.cur_ep_idx=idx; G.cur_season=ep->season;
strncpy(G.cur_title,ep->title,sizeof(G.cur_title)-1);
strncpy(G.last_slug,ep->slug,sizeof(G.last_slug)-1);
dm_preserve_season(ep->season);
save_state();
tt_app_start_with_bundle("one.tactility.mp3player", b);
return;