touchClassAccess static method
更新某节课的最近访问时间(写入 playback_cache/{safeId}/.last_access)。
后台预下载(老师/白板视频)触发前与进入课堂时调用,为 LRU 淘汰提供时间戳。
Implementation
static Future<void> touchClassAccess(String classId) async {
final ctl = PlayBackController();
final safeId = ctl._safeId(classId.trim());
final cacheDir = await ctl._ensureCacheDir();
final classDir = Directory(p.join(cacheDir.path, safeId));
if (!await classDir.exists()) {
await classDir.create(recursive: true);
}
final f = File(p.join(classDir.path, '.last_access'));
await f.writeAsString(DateTime.now().toIso8601String());
}