영상 캐시 기능 추가: 시작 시 미리받기 + 동적 재생 + FIFO 축출 + 주소 / 자동제거
- config 에 preload(미리받기 갯수)/keep(유지 갯수) 추가 - 시작 시 1..preload 캐시 미리받기, 재생 중에도 preload 개 앞까지 롤링 prefetch - 재생 시 캐시 있으면 video_N, 없으면 전체 URL 로 동적 선택(데이터팩 self-tracking) - keep 초과 시 가장 먼저 받은 캐시부터 삭제(FIFO) - namespace 끝 / 자동 제거(normalize) - command_block 한 tick 1회 발동 제약 회피: cache add/remove 직접 실행, clear 는 schedule Co-Authored-By: Claude Opus 4 <noreply@anthropic.com>
This commit is contained in:
7
music_quiz/data/mq/function/videos/normalize.mcfunction
Normal file
7
music_quiz/data/mq/function/videos/normalize.mcfunction
Normal file
@@ -0,0 +1,7 @@
|
||||
# namespace 끝에 / 가 붙어 있으면 제거 (config 오타 방어).
|
||||
# string 소스 마지막 글자만 떼서 비교 후, 맞으면 마지막 글자를 잘라낸다.
|
||||
data modify storage mq:tmp ns_last set string storage mq:main video.namespace -1
|
||||
execute if data storage mq:tmp {ns_last:"/"} run data modify storage mq:main video.namespace set string storage mq:main video.namespace 0 -1
|
||||
|
||||
# 캐시 추적 목록 초기화 (videoCache add/remove 와 1:1 로 관리되는 {i:N} 리스트)
|
||||
data modify storage mq:main video.cached set value []
|
||||
Reference in New Issue
Block a user