3778cb3399
- DiscoveryMountain: new UI optimized for episode list (not player anymore) - Shows episodes for current season, indicates if on SD card (green=On SD, gray=Not DL) - Per-episode action: download single via SdDownloader or play via Mp3Player - DL Missing button for missing eps in season (currently single first missing, batch reverted) - Season selector screen with cached/total counts - Top-right X close button - Seasons/episodes cached to cache.json to avoid network fetch every launch - Fixes: overlay deletion race (deferred timer), ui_timer leak causing crash on close, season selection overwritten by fetch task - Fixes: unicode ellipsis squares - SdDownloader: revert to stable single-file mode (batch array caused crashes) - Remove batch fields and array allocation, keep single url/path download - Result bundle simple success/path/bytes - Mp3Player: add resume position support (pos_sec from bundle, total_sec estimate, total_decoded_samples), return position on exit via bundle for DM to save Tested on 192.168.68.133: opens, shows S10 2/6, Play/DL buttons, close works, no crash on open/close cycles, cache shows 'Loaded from cache, refreshing...'
43 lines
809 B
C
43 lines
809 B
C
#pragma once
|
|
|
|
#include "app_context.h"
|
|
#include <stddef.h>
|
|
#include <stdbool.h>
|
|
|
|
#ifdef __cplusplus
|
|
extern "C" {
|
|
#endif
|
|
|
|
// Path helpers
|
|
void make_sd_path(char* out, size_t out_len, const char* slug);
|
|
void ensure_dir(void);
|
|
bool has_slug(const char* slug);
|
|
|
|
// LRU cache cleanup
|
|
void lru_check(void);
|
|
|
|
// Sorting
|
|
void sort_seasons(void);
|
|
void sort_eps(void);
|
|
|
|
// Time formatting
|
|
void fmt_time(char* o, int s);
|
|
|
|
// Per-episode resume helpers
|
|
int find_saved_pos_idx(const char* slug);
|
|
int get_saved_pos_for_slug(const char* slug);
|
|
void set_saved_pos_for_slug(const char* slug, int pos);
|
|
void save_current_ep_pos(void);
|
|
|
|
// Persistence
|
|
void save_state(void);
|
|
void load_state(void);
|
|
|
|
// Seasons / episodes cache (PB data, rarely changes)
|
|
bool save_cache(void);
|
|
bool load_cache(void);
|
|
|
|
#ifdef __cplusplus
|
|
}
|
|
#endif
|