mirror of
https://github.com/Cp0204/quark-auto-save.git
synced 2026-01-16 01:10:44 +08:00
Compare commits
5 Commits
efc2be761f
...
f9730f2994
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
f9730f2994 | ||
|
|
6e72dee20d | ||
|
|
8036e3256b | ||
|
|
070e409dc4 | ||
|
|
842730e3dd |
11
README.md
11
README.md
@ -38,7 +38,7 @@
|
||||
- [x] 支持分享链接的子目录
|
||||
- [x] 记录失效分享并跳过任务
|
||||
- [x] 支持需提取码的分享链接 <sup>[?](https://github.com/x1ao4/quark-auto-save-x/wiki/使用技巧集锦#支持需提取码的分享链接)</sup>
|
||||
- [x] 智能搜索资源并自动填充(**支持自动过滤失效链接**) <sup>[?](https://github.com/x1ao4/quark-auto-save-x/wiki/CloudSaver搜索源)</sup>
|
||||
- [x] 智能搜索资源并自动填充(**支持自动过滤失效链接**) <sup>[?](https://github.com/x1ao4/quark-auto-save-x/wiki/资源搜索)</sup>
|
||||
|
||||
- 文件管理
|
||||
- [x] 目标目录不存在时自动新建
|
||||
@ -63,9 +63,9 @@
|
||||
|
||||
- 其它
|
||||
- [x] 每日签到领空间 <sup>[?](https://github.com/x1ao4/quark-auto-save-x/wiki/使用技巧集锦#每日签到领空间)</sup>
|
||||
- [x] 支持多个通知推送渠道 <sup>[?](https://github.com/x1ao4/quark-auto-save-x/wiki/通知推送服务配置)</sup>
|
||||
- [x] 支持多个通知推送渠道 <sup>[?](https://github.com/x1ao4/quark-auto-save-x/wiki/通知设置)</sup>
|
||||
- [x] 支持多账号(多账号签到、**文件管理**,仅首账号转存)
|
||||
- [x] 支持网盘文件下载、strm 文件生成等功能 <sup>[?](https://github.com/x1ao4/quark-auto-save-x/wiki/插件配置)</sup>
|
||||
- [x] 支持网盘文件下载、strm 文件生成等功能 <sup>[?](https://github.com/x1ao4/quark-auto-save-x/wiki/插件设置)</sup>
|
||||
- [x] **支持通过追剧日历功能了解订阅内容的播出情况**
|
||||
|
||||
## 部署
|
||||
@ -86,7 +86,6 @@ docker run -d \
|
||||
Docker Compose(推荐)
|
||||
|
||||
```yaml
|
||||
version: "3.3"
|
||||
services:
|
||||
quark-auto-save-x:
|
||||
image: x1ao4/quark-auto-save-x:latest
|
||||
@ -130,10 +129,10 @@ services:
|
||||
| `乘风2025 - S06E{}` | | 按照文件顺序命名,`{}` 会被代入序号,新增项目序号在已存在的最大序号的基础上递增 |
|
||||
| `黑镜 - S07E[]` | | 自动识别文件名中的集编号,`[]` 会被代入从文件名中自动提取的集编号 |
|
||||
|
||||
更多正则使用说明:[正则处理教程](https://github.com/x1ao4/quark-auto-save-x/wiki/正则处理教程)
|
||||
更多正则使用说明:[命名规则](https://github.com/x1ao4/quark-auto-save-x/wiki/命名规则)
|
||||
|
||||
### 刷新媒体库
|
||||
在有新转存时,可触发完成相应功能,如自动刷新媒体库、生成 .strm 文件等。配置指南:[插件配置](https://github.com/x1ao4/quark-auto-save-x/wiki/插件配置)
|
||||
在有新转存时,可触发完成相应功能,如自动刷新媒体库、生成 .strm 文件等。配置指南:[插件设置](https://github.com/x1ao4/quark-auto-save-x/wiki/插件设置)
|
||||
|
||||
媒体库模块以插件的方式的集成,如果你有兴趣请参考[插件开发指南](https://github.com/x1ao4/quark-auto-save-x/tree/x/plugins)。
|
||||
|
||||
|
||||
31
app/run.py
31
app/run.py
@ -699,10 +699,13 @@ def favicon():
|
||||
def serve_cache_images(filename):
|
||||
resp = send_from_directory(CACHE_IMAGES_DIR, filename)
|
||||
try:
|
||||
# 禁用强缓存,允许协商缓存
|
||||
resp.headers['Cache-Control'] = 'no-cache, no-store, must-revalidate, max-age=0'
|
||||
resp.headers['Pragma'] = 'no-cache'
|
||||
resp.headers['Expires'] = '0'
|
||||
# 启用长期缓存:依赖前端通过 `?t=` 穿透参数在变更时刷新
|
||||
# 说明:图片文件名稳定且内容稳定,正常情况应命中浏览器缓存;
|
||||
# 当用户主动更换海报时,前端会为该节目生成新的时间戳参数,形成新的 URL,从而触发重新下载。
|
||||
resp.headers['Cache-Control'] = 'public, max-age=31536000, immutable'
|
||||
# 清理可能的历史字段(部分代理可能保留)
|
||||
resp.headers.pop('Pragma', None)
|
||||
resp.headers.pop('Expires', None)
|
||||
except Exception:
|
||||
pass
|
||||
return resp
|
||||
@ -4353,6 +4356,11 @@ def redownload_all_posters():
|
||||
# 更新数据库中的海报路径
|
||||
cal_db.update_show_poster(int(tmdb_id), poster_local_path)
|
||||
success_count += 1
|
||||
# 通知前端该节目海报已更新
|
||||
try:
|
||||
notify_calendar_changed(f'poster_updated:{int(tmdb_id)}')
|
||||
except Exception:
|
||||
pass
|
||||
|
||||
except Exception as e:
|
||||
logging.error(f"重新下载海报失败 (TMDB ID: {show.get('tmdb_id')}): {e}")
|
||||
@ -4505,7 +4513,7 @@ def download_custom_poster(poster_url: str, tmdb_id: int, target_safe_name: str
|
||||
with open(file_path, 'wb') as f:
|
||||
f.write(r.content)
|
||||
|
||||
logging.info(f"成功保存自定义海报: {poster_url} -> {file_path}")
|
||||
# 自定义海报保存成功(静默)
|
||||
return f"/cache/images/{safe_name}"
|
||||
|
||||
except Exception as e:
|
||||
@ -4820,6 +4828,12 @@ def calendar_refresh_show():
|
||||
|
||||
try:
|
||||
notify_calendar_changed('refresh_show')
|
||||
# 通知前端指定节目海报可能已更新,用于触发按节目维度的缓存穿透
|
||||
try:
|
||||
if tmdb_id:
|
||||
notify_calendar_changed(f'poster_updated:{int(tmdb_id)}')
|
||||
except Exception:
|
||||
pass
|
||||
except Exception:
|
||||
pass
|
||||
|
||||
@ -5155,8 +5169,13 @@ def calendar_edit_metadata():
|
||||
# 即使对比失败也不影响功能
|
||||
pass
|
||||
|
||||
logging.info(f"成功更新自定义海报: TMDB ID {current_tmdb_id}, 路径: {saved_path}")
|
||||
# 成功更新自定义海报(静默)
|
||||
changed = True
|
||||
# 仅当自定义海报保存成功时,通知前端该节目海报已更新
|
||||
try:
|
||||
notify_calendar_changed(f'poster_updated:{int(current_tmdb_id)}')
|
||||
except Exception:
|
||||
pass
|
||||
else:
|
||||
logging.warning(f"自定义海报保存失败: {custom_poster_url}")
|
||||
except Exception as e:
|
||||
|
||||
@ -5531,6 +5531,18 @@
|
||||
let changeReason = '';
|
||||
try { changeReason = JSON.parse(ev && ev.data || '{}').reason || ''; } catch (e) {}
|
||||
|
||||
// 如果是海报更新通知(poster_updated:<tmdb_id>),为该节目设置缓存穿透,避免使用旧缓存
|
||||
try {
|
||||
if (typeof changeReason === 'string' && changeReason.startsWith('poster_updated:')) {
|
||||
const idStr = changeReason.split(':')[1] || '';
|
||||
const eid = parseInt(idStr, 10);
|
||||
if (!isNaN(eid)) {
|
||||
const nowTick = Date.now();
|
||||
this.$set(this.imageCacheBustById, eid, nowTick);
|
||||
}
|
||||
}
|
||||
} catch (e) {}
|
||||
|
||||
// 先拉取最新转存信息并重建映射(用于管理视图与进度判定)
|
||||
try {
|
||||
const latestRes = await axios.get('/task_latest_info');
|
||||
|
||||
Loading…
Reference in New Issue
Block a user