refactor(DiscoveryMountain): split monolithic main.c into modular files

- Extracted app_context (global AppCtx G definition)
- storage: path helpers, LRU, sort, fmt_time, per-episode resume map, state persistence
- network: resolve_host, normalize URL, http_get_raw with growing PSRAM buffer, fetch_data
- download: dl_ep_raw with progress tracking, cancel, overlay UI (show/hide/update)
- player: audio device, stream, play_task with resume seek, start/select/next/prev with position save/restore
- ui: build_ui, timers, season picker, button callbacks, periodic save
- main: minimal glue, fetch_task, onShow/onHide, app registration
- Preserves all previous fixes: download progress overlay, per-episode resume, robust download handling
- Build verified: 111 undef, all exported
This commit is contained in:
Adolfo
2026-07-22 17:11:59 -04:00
parent 6bfe514ff1
commit be9229b80d
13 changed files with 1662 additions and 1519 deletions
+21
View File
@@ -0,0 +1,21 @@
#pragma once
#include "app_context.h"
#ifdef __cplusplus
extern "C" {
#endif
void build_ui(void);
void ui_timer(lv_timer_t* t);
void btn_play_cb(lv_event_t* e);
void btn_prev_cb(lv_event_t* e);
void btn_next_cb(lv_event_t* e);
void btn_seasons_cb(lv_event_t* e);
void close_overlay(void);
void dropdown_cb(lv_event_t* e);
#ifdef __cplusplus
}
#endif