Skip to content

Commit fd4bbe0

Browse files
author
hjy
committed
所有任务已完成。任务1用户主动跳过;任务2删除 archive.tsx 改用 explorer + archivePath 参数实现解压跳转,复用 FileViewContainer 三种视图;任务3将 filePath 重命名为 sourceFolderPath 并移除向后兼容。本次修复了 explorer.tsx 最后3处 navigate 缺少 archivePath: "" 的 TS 错误,构建通过。
1 parent 0883d48 commit fd4bbe0

File tree

11 files changed

+149
-17
lines changed

11 files changed

+149
-17
lines changed
Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
1[thumb] Failed to generate thumbnail for E:\_Happy_Picture\Unread\ZinieQ - Sameko Saba (videos).zip: Error: No image found in archive after extraction to C:\Users\hjyss\AppData\Local\Temp\shiguthumb-DEJvQU
2+
at generateArchiveThumb (D:\Git\Shigureader-vibecode\backendnode\src\services\thumbService.ts:65:27)
3+
at process.processTicksAndRejections (node:internal/process/task_queues:103:5)
4+
at async <anonymous> (D:\Git\Shigureader-vibecode\backendnode\src\services\thumbService.ts:147:9)
5+
[thumb] Failed to generate thumbnail for E:\_Happy_Picture\Unread\悲伤小木 桃乐丝宴桃源.zip: Error: Command failed: D:\Git\Shigureader-vibecode\backendnode\tools\7zip-lite\7z.exe e E:\_Happy_Picture\Unread\悲伤小木 桃乐丝宴桃源.zip -oC:\Users\hjyss\AppData\Local\Temp\shiguthumb-L8GQx9 -y -r *.jpg *.jpeg *.png *.webp *.bmp *.gif *.heic
6+
7+
at genericNodeError (node:internal/errors:985:15)
8+
at wrappedFn (node:internal/errors:539:14)
9+
at ChildProcess.exithandler (node:child_process:417:12)
10+
at ChildProcess.emit (node:events:508:28)
11+
at maybeClose (node:internal/child_process:1101:16)
12+
at ChildProcess._handle.onexit (node:internal/child_process:305:5) {
13+
code: null,
14+
killed: true,
15+
signal: 'SIGTERM',
16+
cmd: 'D:\\Git\\Shigureader-vibecode\\backendnode\\tools\\7zip-lite\\7z.exe e E:\\_Happy_Picture\\Unread\\悲伤小木 桃乐丝宴桃源.zip -oC:\\Users\\hjyss\\AppData\\Local\\Temp\\shiguthumb-L8GQx9 -y -r *.jpg *.jpeg *.png *.webp *.bmp *.gif *.heic',
17+
stdout: '\r\n' +
18+
'7-Zip 25.01 (x64) : Copyright (c) 1999-2025 Igor Pavlov : 2025-08-03\r\n' +
19+
'\r\n' +
20+
'Scanning the drive for archives:\r\n' +
21+
'1 file, 772498265 bytes (737 MiB)\r\n' +
22+
'\r\n' +
23+
'Extracting archive: E:\\_Happy_Picture\\Unread\\����Сľ ����˿����Դ.zip\r\n',
24+
stderr: ''
25+
}
26+
27+
28+
好像是因为encoding导致的问题吗
29+
30+
31+
32+
2
33+
同一个文件
34+
http://localhost:5173/read?path=D%3A%5C_TEMP_DOWNLOADS%5C%E6%B0%B4%E6%B7%BCaqua+Summer+Dress.zip&source=archive&page=0&sourceFolderPath= 会导致bad request
35+
http://localhost:5173/read?path=D%3A%5C_TEMP_DOWNLOADS%5C%E6%B0%B4%E6%B7%BCaqua+Summer+Dress.zip&source=archive&page=0&sourceFolderPath= 这个正常
36+
37+
是内部状态问题吗
38+
我打开reader点右上角的explorer然后按回退回去就上面的bad request了

bug.txt

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
1[thumb] Failed to generate thumbnail for E:\_Happy_Picture\Unread\ZinieQ - Sameko Saba (videos).zip: Error: No image found in archive after extraction to C:\Users\hjyss\AppData\Local\Temp\shiguthumb-DEJvQU
2+
at generateArchiveThumb (D:\Git\Shigureader-vibecode\backendnode\src\services\thumbService.ts:65:27)
3+
at process.processTicksAndRejections (node:internal/process/task_queues:103:5)
4+
at async <anonymous> (D:\Git\Shigureader-vibecode\backendnode\src\services\thumbService.ts:147:9)
5+
[thumb] Failed to generate thumbnail for E:\_Happy_Picture\Unread\悲伤小木 桃乐丝宴桃源.zip: Error: Command failed: D:\Git\Shigureader-vibecode\backendnode\tools\7zip-lite\7z.exe e E:\_Happy_Picture\Unread\悲伤小木 桃乐丝宴桃源.zip -oC:\Users\hjyss\AppData\Local\Temp\shiguthumb-L8GQx9 -y -r *.jpg *.jpeg *.png *.webp *.bmp *.gif *.heic
6+
7+
at genericNodeError (node:internal/errors:985:15)
8+
at wrappedFn (node:internal/errors:539:14)
9+
at ChildProcess.exithandler (node:child_process:417:12)
10+
at ChildProcess.emit (node:events:508:28)
11+
at maybeClose (node:internal/child_process:1101:16)
12+
at ChildProcess._handle.onexit (node:internal/child_process:305:5) {
13+
code: null,
14+
killed: true,
15+
signal: 'SIGTERM',
16+
cmd: 'D:\\Git\\Shigureader-vibecode\\backendnode\\tools\\7zip-lite\\7z.exe e E:\\_Happy_Picture\\Unread\\悲伤小木 桃乐丝宴桃源.zip -oC:\\Users\\hjyss\\AppData\\Local\\Temp\\shiguthumb-L8GQx9 -y -r *.jpg *.jpeg *.png *.webp *.bmp *.gif *.heic',
17+
stdout: '\r\n' +
18+
'7-Zip 25.01 (x64) : Copyright (c) 1999-2025 Igor Pavlov : 2025-08-03\r\n' +
19+
'\r\n' +
20+
'Scanning the drive for archives:\r\n' +
21+
'1 file, 772498265 bytes (737 MiB)\r\n' +
22+
'\r\n' +
23+
'Extracting archive: E:\\_Happy_Picture\\Unread\\����Сľ ����˿����Դ.zip\r\n',
24+
stderr: ''
25+
}
26+
27+
28+
好像是因为encoding导致的问题吗
29+
30+
31+
32+
2
33+
同一个文件
34+
http://localhost:5173/read?path=D%3A%5C_TEMP_DOWNLOADS%5C%E6%B0%B4%E6%B7%BCaqua+Summer+Dress.zip&source=archive&page=0&sourceFolderPath= 会导致bad request
35+
http://localhost:5173/read?path=D%3A%5C_TEMP_DOWNLOADS%5C%E6%B0%B4%E6%B7%BCaqua+Summer+Dress.zip&source=archive&page=0&sourceFolderPath= 这个正常
36+
37+
是内部状态问题吗
38+
我打开reader点右上角的explorer然后按回退回去就上面的bad request了

frontend/src/components/Common/FileNotFoundError.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ export function FileNotFoundError({
5757
{parentPath && (
5858
<Link
5959
to="/explorer"
60-
search={{ path: parentPath, page: 1, pageSize: 48, sortField: "mtime", sortOrder: "desc" }}
60+
search={{ path: parentPath, archivePath: "", page: 1, pageSize: 48, sortField: "mtime", sortOrder: "desc" }}
6161
className={buttonVariants({ variant: "outline" })}
6262
>
6363
{t("explorer.openParent")}

frontend/src/components/Files/FileItem.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -188,7 +188,7 @@ function buildItemHref(item: FileSystemItem, isMobile: boolean): string | null {
188188
params.set("path", item.path)
189189
params.set("source", "archive")
190190
params.set("page", "0")
191-
params.set("filePath", "")
191+
params.set("sourceFolderPath", "")
192192
const route = isMobile ? "/read-mobile" : "/read"
193193
return `${route}?${params.toString()}`
194194
}
@@ -208,7 +208,7 @@ function buildItemHref(item: FileSystemItem, isMobile: boolean): string | null {
208208
params.set("path", getParentPath(item.path))
209209
params.set("source", "folder")
210210
params.set("page", "0")
211-
params.set("filePath", item.path)
211+
params.set("sourceFolderPath", item.path)
212212
const route = isMobile ? "/read-mobile" : "/read"
213213
return `${route}?${params.toString()}`
214214
}

frontend/src/components/Files/FileViewContainer.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -544,7 +544,7 @@ export function FileViewContainer({
544544
item.item_type === "folder"
545545
? {
546546
to: "/explorer" as const,
547-
search: { path: item.path, page: 1, pageSize: 48, sortField: "mtime" as const, sortOrder: "desc" as const },
547+
search: { path: item.path, archivePath: "" as const, page: 1, pageSize: 48, sortField: "mtime" as const, sortOrder: "desc" as const },
548548
}
549549
: {
550550
to: "/video" as const,

frontend/src/hooks/useFileNavigation.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ export function buildNavigationTarget(item: FileSystemItem, isMobile: boolean) {
1717
if (isFolder) {
1818
return {
1919
to: "/explorer" as const,
20-
search: { path: item.path, page: 1, pageSize: 48, sortField: "mtime" as const, sortOrder: "desc" as const },
20+
search: { path: item.path, archivePath: "" as const, page: 1, pageSize: 48, sortField: "mtime" as const, sortOrder: "desc" as const },
2121
}
2222
}
2323
if (isArchive) {

frontend/src/routes/_layout/explorer.tsx

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ export const Route = createFileRoute("/_layout/explorer")({
5858
return {
5959
path: (search.path as string) || "",
6060
// archivePath: 当从 archive 文件跳转过来时携带,Explorer 内部触发解压后清除
61-
archivePath: (search.archivePath as string) || undefined,
61+
archivePath: (search.archivePath as string) || "",
6262
page,
6363
pageSize,
6464
sortField: sortFieldCandidates.includes(rawSortField as SortField)
@@ -113,7 +113,7 @@ function Explorer() {
113113
const { isExtracting } = useArchiveExtract(archivePath, (cacheDir) => {
114114
navigate({
115115
to: "/explorer",
116-
search: { path: cacheDir, page: 1, pageSize, sortField, sortOrder },
116+
search: { path: cacheDir, archivePath: "", page: 1, pageSize, sortField, sortOrder },
117117
replace: true,
118118
})
119119
})
@@ -149,14 +149,15 @@ function Explorer() {
149149
(newPath) => {
150150
navigate({
151151
to: "/explorer",
152-
search: { path: newPath, page: 1, pageSize, sortField, sortOrder },
152+
search: { path: newPath, archivePath: "", page: 1, pageSize, sortField, sortOrder },
153153
replace: true,
154154
})
155155
},
156156
)
157157

158158
const buildSearchForPath = (nextPath: string) => ({
159159
path: nextPath,
160+
archivePath: "",
160161
page: 1,
161162
pageSize,
162163
sortField,
@@ -275,14 +276,14 @@ function Explorer() {
275276
onSortFieldChange={(nextSortField) =>
276277
navigate({
277278
to: "/explorer",
278-
search: { path, page: 1, pageSize, sortField: nextSortField, sortOrder },
279+
search: { path, archivePath: "", page: 1, pageSize, sortField: nextSortField, sortOrder },
279280
replace: true,
280281
})
281282
}
282283
onSortOrderChange={(nextSortOrder) =>
283284
navigate({
284285
to: "/explorer",
285-
search: { path, page: 1, pageSize, sortField, sortOrder: nextSortOrder },
286+
search: { path, archivePath: "", page: 1, pageSize, sortField, sortOrder: nextSortOrder },
286287
replace: true,
287288
})
288289
}
@@ -292,7 +293,7 @@ function Explorer() {
292293
onChange: ({ page: nextPage, pageSize: nextPageSize }) =>
293294
navigate({
294295
to: "/explorer",
295-
search: { path, page: nextPage, pageSize: nextPageSize, sortField, sortOrder },
296+
search: { path, archivePath: "", page: nextPage, pageSize: nextPageSize, sortField, sortOrder },
296297
replace: true,
297298
}),
298299
}}

frontend/src/routes/_layout/index.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ function HomeFolderLinkCard({
4444
return (
4545
<Link
4646
to="/explorer"
47-
search={{ path, page: 1, pageSize: 48, sortField: "mtime", sortOrder: "desc" }}
47+
search={{ path, archivePath: "", page: 1, pageSize: 48, sortField: "mtime", sortOrder: "desc" }}
4848
className="home-card-link"
4949
title={name}
5050
>
@@ -156,7 +156,7 @@ function Dashboard() {
156156
<h2 className="home-section__title">{t("home.drives")}</h2>
157157
<div className="home-grid home-grid--drives">
158158
{drives.map((drive) => (
159-
<Link key={drive.path} to="/explorer" search={{ path: drive.path, page: 1, pageSize: 48, sortField: "mtime", sortOrder: "desc" }} className="home-card-link">
159+
<Link key={drive.path} to="/explorer" search={{ path: drive.path, archivePath: "", page: 1, pageSize: 48, sortField: "mtime", sortOrder: "desc" }} className="home-card-link">
160160
<HomeCard icon={HardDrive} title={drive.dirname} />
161161
</Link>
162162
))}

frontend/src/routes/_layout/read-mobile.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ export const Route = createFileRoute("/_layout/read-mobile")({
1919
page: Number(search.page) || 0,
2020
source: (search.source as "archive" | "folder") || "archive",
2121
// sourceFolderPath: 仅 source=folder 时有效,用于定位到特定图片
22-
sourceFolderPath: (search.sourceFolderPath as string) || (search.filePath as string) || "",
22+
sourceFolderPath: (search.sourceFolderPath as string) || "",
2323
}),
2424
head: () => ({
2525
meta: [{ title: "Reader Mobile" }],
@@ -184,7 +184,7 @@ function ReadMobilePage() {
184184
navigate({
185185
to: "/explorer",
186186
search: isFolderSource
187-
? { path, page: 1, pageSize: 48, sortField: "mtime", sortOrder: "desc" }
187+
? { path, archivePath: "", page: 1, pageSize: 48, sortField: "mtime", sortOrder: "desc" }
188188
: { path, archivePath: path, page: 1, pageSize: 48, sortField: "mtime", sortOrder: "desc" },
189189
})
190190
}

frontend/src/routes/_layout/read.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ export const Route = createFileRoute("/_layout/read")({
6767
// sourceFolderPath: 仅 source=folder 时有效。
6868
// 用于从外部(如 explorer 点击某张图片)跳转到阅读器时定位到特定图片。
6969
// 解析后会被 replace 成对应的 page 数字,之后 sourceFolderPath 置空。
70-
sourceFolderPath: (search.sourceFolderPath as string) || (search.filePath as string) || "",
70+
sourceFolderPath: (search.sourceFolderPath as string) || "",
7171
mode: (search.mode as "audio") || undefined,
7272
}),
7373
head: () => ({
@@ -412,7 +412,7 @@ function ReadPage() {
412412
navigate({
413413
to: "/explorer",
414414
search: isFolderSource
415-
? { path, page: 1, pageSize: 48, sortField: "mtime", sortOrder: "desc" }
415+
? { path, archivePath: "", page: 1, pageSize: 48, sortField: "mtime", sortOrder: "desc" }
416416
: { path, archivePath: path, page: 1, pageSize: 48, sortField: "mtime", sortOrder: "desc" },
417417
})
418418
} else if (key === "v") {

0 commit comments

Comments
 (0)