@@ -1182,6 +1195,15 @@ function pp_render_album_thumbs(array $images, bool $canEdit = true): string
重算所有图集的文章字段(含缩略图宽高),供首页瀑布流按比例预占位,避免图片加载时顺序跳变。升级后跑一次即可。
+
维护失败清单
+
+
+
+
+
+
图片失败重建该图片;图集字段失败只重建该图集字段。清单保留到开始下一次新任务。
+
删除所有不是 InfinityTime 发布的 type=post 文章(不含本插件图集;会连同自定义字段一起删除)。
@@ -1212,12 +1234,7 @@ function pp_render_album_thumbs(array $images, bool $canEdit = true): string
'panoWidth' => Plugin::DEFAULT_PANO_WIDTH,
'panoQuality' => Plugin::DEFAULT_PANO_QUALITY,
],
- 'job' => [
- 'job' => (string)($ppJobState['job'] ?? ''),
- 'total' => (int)($ppJobState['total'] ?? 0),
- 'done' => (int)($ppJobState['done'] ?? 0),
- 'finished' => !empty($ppJobState['finished']),
- ],
+ 'job' => $ppJobState,
], JSON_UNESCAPED_UNICODE | JSON_HEX_TAG | JSON_HEX_AMP | JSON_HEX_APOS | JSON_HEX_QUOT); ?>;
diff --git a/usr/themes/InfinityTime/index.php b/usr/themes/InfinityTime/index.php
index ccc0d57..7eba693 100755
--- a/usr/themes/InfinityTime/index.php
+++ b/usr/themes/InfinityTime/index.php
@@ -3,7 +3,7 @@
* 一款简约的相册主题
* @package 无限时光
* @author InfinityTime
- * @version 1.14.2
+ * @version 1.15.0
* @link https://github.com/InfinityTime/InfinityTime
*/
?>
diff --git a/usr/themes/InfinityTime/lib/gallery.php b/usr/themes/InfinityTime/lib/gallery.php
index e1a2c0b..bacef85 100644
--- a/usr/themes/InfinityTime/lib/gallery.php
+++ b/usr/themes/InfinityTime/lib/gallery.php
@@ -116,6 +116,20 @@ function pp_gallery_variant($input): array
return $out;
}
+/** 只改变公开 URL,数据库文件路径保持不变,删除和重建仍定位原文件。 */
+function pp_gallery_version_url(string $url, array $exif): string
+{
+ $version = $exif['_infinity_media_version'] ?? '';
+ if ($url === '' || !is_string($version) || !preg_match('/^[a-f0-9]{32}$/D', $version)) { return $url; }
+ $fragment = explode('#', $url, 2);
+ $parts = explode('?', $fragment[0], 2);
+ $query = array_filter(explode('&', $parts[1] ?? ''), static function ($part) {
+ return $part !== '' && rawurldecode(explode('=', $part, 2)[0]) !== 'itv';
+ });
+ $query[] = 'itv=' . $version;
+ return $parts[0] . '?' . implode('&', $query) . (isset($fragment[1]) ? '#' . $fragment[1] : '');
+}
+
/** 仓库照片和仅有自定义字段的历史照片使用相同公开结构。 */
function pp_gallery_photo(array $row, int $cid, int $albumCreated, bool $legacy = false): ?array
{
@@ -127,13 +141,18 @@ function pp_gallery_photo(array $row, int $cid, int $albumCreated, bool $legacy
$id = (int)($row['id'] ?? 0) > 0 ? 'p-' . (int)$row['id'] : 'l-' . substr(hash('sha256', $cid . "\n" . $url), 0, 20);
$month = pp_gallery_month($exif, (int)($row['created'] ?? 0) ?: $albumCreated);
if ($legacy && preg_match('/^[1-9]\d{3}-(0[1-9]|1[0-2])$/D', (string)($row['month'] ?? ''))) { $month = $row['month']; }
+ $revision = !$legacy ? pp_gallery_json_array($row['exif'] ?? []) : [];
+ $variants = pp_gallery_variant($row['variants'] ?? []);
+ foreach (['webp', 'avif'] as $format) {
+ $variants[$format] = array_map(static function ($value) use ($revision) { return pp_gallery_version_url($value, $revision); }, $variants[$format]);
+ }
return [
- 'id' => $id, 'url' => $url, 'preview' => pp_gallery_media_url($row['thumb'] ?? '') ?: $url,
+ 'id' => $id, 'url' => pp_gallery_version_url($url, $revision), 'preview' => pp_gallery_version_url(pp_gallery_media_url($row['thumb'] ?? '') ?: $url, $revision),
'title' => pp_gallery_text($row['title'] ?? '', 300), 'description' => pp_gallery_text($row['desc'] ?? ''),
'address' => pp_gallery_text($row['address'] ?? '', 300), 'exif' => $exif,
'pano' => ($width > 0 && $height > 0) ? ($width / $height >= 1.98 && $width / $height <= 2.02) : !empty($row['pano']),
'width' => $width, 'height' => $height, 'month' => $month,
- 'variants' => pp_gallery_variant($row['variants'] ?? []),
+ 'variants' => $variants,
];
}
diff --git a/usr/themes/InfinityTime/releases.json b/usr/themes/InfinityTime/releases.json
index dc628c9..f7f6e92 100644
--- a/usr/themes/InfinityTime/releases.json
+++ b/usr/themes/InfinityTime/releases.json
@@ -1,4 +1,4 @@
{
- "tag_name": "1.14.2"
+ "tag_name": "1.15.0"
}
diff --git a/usr/themes/InfinityTime/update.md b/usr/themes/InfinityTime/update.md
index bf786f2..d04446e 100644
--- a/usr/themes/InfinityTime/update.md
+++ b/usr/themes/InfinityTime/update.md
@@ -1,6 +1,10 @@
# 更新日志
-## 未发布
+## 1.15.0
+
+- 维护失败项按图片/相册保存安全原因,支持分页查看和仅重试失败项;字段同步失败不重复编码,刷新保留任务身份,过期请求和异类任务覆盖被拒绝。旧版未记录明细的失败计数会明确提示。
+
+- 重建成功后为公开派生图生成新的缓存标识,前台主图、缩略图、WebP/AVIF变体和聚合字段同步更新;照片ID与物理路径不变,旧字段相册链接不改写。CDN需把查询参数纳入缓存键。
- 新增手机省流选择:跟随系统建议或手动切换,省流时不自动翻页、不预取相邻大图;主动看图和加载更多不受影响。后台标签页暂停额外加载并释放预取引用。
- 新增管理员只读健康检查和隔离恢复演练步骤;原图保护与备份可恢复性明确要求人工核验,不修改服务器配置。
From 38c1868e242c2d2a4e599406f2bc2dd635a4fa3c Mon Sep 17 00:00:00 2001
From: Thregren <37279823+Thregren@users.noreply.github.com>
Date: Thu, 8 Oct 2026 03:37:53 -0700
Subject: [PATCH 3/3] =?UTF-8?q?=E4=BF=9D=E7=95=99=E6=97=A7=E7=BB=B4?=
=?UTF-8?q?=E6=8A=A4=E5=A4=B1=E8=B4=A5=E6=8F=90=E7=A4=BA=E5=B9=B6=E6=94=B6?=
=?UTF-8?q?=E7=B4=A7=E5=BC=82=E5=B8=B8=E8=BE=93=E5=87=BA?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
.github/workflows/ci.yml | 2 +-
tests/gallery-loading-browser.cjs | 18 +++++++---
tests/maintenance-panel.php | 8 ++++-
tests/maintenance-state.php | 11 ++++++
.../InfinityTime/Lib/MaintenanceState.php | 36 +++++++++++--------
usr/plugins/InfinityTime/panel.php | 3 +-
6 files changed, 56 insertions(+), 22 deletions(-)
diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml
index dfcee1e..72e18e6 100644
--- a/.github/workflows/ci.yml
+++ b/.github/workflows/ci.yml
@@ -52,7 +52,7 @@ jobs:
php tests/media-temp.php
php tests/health-diagnostics.php
php tests/maintenance-state.php
- for mode in retry-image retry-fields retry-mixed retry-resync retry-repeat retry-finished retry-stale retry-empty retry-unfinished retry-other-job errors-page errors-stale resync-failure rebuild-sync-failure rebuild-success rebuild-batch rebuild-restart rebuild-resume rebuild-start-reuse rebuild-no-original rebuild-missing-original rebuild-conversion-failure stale-poll finished-poll delete-non-plugin delete-rollback lease-conflict; do
+ for mode in scan-failure retry-image retry-fields retry-mixed retry-resync retry-repeat retry-finished retry-stale retry-empty retry-unfinished retry-other-job errors-page errors-stale resync-failure rebuild-sync-failure rebuild-success rebuild-batch rebuild-restart rebuild-resume rebuild-start-reuse rebuild-no-original rebuild-missing-original rebuild-conversion-failure stale-poll finished-poll delete-non-plugin delete-rollback lease-conflict; do
php tests/maintenance-panel.php "$mode"
done
php tests/admin-workflow.php
diff --git a/tests/gallery-loading-browser.cjs b/tests/gallery-loading-browser.cjs
index 4004ed4..6514101 100644
--- a/tests/gallery-loading-browser.cjs
+++ b/tests/gallery-loading-browser.cjs
@@ -100,10 +100,20 @@ const pixel = '