feat: Add local media cache configuration and management features#495
Merged
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
cache.local.image_max_mb和cache.local.video_max_mbDATA_DIR派生cache.local配置说明zh / en / ja / es / de / fr6 份 i18n,避免新增 key 只落部分语言Testing
uv run ruff check app/platform/storage/media_cache.py app/platform/storage/media_paths.py app/platform/storage/__init__.py app/products/openai/images.py app/products/openai/chat.py app/products/openai/video.py app/products/web/admin/cache.py app/products/web/admin/__init__.py app/main.py tests/test_local_media_cache.pyuv run python -m compileall app/platform/storage/media_cache.py app/platform/storage/media_paths.py app/platform/storage/__init__.py app/products/openai/images.py app/products/openai/chat.py app/products/openai/video.py app/products/web/admin/cache.py app/products/web/admin/__init__.py app/main.py tests/test_local_media_cache.pyuv run python -m unittest tests.test_local_media_cacheuv run python -c "import json, pathlib, tomllib; json.loads(pathlib.Path('app/statics/i18n/zh.json').read_text()); json.loads(pathlib.Path('app/statics/i18n/en.json').read_text()); json.loads(pathlib.Path('app/statics/i18n/ja.json').read_text()); json.loads(pathlib.Path('app/statics/i18n/es.json').read_text()); json.loads(pathlib.Path('app/statics/i18n/de.json').read_text()); json.loads(pathlib.Path('app/statics/i18n/fr.json').read_text()); tomllib.loads(pathlib.Path('config.defaults.toml').read_text()); print('ok')".venv/bin/python下执行了缓存页/缓存统计轻量 smoke,确认:/admin/api/cache返回limit_mb / limit_bytes / usage_ratio / usage_percent / limitedRelated