feat(ncm): 三期第二批 — 中文搜索接拼音IME+设置页做好(音质全档/缓存上限可设数字+清理缓存/关于)+缓存LRU淘汰接生产路径(写前写后+手动调低上限)
- 搜索页输入框 MEOW_IME_ASCII→MEOW_IME_PINYIN: 候选上屏UTF-8经 on_change 实时回写 g_st.search_query, 键盘「拼/英」「中」切换, 英文零回归; 搜索仍仅在点「搜索」时发 cloudsearch(风控) - 设置页 5 行: 音质(Hi-Res 默认,Lossless/Exhigh/Higher/Standard 全档,core 既有降级链)/缓存上限(1~100GB 预设+「自定义」NUM IME 数字输入,默认10上限100)/清理缓存(显示当前占用,ncm_cache_clear)/退出登录/关于行 - 缓存淘汰接线: ncm_cache_evict 进生产路径 — player_manager(下载写前/写后)+cover(写前/写后)+appstate_save_settings(手动调低上限立即淘汰); 封面与 mp3 同池; 上限读设置值 - core 新增 ncm_cache_clear; 设置持久化走 meow_config_* → MeowData/dev.player.ncm/data - bench/cache_evict_sim.c 离线回归(0网络) 6 组 PASS; pagination_sim/core(host+mipsel/qemu)/6页宿主渲染 全过; mipsel -Wall -Wextra 0 warning (未动 sdk/、meow_launcherd/、vendor/;0 真实 NCM 请求;真机部署留用户)
This commit is contained in:
1 parent
1a239c5eab
commit
f23720f934
13 files changed
+469
-33
No files matched your search
@@ -120,6 +120,9 @@ static int song_local_file(int idx, char *path, size_t psz, int64_t *bytes)
|
||||
if (rc != NCM_OK) return rc;
|
||||
if (!u.url[0]) return NCM_ERR_NOTFOUND;
|
||||
|
||||
/* 写前检查:池大小超限先按 LRU 淘汰(此线程尚未开 temp,无在途文件被误删风险) */
|
||||
ncm_cache_evict(&g_st.ctx.cache);
|
||||
|
||||
/* 流式下载到缓存 temp → commit(稳妥者:先落盘再播) */
|
||||
ncm_cache_writer_t *w = NULL;
|
||||
rc = ncm_cache_open(&g_st.ctx.cache, id, ".mp3", &w);
|
||||
@@ -143,6 +146,8 @@ static int song_local_file(int idx, char *path, size_t psz, int64_t *bytes)
|
||||
}
|
||||
rc = ncm_cache_commit(w);
|
||||
if (rc != 0) return rc;
|
||||
/* 写后检查:新落盘可能把池推过上限 → 再按 LRU 淘汰最旧(刚写的 mtime 最新,存活) */
|
||||
ncm_cache_evict(&g_st.ctx.cache);
|
||||
if (ncm_cache_lookup(&g_st.ctx.cache, id, ".mp3", path, psz) != NCM_OK)
|
||||
return NCM_ERR_NOENT;
|
||||
struct stat st;
|
||||
|
||||
Reference in new issue
Block a user