Peach: Local-first video metadata scraper and media manager.
feat(desktop): 提供轻量安装包并精简下载说明
longmeidaoc1391366fee5
diff --git a/.github/workflows/release.yml b/.github/workflows/release.ymlindex 17a42062c..2ddbc2052 100644--- a/.github/workflows/release.yml+++ b/.github/workflows/release.yml@@ -146,7 +146,7 @@ jobs:shell: pwshrun: |New-Item -ItemType Directory -Path release | Out-Null- python scripts/package_windows_release.py --source dist/Peach --output release --version '${{ steps.version.outputs.version }}'+ python scripts/package_windows_release.py --source dist/Peach --output release --version '${{ steps.version.outputs.version }}' --lite-installerif ($LASTEXITCODE -ne 0) { throw '发行包拆分失败' }Copy-Item 'dist/Peach-${{ steps.version.outputs.version }}-windows-x64-setup.exe' release/Copy-Item dist/ffmpeg-corresponding-source.zip release/@@ -185,7 +185,7 @@ jobs:- name: 从应用更新包与独立工具包重建并验证运行shell: pwshrun: |- python smoke_split_update.py --version '${{ needs.windows.outputs.version }}' --destination split-candidate+ python smoke_split_update.py --version '${{ needs.windows.outputs.version }}' --destination split-candidate --prepare-with-appif ($LASTEXITCODE -ne 0) { throw '拆分制品与完整包不一致' }python smoke_desktop.py split-candidate/Peach/Peach.exeif ($LASTEXITCODE -ne 0) { throw '拆分制品运行验收失败' }@@ -207,6 +207,19 @@ jobs:while ((Test-Path -LiteralPath $Installed) -and (Get-Date) -lt $Deadline) { Start-Sleep -Seconds 1 }if (Test-Path -LiteralPath $Installed) { throw '卸载后程序目录仍在' }if ((Test-Path -LiteralPath $Key) -or (Test-Path -LiteralPath $Menu)) { throw '卸载后仍留有登记项或开始菜单项' }+ - name: 安装并验收轻量安装包+ shell: pwsh+ run: |+ $Installed = Join-Path $env:RUNNER_TEMP 'Peach 轻量安装验收\自定义目录'+ $Setup = Start-Process -FilePath './Peach-${{ needs.windows.outputs.version }}-windows-x64-lite-setup.exe' `+ -ArgumentList '/VERYSILENT', '/SUPPRESSMSGBOXES', '/NORESTART', "/DIR=`"$Installed`"" -WindowStyle Hidden -Wait -PassThru+ if ($Setup.ExitCode -ne 0) { throw "轻量安装包退出码 $($Setup.ExitCode)" }+ python smoke_desktop.py (Join-Path $Installed 'Peach.exe')+ if ($LASTEXITCODE -ne 0) { throw '轻量安装包运行验收失败' }+ Start-Process -FilePath (Join-Path $Installed 'unins000.exe') -ArgumentList '/VERYSILENT', '/SUPPRESSMSGBOXES', '/NORESTART' -WindowStyle Hidden -Wait+ $Deadline = (Get-Date).AddSeconds(120)+ while ((Test-Path -LiteralPath $Installed) -and (Get-Date) -lt $Deadline) { Start-Sleep -Seconds 1 }+ if (Test-Path -LiteralPath $Installed) { throw '轻量安装包卸载后程序目录仍在' }- name: 验证在途任务保护与覆盖安装后的恢复shell: pwshrun: |diff --git a/CHANGELOG.md b/CHANGELOG.mdindex 95f7df4c2..c82c3933d 100644--- a/CHANGELOG.md+++ b/CHANGELOG.md@@ -21,6 +21,10 @@ Removed / Fixed / Security。## [未发布]+### 新增++- **桌面**:提供轻量安装包,安装时校验并复用已有媒体工具,仅在缺失或版本变化时下载;工具准备失败可重试,现有安装保持可用。+## [0.43.0] - 2026-10-18### 新增diff --git a/README.en.md b/README.en.mdindex f4a3f26db..26a44ecdd 100644--- a/README.en.md+++ b/README.en.md@@ -4,9 +4,10 @@<h1 align="center">Peach</h1>-<p align="center">A private video library for yourself: local drives, cloud drives and the creators you follow, all in one place.</p>+<p align="center">A private video library: local drives, cloud drives and the creators you follow, all in one place.</p><p align="center">+ <a href="https://peach.video">Website</a> ·<a href="https://github.com/peach-mitao/peach/releases">Download for Windows</a> ·<a href="https://demo.peach.video">Live demo</a> ·<a href="https://github.com/peach-mitao/peach/releases/tag/intro-video">Intro video</a> ·@@ -16,193 +17,109 @@</p><p align="center">- <a href="https://github.com/peach-mitao/peach/actions/workflows/test.yml"><img src="https://img.shields.io/github/actions/workflow/status/peach-mitao/peach/test.yml?branch=master&label=tests&logo=githubactions&logoColor=white" alt="tests"></a><a href="https://github.com/peach-mitao/peach/releases"><img src="https://img.shields.io/github/v/release/peach-mitao/peach?include_prereleases&filter=v*&sort=semver&label=release" alt="release"></a>+ <a href="https://github.com/peach-mitao/peach/actions/workflows/test.yml"><img src="https://img.shields.io/github/actions/workflow/status/peach-mitao/peach/test.yml?branch=master&label=tests&logo=githubactions&logoColor=white" alt="CI status"></a><a href="LICENSE"><img src="https://img.shields.io/badge/license-AGPL--3.0--or--later-blue?logo=gnu&logoColor=white" alt="license"></a>- <img src="https://img.shields.io/badge/python-3.14%2B-3776AB?logo=python&logoColor=white" alt="Python 3.14+">- <img src="https://img.shields.io/badge/platform-Windows-0078D4?logo=data%3Aimage%2Fsvg%2Bxml%3Bbase64%2CPHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHZpZXdCb3g9IjAgMCAyNCAyNCIgZmlsbD0id2hpdGUiPjxwYXRoIGQ9Ik0xIDFoMTB2MTBIMXptMTIgMGgxMHYxMEgxM3pNMSAxM2gxMHYxMEgxem0xMiAwaDEwdjEwSDEzeiIvPjwvc3ZnPg%3D%3D" alt="Windows">- <img src="https://img.shields.io/badge/platform-macOS-555555?logo=apple&logoColor=white" alt="macOS">- <img src="https://img.shields.io/badge/18%2B-adult%20content-critical?logo=data%3Aimage%2Fsvg%2Bxml%3Bbase64%2CPHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHZpZXdCb3g9IjAgMCAyNCAyNCIgZmlsbD0ibm9uZSIgc3Ryb2tlPSJ3aGl0ZSIgc3Ryb2tlLXdpZHRoPSIyIj48cGF0aCBkPSJNMTIgMiAzIDZ2NmMwIDUgOSAxMCA5IDEwczktNSA5LTEwVjZ6TTEyIDd2Nm0wIDN2MSIvPjwvc3ZnPg%3D%3D" alt="18+ adult content">+ <a href="docs/TESTING_DESKTOP.md"><img src="https://img.shields.io/badge/Windows-x64-0078D4" alt="Windows x64"></a>+ <a href="docs/OPERATIONS.md#从源码运行windowsmacos"><img src="https://img.shields.io/badge/macOS-source-555555?logo=apple&logoColor=white" alt="macOS from source"></a>+ <img src="https://img.shields.io/badge/18%2B-adult%20content-critical" alt="18+ adult content"></p>https://github.com/user-attachments/assets/a5610874-e611-41bb-be22-7d99f0d64b62-> **18+** For adults managing their own adult-content collections. The repository contains no media or site data. When Peach connects to outside sites it uses your own accounts and access rights.+> **18+** For adults managing their own adult-content collections. The repository contains no media or site data. Access to outside sites requires the appropriate accounts and permissions.-- **Already-organized videos just work**: Peach reads local NFO files and posters, then checks online metadata. Missing fields are filled automatically; replacing existing values requires review. Parts and versions with the same release code can share a `<code>.nfo`; a folder containing one release can also use `movie.nfo`. Unreadable NFO files are reported while online collection continues.-- **See results as they arrive**: Local metadata appears first. Online collection, follow checks and history fetches show confirmed results during the run. Interrupted tasks retain committed results; conflicting metadata stays in review.-- **Your files stay put**: scanning is read-only and files stay where they are. Renaming or moving only happens when you start it, with a preview first and an undo afterwards.-- **Cloud and local together**: mount 115, PikPak, Guangya or OneDrive as a local drive with CloudDrive2 or another tool, and its videos join the same library as your hard drives. Register other mounted providers under **其他已挂载网盘**.-- **Mount status**: media directories are checked periodically. A failed read is checked again before the tray and video page show the affected source and reason. Scans skip NAS recycle bins and system folders.-- **Pick from the video wall**: drag through a full-screen cover wall, expand a work and play in place, with versions and parts available directly.-- **Cross-site following and new releases**: bring a creator's updates from multiple sites into one feed. Subscribe by performer name, including performers outside your library.-- **Your data stays on your computer**: watch history, favorites and settings are stored locally. When filling in details, Peach only sends the video code or performer name to source sites. With cloud download, a magnet link goes only to the cloud drive you pick.-- **Company profiles**: studio and agency pages can show company names, foundation dates, brand launch dates, locations and operating relationships when sourced information is available.-- **Direct links**: assets use `/assets/:id`, works use `/works/:code` and followed posts use `/posts/:id`. Entity profiles use stable IDs; settings sections live under `/settings`. See the [page routes](docs/ROUTES.md).+## Features-## Screenshots--Want to look around before installing? The [live demo](https://demo.peach.video) is a ready-made library where you can try search, performer pages, filters and stats. The demo is read-only, so nothing you do is saved.--The original screenshots are lossless 3840×2160 PNGs; click to view them. You can also try the video wall in the demo.--**Home: filter by source, length and tags**--<a href="https://peach.video/assets/screenshots/home-20261014.png" target="_blank" rel="noopener"><img src="https://peach.video/assets/screenshots/home-20261014.webp" alt="Home: performer and studio navigation, filters and work cards" width="1200"></a>--**Video wall: drag to explore, play in place, switch versions and parts.**--<a href="https://peach.video/assets/screenshots/wall-20261014.png" target="_blank" rel="noopener"><img src="https://peach.video/assets/screenshots/wall-20261014-readme.webp" alt="Video wall: full-screen covers and browsing controls" width="1200"></a>--**Performer page: profile, aliases, links and every video**--<a href="https://peach.video/assets/screenshots/profile-20261014.png" target="_blank" rel="noopener"><img src="https://peach.video/assets/screenshots/profile-20261014.webp" alt="Performer profile: portrait, details and works" width="1200"></a>--**Following: one creator's updates from several sites in one feed**--<a href="https://peach.video/assets/screenshots/follow-20261014.png" target="_blank" rel="noopener"><img src="https://peach.video/assets/screenshots/follow-20261014.webp" alt="Following: creator navigation, filters and image updates" width="1200"></a>--**Statistics: where your videos live and how much you have watched**+- **Local and cloud together**: browse hard drives and mounted cloud drives, including 115, PikPak and OneDrive, in one library.+- **Pick from the video wall**: drag through a full-screen cover wall and play in place, with versions and parts of the same title grouped together.+- **Bring your existing collection**: read NFO files and posters, then fill missing titles, performers, studios and covers from multiple sources while keeping your edits.+- **Follow across sites**: combine a creator's updates from FANBOX, Patreon, Kemono and other sites, with matching posts grouped into one card.+- **Find your next watch**: subscribe to performers' new releases, discover titles based on your taste and save them to your want list.+- **Cloud download**: search by video code or paste a magnet link, send it to 115 or PikPak and organize the downloaded video into your library automatically.-<a href="https://peach.video/assets/screenshots/stats-20261014.png" target="_blank" rel="noopener"><img src="https://peach.video/assets/screenshots/stats-20261014.webp" alt="Statistics: library totals, storage and content distributions" width="1200"></a>+Watch history, favorites and settings stay on your computer. Scanning leaves original files untouched; manual organization offers a preview and an undo for the last batch.-## What it does--- **Browse folders**: the right side of the library filter bar offers card and list views and a folder mode switch. List view supports sorting across all matching items, pagination with 20 items per page by default, and selection across pages. Search, filters, and details share the same library. Keep personal categories or confirm a folder as a person, creator account, seller, or studio. Preview the affected items before saving, optionally apply the rule to future files, and remove the rule when needed. Conflicting assignments stay in place. See [folder browsing](docs/DIRECTORY_BROWSING.md).+## Screenshots-- **Search**: focus the search field to browse library works, JAV releases, followed videos and images, and subscribed releases by cover; enter performer and followed creator pages through their avatars. Follow and new release subscriptions are also available from the menu. Type a few characters to search performers, codes and videos together.-- **My Favorites**: use the star beside a profile name to favorite people, makers, labels, series and tags; a solid yellow star shows a favorite. The star button in library, discovery, follow and profile filters opens My Favorites, with type and name search and profile images, label logos or creator avatars. The dialog shares the settings glass navigation, keeps saved filters in their own tab, and links to Marked and Watch Later at the bottom of navigation. On library pages, name the current filter to open or delete it later.-- **Source checks**: choose direct access or the Peach proxy per source, and inspect failure reasons, elapsed time and cooldowns. Configure, preview and enable public JSON metadata APIs on the sources page; see [custom sources](docs/CUSTOM_SOURCES.md). Review images load when requested and can be retried.-- **External players and VR**: generate a temporary network playback link from a work's detail, download an M3U playlist, or open VLC on iPhone/iPad and IINA on Mac; see [external players](docs/EXTERNAL_PLAYERS.md).-- **Identity categories**: performers are grouped by identity and release market into JAV performers, amateurs, Western performers, adult bloggers and animation authors. Amateurs are performers with trusted evidence of non-professional appearances, or whose every video is an amateur release (an FC2-PPV code, or a 素人 tag that does not come from the vision model); JAV and Western performers are never filed as amateurs, and other genres only filter videos. The roster has three side-by-side entries, Performers, Sellers and Online, and sellers are matched to their works by source account. The filter bar only shows categories that have entries, and profile pages show the category with an icon left of the video count.-- **Video counts**: clearly segmented parts of the same FC2 collection count as one video, while the part files and cast credits are kept in full. Identities confirmed as merged share their profile and videos, and old profile URLs lead to the canonical identity.-- **Versions and parts**: subtitle, uncensored, resolution and restored versions of the same release share one card. Each version keeps its own parts and continues to its next part when playback ends.-- **Trash**: cards show whether an item was moved manually, marked as junk or a duplicate, or had a missing file. Videos and other resources can be restored directly. Items without a recorded reason show “Reason not recorded”.-- **Account identity**: the adult blogger category needs an identity or account source; unverified entries remain visible in the full roster. Account avatars prefer saved images. A personal blogger with evidence of their own identity gets an avatar automatically once the same face is cut from frames of two videos; other accounts show a frame from a representative video, marked as not the person. Aliases on profile pages carry identity names only; quality and bundle labels stay in the file details.-- **Western image sources**: performers and adult bloggers can use a Babepedia gallery portrait. For Vixen network titles such as Tushy, official covers are matched by performer and release date and shared by cards, details and avatar cropping; titles without a unique match wait for review.-- **Performer pages**: aliases, birthday and measurements, social accounts and JavDB and MISSAV links on one page, above every video of hers in your library and her photos. When changing the avatar, gallery portraits, video covers, local images and image URLs can all be cropped with a box first, or used whole.-- **Filling in details**: by video code, Peach fills in titles, performers and studios from studio sites, DMM, JavBus, JavDB and others. Covers favor larger official originals; JavDB images are used only for verification. Metadata collection only fills empty fields and never overwrites your edits.-- **Sync your library**: **同步媒体库** in Data management scans files, probes media information and fills in metadata and artwork. Library lists and details can sync selected videos. Its menu also offers separate file scans, syncing registered videos, video preview generation and metadata collection. Repeated syncs fill missing fields and reuse source caches.-- **Processing progress**: A persistent bottom-right task card shows the current step, progress and estimated time remaining across pages. Completed steps show a checkmark and strikethrough. Pause, resume and low-resource/standard/full-speed controls remain available when collapsed. The highest setting's flow effect follows the site's accent color, and ordinary receipts stack above the task card. An initial range uses known file counts, sizes and similar task history, then adjusts to measured processing times. The first full-library run explains its resource impact. Newly discovered files enter the estimate as scanning progresses. Pausing keeps progress, and resuming reuses completed results.-- **Video previews**: **生成视频预览** in Settings controls nine-frame contact sheets and timeline thumbnails. Turning it off retains duration and resolution probing for regular media under each directory's read policy. Timeline thumbnails are off by default, with 10-second and 30-second intervals available. Turning the master switch back on leaves the timeline off until an interval is selected.-- **STRM and disc images**: `.strm` files containing one HTTP(S) URL are registered during scanning and fetched when played. Local NFO files and posters can supply artwork and metadata. STRM and ISO files skip background probing and frame extraction; ISO files open in an external player.-- **Playback**: play in the browser and pick up where you left off. Like, rate, save for later, add to a playlist, or "log a climax". Library and followed-post details offer a horizontally scrolling recommendation row; choose a card to switch directly.-- **Video wall**: the persistent entry at the top right opens a dedicated full-screen wall of works with covers. Drag in any direction to explore automatically loaded, unseen works. Expand a tile in place as nearby tiles rearrange; the selected tile is highlighted and the others dimmed. Play and switch parts or versions on the wall, or open the shared details; playback can continue in the miniplayer when collapsed. Full sleeves and front panels adapt to tile proportions and face framing, with a thumbnail option. Playback blurs the cover background and moves the title to the top. The wall inherits library search, filters and profile scope. A notice at the top clears work filters while retaining the JAV and source context. The button beside Back changes the batch with a gray, blurred wall while waiting, and the corner tools provide search, image choice and zoom.-- **New releases**: subscribe on a performer page or by name in follow management, including performers not yet in your library. Peach checks for new titles regularly. Cards show performer avatars and open an in-site work detail with metadata, preview images, comments and resources; click an avatar with a saved profile to open it. Follow creators across sites such as FANBOX, Patreon and Kemono; the same work on different sites appears as one card.-- **Media cache**: followed images, work previews and fully received video content are saved locally for reuse. Avatars refresh every 3 months and favicons yearly. Follow management shows Retry failed sources when enabled sources have failed checks.-- **Online creators**: creator pages show local works and online updates separately, with video and image views and filters. Choose and crop an avatar from social profiles, online covers or post images, or use a local image or image URL.-- **JAV**: Library shows acquired titles; Discover uses your taste records to explore known titles outside your library and little-watched titles within it, regardless of release date, with tag filters and large or small covers; Wanted tracks titles to find, with magnet availability filters and saved resource results. Click a discovery card to open its details. Mark a work card or followed post as wanted, or enter a video code. Files scanned into your library are marked as acquired.- Registered studios open their profiles; unregistered studios display their names. Theater mode expands within the detail dialog and hides thumbnails and pagination. Library titles without registered sample images load source previews on demand.- Discovery cards share the home page's avatar and byline styles and use locally registered names. Cached recommendations appear immediately and update in the background; the filter toolbar's refresh icon updates work metadata. Closing details preserves filters, sorting and scroll position. Theater mode fills the available area and hides thumbnails and pagination below the video; exiting restores the regular view. Image navigation buttons stay at the media area's left and right edges.- Work details, comments and resources survive restarts. New releases update on demand once a day; a complete snapshot acquired more than one month after release is retained, with manual refresh available.-- **Cloud download**: open Find resources from JAV or a quality goal, search a video code or paste a magnet link, then submit the selected resource to 115 or PikPak. Once it lands, Peach selects the main video, isolates promotional attachments that meet the automatic threshold, collects metadata and applies that source's organization template. Progress and failed-step retries show up in Activity.-- **Find a release**: direct cloud downloads search `manko.fun → JavDB → Sukebei` first and stop when manko.fun has a 1080p or 2160p match; without one, they continue through your configured Prowlarr or Jackett indexers. Wanted titles collect candidates from multiple sources so you can compare versions. Available covers and title details appear with the resource candidates.-- **Statistics**: which drive holds what, how much you have watched and which tags dominate, on one page.-- **Taste**: combines viewing, feedback, accumulated library titles, browsing history and followed accounts. Read local 115, QQ, 360, Aside, Chrome, Edge or Firefox profiles, or add another browser's profile directory; see [browser history support](docs/BROWSER_HISTORY.md) for supported locations and formats. Stopping sync and deleting imported records are separate controls. Social visits are associated with registered accounts and known identities.-- **Settings**: the dialog groups appearance and navigation, browsing and playback, JAV and new releases, search and recommendations, and content display. Peach configuration groups media intake, sources and subscriptions, download channels, network access, and application maintenance.-- **Any screen**: works in the browser on desktop, tablet and phone.+Try search, filters and profiles in the [read-only demo](https://demo.peach.video). Click a screenshot for the original image.++<table>+ <tr>+ <td width="50%"><a href="https://peach.video/assets/screenshots/home-20261014.png" target="_blank" rel="noopener"><img src="https://peach.video/assets/screenshots/home-20261014.webp" alt="Library filters and video cards" width="600"></a></td>+ <td width="50%"><a href="https://peach.video/assets/screenshots/profile-20261014.png" target="_blank" rel="noopener"><img src="https://peach.video/assets/screenshots/profile-20261014.webp" alt="Performer portrait, profile and videos" width="600"></a></td>+ </tr>+ <tr>+ <td align="center">Library: browse by performer, source and tag</td>+ <td align="center">Performer profile: details, aliases and all videos</td>+ </tr>+ <tr>+ <td><a href="https://peach.video/assets/screenshots/follow-20261014.png" target="_blank" rel="noopener"><img src="https://peach.video/assets/screenshots/follow-20261014.webp" alt="Creator navigation and image updates" width="600"></a></td>+ <td><a href="https://peach.video/assets/screenshots/stats-20261014.png" target="_blank" rel="noopener"><img src="https://peach.video/assets/screenshots/stats-20261014.webp" alt="Library, storage and content statistics" width="600"></a></td>+ </tr>+ <tr>+ <td align="center">Following: creator updates across sites</td>+ <td align="center">Statistics: storage and watch history</td>+ </tr>+ <tr>+ <td colspan="2"><a href="https://peach.video/assets/screenshots/wall-20261014.png" target="_blank" rel="noopener"><img src="https://peach.video/assets/screenshots/wall-20261014-readme.webp" alt="Full-screen video cover wall" width="1200"></a></td>+ </tr>+ <tr>+ <td colspan="2" align="center">Video wall: drag to browse, play in place</td>+ </tr>+</table>## Download and use### Windows-1. Download one of the two packages from [Releases](https://github.com/peach-mitao/peach/releases):- - Full installer `Peach-<version>-windows-x64-setup.exe`: recommended for first-time installation. Double-click to install and choose an installation folder. No administrator rights needed; Peach appears in the Start menu and can be uninstalled from Windows Settings.- - Full portable package `Peach-<version>-windows-x64.zip`: right-click it, choose "Extract All", then double-click `Peach.exe` inside.-2. Your browser opens the first-run setup page.-3. Pick your media folders and who may access Peach, then start the scan.--If you already have a library but see first-run setup, choose **使用已有数据目录** and enter its `peach-data` folder. Peach keeps the existing settings, ledger and access password, and remembers the folder.--Windows standalone builds can check for and download updates under **应用与维护** in Configuration. Confirm a restart to install a downloaded update. Automatic checks and downloads are off by default and can be enabled there.--Routine updates use `Peach-<version>-windows-x64-update.zip` and reuse verified installed tools. The updater downloads separate `tools-*.zip` bundles only when tools are missing, damaged or changed. The application update ZIP is for Peach's updater; use a full package for first-time installation. Older updaters download a full package on their first upgrade, then support tool reuse. Older releases that only provide a full package remain supported by the updater.--Downloading an update leaves tasks running. Installing an update saves progress and pauses scraping and preview generation; collection requests made during installation wait for it to finish. After installation finishes or is cancelled, a running Peach service resumes the tasks automatically. If Peach has exited, it resumes unfinished library metadata, local previews, timeline thumbnails and cover tasks on the next launch, reusing completed results. Turning thumbnail collection off explicitly keeps it stopped.+1. Download the full installer, `Peach-<version>-windows-x64-setup.exe`, from [Releases](https://github.com/peach-mitao/peach/releases) and run it. No administrator rights needed. Alternatively, extract the full portable package and run `Peach.exe`.+2. Choose media folders and access permissions on the setup page that opens in your browser.+3. Start scanning, then browse and play in your browser.-Both the Windows installer and portable ZIP include FFmpeg, ffprobe and untrunc for transcoding, thumbnails and MP4 index recovery. Corresponding source is available in the same Release; the tools directory contains licenses and build notes. See [Windows test build](docs/TESTING_DESKTOP.md). The test package is not code-signed yet. If Windows says "Windows protected your PC", make sure the file came from this project's Releases, then choose "More info → Run anyway".+The full installer includes media tools for offline installation. The smaller lite installer downloads tools as needed during setup.-On Windows, the tray runs independently. Closing the Codex, Claude, or terminal session that started it keeps Peach running. Peach attempts to recover after an unexpected tray exit, up to three times within five minutes. Choosing “Quit Peach” keeps it closed. Exit reasons and recovery results are recorded in `tray-lifecycle.log` in the logs folder.--Startup error dialogs show where a diagnostic report was saved. While Peach is running, choose “Export diagnostic report” in the tray menu or “Download diagnostic report” on the diagnostics page to collect a redacted ZIP for feedback. For library processing failures, retry the failed items and export this ZIP; there is no need to select individual logs. It includes tool versions and decoding capabilities, processing issues, startup preparation, update and tunnel records, and same-origin browser errors from signed-in devices. Diagnostic downloads are limited to the computer running Peach. The tray export dialog can open the report folder, open the file, or close.+Test builds are unsigned. If Windows says “Windows protected your PC”, confirm the file came from this project's Releases, then choose “More info → Run anyway”. See the [Windows guide](docs/TESTING_DESKTOP.md) for installation, updates and troubleshooting.### Run from source (Windows, macOS)-You need Git, [uv](https://docs.astral.sh/uv/getting-started/installation/) and Python 3.14 or newer (`.python-version` selects Python 3.14 for production; uv downloads a missing interpreter for you):--```powershell-git clone https://github.com/peach-mitao/peach.git peach-app-cd peach-app-uv sync --locked --python 3.14-& .\.venv\Scripts\peach-tray.exe-```--On macOS, replace the last two lines with `uv sync --locked --python 3.14 --extra macos` and `./.venv/bin/peach-tray`.--LAN access, access passwords, updates and uninstalling are covered in [Operations](docs/OPERATIONS.md).--Open System diagnostics under Peach configuration → Application and maintenance to view library health lists, source parsing and cooldowns. `peach doctor` provides the same report; `--json` returns redacted JSON. See [Local diagnostics](docs/OPERATIONS.md#本机诊断) for status and actions.+Requires Git, uv and Python 3.14 or newer. See [running from source](docs/OPERATIONS.md#从源码运行windowsmacos).### Docker (VPS / NAS)-The headless Linux image runs alongside CloudDrive2, with separate mounts for media and application data. See [Docker deployment](docs/DOCKER.md) for setup, access boundaries and validation status.+See [Docker deployment](docs/DOCKER.md) for setup and supported configurations.## FAQ-- **Will it change my files?**- - Scanning and filling in details never touch the original files.- - Only three things do:- - Running an organize job you started: rename or move, with a preview first and an undo for the last batch.- - Emptying the trash: this really deletes.- - Confirming a cleanup in resource sync: folders that are already empty on disk are deleted; each source's root folder stays.-- **I already organized my videos with another scraper. Can Peach use that?**- - Peach reads the Kodi and Jellyfin layout:- - an `.nfo` named after the video;- - posters such as `<title>-poster.jpg`.- - Existing titles, performers, studios and posters show up right away.-- **Which cloud drives are supported?**- - Mounted 115, PikPak, Guangya and OneDrive directories are supported; register other providers under **其他已挂载网盘**. All mounted sources support reading and writing, subject to the mount tool's capabilities and the cloud account's permissions. Every new cloud directory, including PikPak, requires a choice between normal reads and proxy traffic protection. Configure the actual proxy in the mount tool; see [mount configuration](docs/CLOUDDRIVE.md).- - CloudDrive2 can also run on a NAS such as Synology. Map the shared folder to a Windows drive letter, then select that folder in Peach; this setup does not require CloudDrive2 or WinFsp on Windows.- - For playback, Peach reads them like ordinary folders and does not store your cloud account.- - For cloud download, the CloudDrive2 API token and the PikPak sign-in token are kept in this computer's credential file.- - For PikPak, "Sign in with browser" is the recommended way: you sign in inside the window it opens, and Peach never sees your password. Signing in with your account and password also works; the password is saved only if you tick "Save password".-- **How do I watch on my phone?**- - Choose "devices on the same network" during first-run setup.- - Connect your phone to the same network and open the address shown on the setup page.- - Setting an access password is a good idea.-- **Where is my data?**- - In the `peach-data` folder on your computer.- - The Windows build keeps it in `%LOCALAPPDATA%\Peach\peach-data` by default.+- **Will it change my files?** Scanning and filling in details leave originals untouched. Manual organization renames or moves files; emptying the trash deletes files, and resource-sync cleanup removes empty folders. Each requires confirmation.+- **Which cloud drives work?** Drives mounted as local folders through tools such as CloudDrive2; see [cloud drive mounts](docs/CLOUDDRIVE.md). Cloud download supports 115 and PikPak, with sign-in tokens stored locally.+- **How do I watch on my phone?** Allow devices on the same network during setup, connect your phone to that network, open the address shown and set an access password.+- **Where is my data?** In the local `peach-data` folder. The Windows build defaults to `%LOCALAPPDATA%\Peach\peach-data`.## Reporting problems-Open an [issue](https://github.com/peach-mitao/peach/issues) with the version, what you did, what you expected and what actually happened, ideally with a screenshot. Before taking screenshots, hide passwords, cookies, LAN addresses and full file paths, and do not upload database files or media. Report security issues privately as described in the [security policy](SECURITY.md).+Open an [issue](https://github.com/peach-mitao/peach/issues) with the version, steps, expected result and actual result. Hide credentials, LAN addresses and full paths in screenshots; do not upload databases or media. Report security issues privately through the [security policy](SECURITY.md).## Documentation-Using Peach: [Windows test build](docs/TESTING_DESKTOP.md) · [Operations](docs/OPERATIONS.md) · [Sourcing](docs/SOURCING.md) · [Cloud drive mounts](docs/CLOUDDRIVE.md) · [Changelog](CHANGELOG.md)+[Operations](docs/OPERATIONS.md) · [Sourcing](docs/SOURCING.md) · [External players](docs/EXTERNAL_PLAYERS.md) · [Changelog](CHANGELOG.md)-Contributing: [Development guide](AGENTS.md) · [Architecture](docs/ARCHITECTURE.md) · [Testing and dependencies](docs/TESTING.md) · [Frontend](docs/FRONTEND.md) · [Reuse inventory](docs/REUSE.md) · [README maintenance](docs/README_MAINTENANCE.md) · [Documentation and UI copy](docs/WRITING.md). Verify changes with Windows `& .\scripts\test.ps1` or macOS/Linux `./scripts/test.sh`.+Contributing: [Development guide](AGENTS.md) · [Testing and dependencies](docs/TESTING.md)## Related projects-- [amane](https://github.com/sqzw-x/amane): Peach reaches studio sites and other sources through it.-- [Gfriends](https://github.com/gfriends/gfriends): performer avatar collection.-- [CloudDrive2](https://www.clouddrive2.com/): mounts cloud drives as local disks.-- [OpenAver](https://github.com/slive777/OpenAver), [Javinizer-Go](https://github.com/javinizer/javinizer-go), [MetaTube](https://github.com/metatube-community/metatube-sdk-go), [MDCx](https://github.com/sqzw-x/mdcx): Peach learned from their source parsing and recommendation approaches.--The full reuse and credits list is in the [reuse inventory](docs/REUSE.md).+Thanks to [amane](https://github.com/sqzw-x/amane), [Gfriends](https://github.com/gfriends/gfriends), [CloudDrive2](https://www.clouddrive2.com/) and others. See the [reuse inventory](docs/REUSE.md) for full credits and details.-## Star history+## Star History-<a href="https://www.star-history.com/?repos=peach-mitao%2Fpeach&type=date">+<a href="https://www.star-history.com/?repos=peach-mitao%2Fpeach&type=date&logscale=&releases=&legend=top-left"><picture>- <source media="(prefers-color-scheme: dark)" srcset="https://api.star-history.com/chart?repos=peach-mitao/peach&type=date&theme=dark">- <source media="(prefers-color-scheme: light)" srcset="https://api.star-history.com/chart?repos=peach-mitao/peach&type=date">- <img alt="Peach Star history" src="https://api.star-history.com/chart?repos=peach-mitao/peach&type=date">+ <source media="(prefers-color-scheme: dark)" srcset="https://api.star-history.com/svg?repos=peach-mitao/peach&type=date&theme=dark&logscale&legend=top-left">+ <source media="(prefers-color-scheme: light)" srcset="https://api.star-history.com/svg?repos=peach-mitao/peach&type=date&logscale&legend=top-left">+ <img alt="Peach Star History" src="https://api.star-history.com/svg?repos=peach-mitao/peach&type=date&logscale&legend=top-left"></picture></a>## License-[AGPL-3.0-or-later](LICENSE) · Copyright (C) 2026 longmeidao. Third-party frontend files keep their own licenses. The [dependency manifest](package.json) records versions, and the [vendor script](scripts/vendor_web_dependencies.mjs) records file and license locations in `web/vendor/`.+[AGPL-3.0-or-later](LICENSE) · Copyright (C) 2026 longmeidao. Third-party components retain their own licenses.diff --git a/README.md b/README.mdindex c858cc663..628a8ee69 100644--- a/README.md+++ b/README.md@@ -7,6 +7,7 @@<p align="center">给自己用的私人影片馆藏:本地硬盘、网盘和关注的创作者,放在一个地方看。</p><p align="center">+ <a href="https://peach.video">官网</a> ·<a href="https://github.com/peach-mitao/peach/releases">下载 Windows 版</a> ·<a href="https://demo.peach.video">在线演示</a> ·<a href="https://github.com/peach-mitao/peach/releases/tag/intro-video">介绍视频</a> ·@@ -16,192 +17,109 @@</p><p align="center">- <a href="https://github.com/peach-mitao/peach/actions/workflows/test.yml"><img src="https://img.shields.io/github/actions/workflow/status/peach-mitao/peach/test.yml?branch=master&label=tests&logo=githubactions&logoColor=white" alt="tests"></a><a href="https://github.com/peach-mitao/peach/releases"><img src="https://img.shields.io/github/v/release/peach-mitao/peach?include_prereleases&filter=v*&sort=semver&label=release" alt="release"></a>+ <a href="https://github.com/peach-mitao/peach/actions/workflows/test.yml"><img src="https://img.shields.io/github/actions/workflow/status/peach-mitao/peach/test.yml?branch=master&label=tests&logo=githubactions&logoColor=white" alt="CI 状态"></a><a href="LICENSE"><img src="https://img.shields.io/badge/license-AGPL--3.0--or--later-blue?logo=gnu&logoColor=white" alt="license"></a>- <img src="https://img.shields.io/badge/python-3.14%2B-3776AB?logo=python&logoColor=white" alt="Python 3.14+">- <img src="https://img.shields.io/badge/platform-Windows-0078D4?logo=data%3Aimage%2Fsvg%2Bxml%3Bbase64%2CPHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHZpZXdCb3g9IjAgMCAyNCAyNCIgZmlsbD0id2hpdGUiPjxwYXRoIGQ9Ik0xIDFoMTB2MTBIMXptMTIgMGgxMHYxMEgxM3pNMSAxM2gxMHYxMEgxem0xMiAwaDEwdjEwSDEzeiIvPjwvc3ZnPg%3D%3D" alt="Windows">- <img src="https://img.shields.io/badge/platform-macOS-555555?logo=apple&logoColor=white" alt="macOS">- <img src="https://img.shields.io/badge/18%2B-adult%20content-critical?logo=data%3Aimage%2Fsvg%2Bxml%3Bbase64%2CPHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHZpZXdCb3g9IjAgMCAyNCAyNCIgZmlsbD0ibm9uZSIgc3Ryb2tlPSJ3aGl0ZSIgc3Ryb2tlLXdpZHRoPSIyIj48cGF0aCBkPSJNMTIgMiAzIDZ2NmMwIDUgOSAxMCA5IDEwczktNSA5LTEwVjZ6TTEyIDd2Nm0wIDN2MSIvPjwvc3ZnPg%3D%3D" alt="18+ adult content">+ <a href="docs/TESTING_DESKTOP.md"><img src="https://img.shields.io/badge/Windows-x64-0078D4" alt="Windows x64"></a>+ <a href="docs/OPERATIONS.md#从源码运行windowsmacos"><img src="https://img.shields.io/badge/macOS-source-555555?logo=apple&logoColor=white" alt="macOS 源码运行"></a>+ <img src="https://img.shields.io/badge/18%2B-adult%20content-critical" alt="18+ 成人内容"></p>https://github.com/user-attachments/assets/a5610874-e611-41bb-be22-7d99f0d64b62-> **18+** 仅供成年人管理自己的成人内容馆藏。仓库不含任何媒体或站点数据;连接外部站点时用的是你自己的账号和访问权。+> **18+** 仅供成年人管理自己的成人内容馆藏。仓库不含媒体或站点数据;连接外部站点需有相应账号和访问权。-- **整理过的片子直接用**:先读取片子旁边的 NFO 和海报,再核查在线资料。缺项自动补全,覆盖已有值须复核。同番号的分卷与版本可共用 `番号.nfo`;目录内只有一部作品时也可共用 `movie.nfo`。NFO 无法读取时保留问题记录,继续在线补全。-- **取得一项就能看一项**:本地资料先显示,在线采集、关注检查与历史抓取随取得随显示,不必等整批任务结束。任务中断保留已确认的结果;仍有分歧的资料留在人工复核中。-- **不动你的文件**:扫描只读,文件留在原处;改名、移动由你手动发起,先看预览,做完可以撤回。-- **网盘和本地一起看**:115、PikPak、光鸭、OneDrive 用 CloudDrive2 或其他工具挂载成本地磁盘后,和硬盘里的片子进同一个馆藏;其他网盘可选「其他已挂载网盘」登记路径。-- **挂载状态**:定期检查媒体目录;读取失败会复查,确认后在托盘和作品页说明来源及原因。扫描跳过 NAS 回收站与系统目录。-- **播放墙挑片**:拖动全屏封面墙浏览,点开作品就在墙内播放;同一番号的版本和分卷可以直接切换。-- **跨站关注与追新作**:把同一创作者在多个站点的更新汇到一起;按女优名订阅新作,尚未入库也能追。-- **数据留在自己电脑上**:观看记录、收藏和设置都存在本机;补资料时只向来源站点发送番号或女优名;用云下载时,磁力只交给你选的网盘。-- **公司资料**:厂牌和事务所可显示公司名称、成立日期、品牌启动日期、所在地及运营归属;只显示有来源的资料。-- **可直达的详情与设置**:资产用 `/assets/:id`,作品用 `/works/:code`,关注条目用 `/posts/:id`;实体资料用稳定 ID,设置分区从 `/settings` 进入。地址清单见[页面路由](docs/ROUTES.md)。--## 截图--不想先装?[在线演示](https://demo.peach.video) 里是一份现成的馆藏,搜索、女优页、筛选和统计都能直接点;演示站只读,操作不会保存。--下面的截图原图均为 3840×2160 无损 PNG,点击查看;播放墙也能在演示站体验。--**首页:按来源、时长、标签筛选**--<a href="https://peach.video/assets/screenshots/home-20261014.png" target="_blank" rel="noopener"><img src="https://peach.video/assets/screenshots/home-20261014.webp" alt="首页:人物和厂牌导航、筛选与作品卡片" width="1200"></a>--**播放墙:拖动挑片,原位播放,切换版本和分卷。**--<a href="https://peach.video/assets/screenshots/wall-20261014.png" target="_blank" rel="noopener"><img src="https://peach.video/assets/screenshots/wall-20261014-readme.webp" alt="播放墙:全屏作品封面与浏览控件" width="1200"></a>--**女优页:资料、别名、外部链接和全部作品**--<a href="https://peach.video/assets/screenshots/profile-20261014.png" target="_blank" rel="noopener"><img src="https://peach.video/assets/screenshots/profile-20261014.webp" alt="艺人资料页:人像、资料与全部作品" width="1200"></a>--**关注:一个创作者在多个站点的更新汇到一起**--<a href="https://peach.video/assets/screenshots/follow-20261014.png" target="_blank" rel="noopener"><img src="https://peach.video/assets/screenshots/follow-20261014.webp" alt="关注:创作者导航、筛选和图片更新" width="1200"></a>+## 能做什么-**统计:片子存在哪、看了多少**+- **本地、网盘一起看**:硬盘与已挂载的 115、PikPak、OneDrive 等网盘汇成一个馆藏。+- **播放墙挑片**:拖动全屏封面墙,点开原位播放;同一番号的不同版本与分卷集中切换。+- **接手已有收藏**:直接读取 NFO 和海报,缺少的标题、女优、厂牌与封面可从多个来源补齐,保留手动修改。+- **跨站关注**:同一创作者在 FANBOX、Patreon、Kemono 等站点的更新汇到一起,同一作品合成一张卡。+- **追新作、找想看的**:按女优订阅新作,按口味发现作品,用「想要」清单留住待找的片子。+- **云下载**:按番号查找资源或粘贴磁力,提交到 115 或 PikPak,落地后自动整理入库。-<a href="https://peach.video/assets/screenshots/stats-20261014.png" target="_blank" rel="noopener"><img src="https://peach.video/assets/screenshots/stats-20261014.webp" alt="统计:馆藏读数、存储与内容分布" width="1200"></a>+观看记录、收藏和设置保存在本机。扫描不动原文件;手动整理先预览,可撤回上一批。-## 能做什么+## 截图-- **按文件夹浏览**:馆藏筛选条右侧可切换卡片、列表与文件夹模式,搜索、标签和详情沿用首页。列表支持全集排序、分页和跨页选择,默认每页 20 部。目录用途可指定为个人分类、人物、创作者/账号、卖家或厂牌;先预览影响,再保存归属,并可单独启用新文件沿用。已有归属冲突保留,规则可移除。见[目录浏览](docs/DIRECTORY_BROWSING.md)。--- **搜索**:聚焦搜索框可按封面浏览作品、JAV、关注视频、关注图片与订阅新作,按头像进入艺人和关注作者;可直接进入关注与新作订阅。输入几个字,女优、番号和影片一起出来。-- **我的收藏**:资料页名字旁的星星收藏常用人物、片商、厂牌、系列和标签,黄色实心表示已收藏。馆藏、发现、关注和资料页筛选条的星形按钮打开「我的收藏」,按类型和名称查找,显示资料图、厂牌标识或作者头像。窗口采用设置弹层的玻璃导航,保存的筛选单独一页,导航底部提供已标记和稍后看清单。馆藏页可给当前筛选起个名字,随时打开或删除。-- **来源检查**:逐站选择直连或 Peach 代理,查看连接失败原因、耗时与冷却状态;公开 JSON 接口可在来源页配置、试查和启停,见[自定义来源](docs/CUSTOM_SOURCES.md)。复核来源图片点击后才加载,失败可重试。-- **外部播放器与 VR**:作品详情可生成限时网络播放链接,下载 M3U,或在 VLC(iPhone / iPad)、IINA(Mac)打开;使用方式见[外部播放器](docs/EXTERNAL_PLAYERS.md)。-- **身份分类**:艺人按身份与发行范围分为女优、素人、西方、网黄博主和动画作者。素人指有可信非职业出演证据,或全部出演作品都是素人发行(FC2-PPV 番号,或带非视觉模型来源的「素人」标签)的艺人,女优与西方出演者不归为素人;其他作品题材只用于作品筛选。名册使用「艺人、卖家、在线」三个并列入口,卖家按来源账号与作品对应。筛选条只显示有内容的分类,资料页在视频数量左侧显示分类与图标。-- **作品计数**:明确分段的同一 FC2 合集计为一个视频,分段文件和出演归属完整保留。已确认合并的身份共用资料与作品,旧资料页地址通往规范身份。-- **版本与分卷**:同一番号的中字、无码、清晰度和修复版汇在一张作品卡里;各版本保留自己的分卷,播完一卷接着播放同版下一卷。-- **回收站**:卡片显示手动、垃圾、重复或文件缺失的归入原因;视频和其它资源均可直接还原。未记录原因的条目显示「原因未记录」。-- **账号身份**:网黄博主分类需要身份或账号来源;未核实的条目可在全部名册查看。账号头像优先使用保存的图片;有本人身份依据的个人博主,在两部作品画面截到同一张脸时自动装上头像;其余账号以代表作画面占位,并标明非本人。资料页中的别名只承载身份名称,画质和资源包规格保留在文件信息中。-- **西方图片来源**:出演者与网黄博主可选 Babepedia 主图库人像;Tushy 等 Vixen 网络作品以出演者和发行日匹配官方封面,卡片、详情和头像框选共用原图,无法唯一匹配时留待核验。-- **女优页**:别名、生日身材、社媒和 JavDB、MISSAV 链接汇在一页,下面是她在你馆藏里的全部作品和照片;换头像时图库人像、作品封面、本机图片和图片地址都能先框一块,也能整张使用。-- **补资料**:按番号从片商官网、DMM、JavBus、JavDB 等站点补标题、女优和厂牌;封面优先选择尺寸更大的官方原图,JavDB 图片只用于核验。只填空着的资料,不覆盖你改过的。-- **同步媒体库**:数据管理的「同步媒体库」扫描文件、探测媒体信息并补全资料与图片;列表和详情可同步指定影片。下拉菜单可单独扫描文件、同步已入库影片、生成视频预览或补全资料。重复同步按缺项与来源缓存补全。-- **处理进度**:右下角常驻任务卡显示当前步骤、进度与预估剩余时间,跨页面保留;已完成步骤显示勾选和删除线,收起后仍可暂停、继续和选择低占用/标准/全速。最高档流光随站点强调色变化,普通回执显示在任务卡上方。启动时按已知文件数量、大小与同类历史给出粗估范围,运行后按实际耗时修正;首次全库处理会提示资源影响,未知新增文件随扫描纳入估算。暂停保留进度,继续时复用已完成结果。-- **视频预览**:设置中的「生成视频预览」控制九宫格与时间轴抽帧;关闭后仍保留普通媒体按来源规则执行的时长、分辨率探测。时间轴默认关闭,可选择每 10 秒或 30 秒一张;重新开启总开关后需自行选择时间轴间隔。-- **STRM 与原盘**:支持单个 HTTP(S) 地址的 `.strm` 文件,扫描时登记指针,播放时才读取目标;可沿用本地 NFO 与海报。STRM 和 ISO 跳过后台探测与抽帧,ISO 在外部播放器中打开。-- **播放**:在浏览器里直接播放,记下看到哪;可以点喜欢、打分、稍后看、加进播放列表,也能「记一次高潮」。馆藏和关注详情的「接着看」可横向浏览推荐内容,点卡片直接切换。-- **播放墙**:右上角常驻入口打开独立的全屏封面墙,拖动上下左右浏览有封面的作品,探索时自动接续未展示作品,图片可切换为缩略图。点击作品原位展开并高亮,其余磁贴变暗,同块磁贴同步让位;可在墙内播放、切换分卷与版本或打开共用详情,收起时可继续在小窗播放。封面按磁贴比例选择全封或正封,跟随人脸取景;播放时背景模糊、标题移到上方。继承馆藏搜索、筛选及资料页作品范围,顶部提示可清除作品筛选并继续浏览当前 JAV 与来源范围。左上角返回键旁可换一批,等待时墙面变灰、变糊,右下角可搜索和调整图片与缩放。-- **追新作**:在女优页打开订阅,或在关注管理里按名字订阅,馆藏中尚未收录的女优也可订阅。Peach 会定期检查新作;新作卡显示人物头像,点击卡片打开站内作品详情,查看资料、预览图、评论和资源;点击已建档人物的头像可进入资料页。创作者可跨 FANBOX、Patreon、Kemono 等站点关注,不同站点的同一作品合成一张卡。-- **媒体缓存**:关注图片、作品预览图和已取得的视频内容保存在本机,后续直接复用;头像每 3 个月、favicon 每年刷新。关注管理有失败来源时显示「检查失败项」,可单独重试。-- **在线作者**:创作者资料页分别显示本地作品与在线更新,在线内容可切换视频、图片并筛选;头像可从社媒头像、在线作品封面和正文图片中框选,也可用本机图片或图片地址。-- **JAV**:「馆藏」浏览已入库作品;「发现」按口味探索已知的库外作品和少看的馆藏,不限发行时间,可筛选标签、切换大小图;「想要」管理待找作品,可按有磁链、没磁链切换,已查到的资源会保留。点击发现卡打开作品详情,在作品卡或关注内容上点「想要」,也可输入番号添加,文件扫进馆藏后自动标为已入库。- 发现卡与首页共用头像和署名样式,使用本地已登记的规范姓名;已有推荐先显示并在后台更新,筛选栏的刷新图标用于更新作品资料。关闭详情保留筛选、排序和浏览位置。已登记厂牌可打开资料页,未登记厂牌只显示名称。影院模式在详情框体内展开,隐藏下方缩略图和分页,退出后恢复;图片翻页键固定在媒体区两侧,馆藏缺少已登记样图时按需读取来源图片。- 作品资料、评论和资源跨重启保存;新作每天按需更新,发行超过一个月后补齐并固定保存,仍可手动重新查询。-- **云下载**:在 JAV 或高清版目标打开「查找资源」,搜索番号或粘贴磁力,选择资源后提交到 115 或 PikPak。落地后自动选择正片、隔离达到自动线的推广附件、采集资料并按该来源模板整理;进度和失败重试都在活动页看。-- **按番号找资源**:云下载直接添加先按 `manko.fun → JavDB → Sukebei` 查磁力,`manko.fun` 命中 1080p 或 2160p 就停止;没有高清命中时再接配置的 Prowlarr 或 Jackett 索引器。「想要」的待找清单继续汇集多个来源,方便比较版本。取得的封面和作品资料与候选资源一起展示。-- **统计**:片子存在哪块盘、看过多少、标签分布,一页看完。-- **口味**:综合观看、反馈、馆藏积累、浏览记录及关注关系。可读取 115、QQ、360、Aside、Chrome、Edge、Firefox 等本机浏览器,也可添加资料目录;目录与格式范围见[浏览器历史导入](docs/BROWSER_HISTORY.md)。停止同步与删除已导入记录分别管理。社媒访问按已登记账号和人物身份判断。-- **设置**:弹窗按外观与导航、浏览与播放、JAV 与新作、搜索与推荐、内容显示分类;「Peach 配置」集中管理媒体入库、来源订阅、下载渠道、网络访问与应用维护。-- **多端**:电脑、平板、手机的浏览器都能用。+[在线演示](https://demo.peach.video) 可直接体验搜索、筛选和资料页,操作不会保存。点击截图查看原图。++<table>+ <tr>+ <td width="50%"><a href="https://peach.video/assets/screenshots/home-20261014.png" target="_blank" rel="noopener"><img src="https://peach.video/assets/screenshots/home-20261014.webp" alt="馆藏:首页筛选与作品卡片" width="600"></a></td>+ <td width="50%"><a href="https://peach.video/assets/screenshots/profile-20261014.png" target="_blank" rel="noopener"><img src="https://peach.video/assets/screenshots/profile-20261014.webp" alt="女优页:人像、资料与全部作品" width="600"></a></td>+ </tr>+ <tr>+ <td align="center">馆藏:按人物、来源和标签找片</td>+ <td align="center">女优页:资料、别名和全部作品</td>+ </tr>+ <tr>+ <td><a href="https://peach.video/assets/screenshots/follow-20261014.png" target="_blank" rel="noopener"><img src="https://peach.video/assets/screenshots/follow-20261014.webp" alt="关注:创作者导航与图片更新" width="600"></a></td>+ <td><a href="https://peach.video/assets/screenshots/stats-20261014.png" target="_blank" rel="noopener"><img src="https://peach.video/assets/screenshots/stats-20261014.webp" alt="统计:馆藏、存储与内容分布" width="600"></a></td>+ </tr>+ <tr>+ <td align="center">关注:创作者的跨站更新</td>+ <td align="center">统计:片子存在哪、看了多少</td>+ </tr>+ <tr>+ <td colspan="2"><a href="https://peach.video/assets/screenshots/wall-20261014.png" target="_blank" rel="noopener"><img src="https://peach.video/assets/screenshots/wall-20261014-readme.webp" alt="播放墙:全屏作品封面与浏览控件" width="1200"></a></td>+ </tr>+ <tr>+ <td colspan="2" align="center">播放墙:拖动挑片,原位播放</td>+ </tr>+</table>## 下载与使用### Windows-1. 从 [Releases](https://github.com/peach-mitao/peach/releases) 下载其中一种:- - 完整安装包 `Peach-<版本>-windows-x64-setup.exe`:首次安装推荐。双击安装,可选择安装目录,不需要管理员权限,开始菜单里有 Peach,可以在系统设置里卸载。- - 完整免安装包 `Peach-<版本>-windows-x64.zip`:右键「全部解压」,双击里面的 `Peach.exe`。-2. 浏览器会打开首次设置页。-3. 选好媒体文件夹和谁能访问,开始扫描。--已有馆藏却出现首次设置页时,点「使用已有数据目录」,填入保存馆藏的 `peach-data` 目录。程序会沿用其中的设置、账本和访问密码,并记住位置。--Windows 独立包可在配置页「应用与维护」检查并下载更新;下载完成后确认重启安装。自动检查与下载默认关闭,可在同一处开启。--日常更新使用 `Peach-<版本>-windows-x64-update.zip`,复用已安装工具;只有工具缺失、损坏或版本变化时,更新器才另外下载对应的 `tools-*.zip`。应用更新包供 Peach 更新器使用,首次安装请选择完整包。旧版更新器首次升级仍下载完整包,之后支持工具复用;仅提供完整包的历史版本也可通过应用内更新。--下载更新不会停止任务。应用内重启安装和安装包覆盖安装会保存采集进度、暂停刮削与抽帧;安装期间发起的采集任务会等待安装完成。安装完成或取消后,仍在运行的 Peach 会自动续跑;如果 Peach 已退出,则在下次启动时恢复未完成的馆藏资料、本地预览、时间轴缩略图和封面任务,复用已完成结果。主动关闭缩略图采集则不恢复。+1. 从 [Releases](https://github.com/peach-mitao/peach/releases) 下载完整安装包 `Peach-<版本>-windows-x64-setup.exe`,双击安装,无需管理员权限;也可下载完整免安装包,解压后运行 `Peach.exe`。+2. 浏览器打开首次设置页后,选择媒体文件夹和访问范围。+3. 开始扫描,随后在浏览器里浏览和播放。-Windows 安装包和免安装包均携带 FFmpeg、ffprobe、untrunc,转码、缩略图和缺索引 MP4 修复可直接使用。对应源码随同一 Release 提供,工具目录包含许可证和构建说明,见 [Windows 测试版](docs/TESTING_DESKTOP.md)。测试包还没有代码签名。Windows 提示「已保护你的电脑」时,确认文件来自本项目的 Release,再点「更多信息 → 仍要运行」。+完整安装包携带媒体工具,可离线安装;轻量安装包体积更小,安装时按需下载工具。-Windows 托盘独立运行,关闭启动它的 Codex、Claude 或终端不会退出 Peach。托盘异常退出后会自动尝试恢复;5 分钟内最多恢复 3 次。主动选择「退出 Peach」会保持关闭。退出原因和恢复结果可在日志目录的 `tray-lifecycle.log` 中查看。--启动失败弹窗会给出诊断报告位置。程序能运行时,可从托盘「导出诊断报告」或系统诊断页「下载诊断报告」取得脱敏 ZIP,用于问题反馈。馆藏处理失败时,重试失败项后导出同一份 ZIP 即可,无需逐个挑选日志。报告包含工具版本与解码能力、处理问题、启动准备、更新和隧道记录;已登录设备的同源浏览器错误也会记录。诊断报告下载限运行 Peach 的本机。托盘导出完成后可打开报告所在目录、打开文件或关闭提示。+测试版尚未签名。若 Windows 提示「已保护你的电脑」,确认来自本项目的 Release,再点「更多信息 → 仍要运行」。安装、更新和故障排查见 [Windows 使用说明](docs/TESTING_DESKTOP.md)。### 从源码运行(Windows、macOS)-需要 Git、[uv](https://docs.astral.sh/uv/getting-started/installation/) 和 Python 3.14 或更高(正式运行版本由 `.python-version` 固定为 3.14,uv 会自动下载缺的解释器):--```powershell-git clone https://github.com/peach-mitao/peach.git peach-app-cd peach-app-uv sync --locked --python 3.14-& .\.venv\Scripts\peach-tray.exe-```--macOS 把后两条换成 `uv sync --locked --python 3.14 --extra macos` 和 `./.venv/bin/peach-tray`。--局域网访问、访问密码、更新和卸载见 [运行与配置](docs/OPERATIONS.md)。--在Peach 配置「应用与维护」打开系统诊断,可查看库健康清单、来源解析与冷却状态。运行 `peach doctor` 可取得同一份报告;`--json` 输出脱敏 JSON。状态与处理方式见 [本机诊断](docs/OPERATIONS.md#本机诊断)。+需要 Git、uv 和 Python 3.14 或更高,步骤见[源码运行](docs/OPERATIONS.md#从源码运行windowsmacos)。### Docker(VPS / NAS)-Linux 无桌面镜像与 CloudDrive2 分别部署,媒体目录与运行数据独立挂载。部署方式、访问范围和验收状态见 [Docker 部署](docs/DOCKER.md)。+部署步骤与支持范围见 [Docker 部署](docs/DOCKER.md)。## 常见问题-- **会改我的文件吗?**- - 扫描、补资料都不碰原文件。- - 只有三件事会动文件:- - 你在整理里点了执行:改名或移动,先给预览,可以撤回上一批。- - 你清空回收站:真的删除。- - 你在资源同步里确认清理:删除盘上已经空了的文件夹,来源的根目录保留。-- **之前用别的刮削器整理过,能直接用吗?**- - 能读的是 Kodi、Jellyfin 那种格式:- - 和视频同名的 `.nfo`;- - `<片名>-poster.jpg` 这样的海报。- - 已有的标题、女优、厂牌和海报会直接显示。-- **支持哪些网盘?**- - 支持已挂载的 115、PikPak、光鸭、OneDrive;其他网盘用「其他已挂载网盘」登记。所有挂载来源均可读写,文件操作取决于挂载工具和网盘账号的权限与能力。新增网盘目录需选择「正常读取」或「代理流量保护」,包括 PikPak;实际代理在挂载工具中配置,见[挂载配置](docs/CLOUDDRIVE.md)。- - CloudDrive2 也可运行在群晖等 NAS 上。Windows 先把共享目录映射为盘符,再在 Peach 中选择对应文件夹;这种方式无需在 Windows 安装 CloudDrive2 或 WinFsp。- - 看片时 Peach 只把它当普通文件夹读,不保存网盘账号。- - 用云下载时,CloudDrive2 的 API 令牌和 PikPak 的登录令牌存在这台电脑的凭据文件里。- - PikPak 推荐点「用浏览器登录」,在弹出的窗口里登录,Peach 不经手密码;也可以用账号密码登录,密码只在你勾选「保存密码」时保存。-- **手机上怎么看?**- - 首次设置时选「同一局域网的设备」。- - 手机和电脑连同一个网络,用浏览器打开设置页给出的地址。- - 建议顺手设一个访问密码。-- **数据存在哪?**- - 都在本机的 `peach-data` 文件夹里。- - Windows 版默认在 `%LOCALAPPDATA%\Peach\peach-data`。+- **会改我的文件吗?** 扫描、补资料不碰原文件。手动整理会改名或移动;清空回收站会删除文件,资源同步中的清理会删除空目录,均需确认。+- **支持哪些网盘?** 通过 CloudDrive2 等工具挂载为本地目录的网盘,详见[网盘挂载](docs/CLOUDDRIVE.md);云下载支持 115 和 PikPak,登录令牌保存在本机。+- **手机上怎么看?** 首次设置时允许同一局域网的设备访问,手机连同一网络,打开设置页给出的地址,并设置访问密码。+- **数据存在哪?** 本机的 `peach-data` 文件夹;Windows 版默认位于 `%LOCALAPPDATA%\Peach\peach-data`。## 问题反馈-在 [Issues](https://github.com/peach-mitao/peach/issues) 里写清楚版本号、做了什么、想要的结果和实际看到的结果,最好附截图。截图前遮掉密码、Cookie、局域网地址和文件完整路径,不要上传数据库文件或媒体。安全问题请按 [安全政策](SECURITY.md) 私下报告。+在 [Issues](https://github.com/peach-mitao/peach/issues) 附上版本、操作步骤、预期与实际结果。截图请遮掉凭据、局域网地址和完整路径,不要上传数据库或媒体;安全问题按[安全政策](SECURITY.md)私下报告。## 文档-使用:[Windows 测试版](docs/TESTING_DESKTOP.md) · [运行与配置](docs/OPERATIONS.md) · [来源采集](docs/SOURCING.md) · [网盘挂载](docs/CLOUDDRIVE.md) · [变更日志](CHANGELOG.md)+[运行与配置](docs/OPERATIONS.md) · [来源采集](docs/SOURCING.md) · [外部播放器](docs/EXTERNAL_PLAYERS.md) · [变更日志](CHANGELOG.md)-参与开发:[开发约定](AGENTS.md) · [总体架构](docs/ARCHITECTURE.md) · [测试与依赖](docs/TESTING.md) · [前端开发](docs/FRONTEND.md) · [复用清单](docs/REUSE.md) · [README 维护](docs/README_MAINTENANCE.md) · [文档与界面文案](docs/WRITING.md)。改完用 Windows `& .\scripts\test.ps1` 或 macOS/Linux `./scripts/test.sh` 验证。+参与开发:[开发约定](AGENTS.md) · [测试与依赖](docs/TESTING.md)## 相关项目-- [amane](https://github.com/sqzw-x/amane):Peach 通过它接入片商官网等来源。-- [Gfriends](https://github.com/gfriends/gfriends):女优头像图库。-- [CloudDrive2](https://www.clouddrive2.com/):把网盘挂载成本地磁盘。-- [OpenAver](https://github.com/slive777/OpenAver)、[Javinizer-Go](https://github.com/javinizer/javinizer-go)、[MetaTube](https://github.com/metatube-community/metatube-sdk-go)、[MDCx](https://github.com/sqzw-x/mdcx):Peach 参考过它们的来源解析和推荐做法。--各项目的复用位置与取舍见 [复用清单](docs/REUSE.md)。+感谢 [amane](https://github.com/sqzw-x/amane)、[Gfriends](https://github.com/gfriends/gfriends)、[CloudDrive2](https://www.clouddrive2.com/) 等项目,完整致谢与复用说明见[复用清单](docs/REUSE.md)。## Star 历史-<a href="https://www.star-history.com/?repos=peach-mitao%2Fpeach&type=date">+<a href="https://www.star-history.com/?repos=peach-mitao%2Fpeach&type=date&logscale=&releases=&legend=top-left"><picture>- <source media="(prefers-color-scheme: dark)" srcset="https://api.star-history.com/chart?repos=peach-mitao/peach&type=date&theme=dark">- <source media="(prefers-color-scheme: light)" srcset="https://api.star-history.com/chart?repos=peach-mitao/peach&type=date">- <img alt="Peach Star 历史" src="https://api.star-history.com/chart?repos=peach-mitao/peach&type=date">+ <source media="(prefers-color-scheme: dark)" srcset="https://api.star-history.com/svg?repos=peach-mitao/peach&type=date&theme=dark&logscale&legend=top-left">+ <source media="(prefers-color-scheme: light)" srcset="https://api.star-history.com/svg?repos=peach-mitao/peach&type=date&logscale&legend=top-left">+ <img alt="Peach Star 历史" src="https://api.star-history.com/svg?repos=peach-mitao/peach&type=date&logscale&legend=top-left"></picture></a>## 许可证-[AGPL-3.0-or-later](LICENSE) · Copyright (C) 2026 longmeidao。第三方前端文件保留各自的许可证;[依赖清单](package.json) 登记版本,[生成脚本](scripts/vendor_web_dependencies.mjs) 登记 `web/vendor/` 中的文件与许可证位置。+[AGPL-3.0-or-later](LICENSE) · Copyright (C) 2026 longmeidao。第三方组件保留各自的许可证。diff --git a/docs/OPERATIONS.md b/docs/OPERATIONS.mdindex a83b6bcea..f89585737 100644--- a/docs/OPERATIONS.md+++ b/docs/OPERATIONS.md@@ -2,7 +2,22 @@本文讲在自己电脑上运行 Peach 时要知道的事:第一次怎么设置、配置页在哪、怎么从其他设备访问、怎么装 FFmpeg、哪些操作会真的删除文件。-用 Windows 测试包的,先看 [Windows 测试版](TESTING_DESKTOP.md);从源码运行的,安装命令见 [README](../README.md)。文末「维护者参考」是给在源码上开发、打包和发布的人看的,普通使用可以跳过。+用 Windows 测试包的,先看 [Windows 测试版](TESTING_DESKTOP.md);从源码运行的,按下面的步骤安装。文末「维护者参考」是给在源码上开发、打包和发布的人看的,普通使用可以跳过。++## 从源码运行(Windows、macOS)++需要 Git 和 [uv](https://docs.astral.sh/uv/getting-started/installation/)。Python 下限为 3.14,项目由 `.python-version` 固定运行版本,uv 会自动下载缺少的解释器。++在 PowerShell 7(Windows)或 zsh(macOS)中依次执行:++1. 克隆仓库:`git clone https://github.com/peach-mitao/peach.git peach-app`。+2. 进入项目目录:`cd peach-app`。后续命令均在此目录执行。++Windows 安装依赖:`uv sync --locked --python 3.14`。完成后启动托盘:`& .\.venv\Scripts\peach-tray.exe`。++macOS 安装依赖:`uv sync --locked --python 3.14 --extra macos`。完成后启动托盘:`./.venv/bin/peach-tray`。++托盘会打开浏览器中的首次设置页。源码运行不需要下载 Windows 安装包。## 首次运行与设置文件diff --git a/docs/README_MAINTENANCE.md b/docs/README_MAINTENANCE.mdindex cf2ed3393..11268272d 100644--- a/docs/README_MAINTENANCE.md+++ b/docs/README_MAINTENANCE.md@@ -110,3 +110,6 @@ SHA-256 对不上是硬错误,不降级放行。使用条款,Peach 的边界以 AGPL 与 `SECURITY.md` 为准。- **演示素材**:README 里任何截图或视频都按上面「演示数据集」一节的边界取图,换素材时重新核对那几条边界。+- **篇幅取舍(2026-10-17)**:复读已登记的 amane、Stash 与 OpenAver 原文,并核对线上 README。采用 amane 的短功能列表与安装入口,保留 Peach 的演示、全部五张截图、六条特色和必要安全说明;源码安装步骤集中在 [运行与配置](OPERATIONS.md#从源码运行windowsmacos)。路由、字段判据、缓存周期、更新包机制与开发流程由专题文档承载。+- **截图与 Star 历史(2026-10-17)**:截图沿用 `a5f979d6^` 的双列表格,播放墙独占一行,五张 WebP 均链接 PNG 原图。Star History 依据官方 [`EmbedMarkdownSection.tsx`](https://github.com/star-history/star-history/blob/608d0e39be441665c01cd6ac1fd01ca5ec1eaf39/frontend/components/EmbedMarkdownSection.tsx) 使用 `/svg`,保留深浅主题并链接用户指定的交互页。实测 `/chart` 与 `/svg` 均返回 HTTP 200、SVG 类型及 `Cache-Control: public, s-maxage=86400, max-age=86400`;同版本 [`cache.ts`](https://github.com/star-history/star-history/blob/608d0e39be441665c01cd6ac1fd01ca5ec1eaf39/backend/cache.ts) 将数据与 SVG 缓存各设为 24 小时。交互页 URL 仅改变点击去向,不能保证嵌入图片即时刷新;README 不显示实时性承诺。+- **交互图与嵌入图(2026-10-17)**:用户截图显示纵轴为 0、10、100;嵌入接口使用 `logscale` 得到相同刻度。官方同版本 [`StarChartViewer.tsx`](https://github.com/star-history/star-history/blob/608d0e39be441665c01cd6ac1fd01ca5ec1eaf39/frontend/components/StarChartViewer.tsx) 在浏览器调用 GitHub,并在页面内存中复用结果;24 小时服务端缓存针对嵌入图片接口,不能据此判断官网交互图的数据新鲜度。官网 `https://peach.video` 位于中英文 README 顶部导航。diff --git a/docs/REUSE.md b/docs/REUSE.mdindex bb88c5d99..4749eb2d9 100644--- a/docs/REUSE.md+++ b/docs/REUSE.md@@ -225,6 +225,7 @@ OneJAV、Free JAV Torrent 只给种子链接。这类条目经索引器同源的- 自动更新设置用 APScheduler(见「必须复用」表的定时轮询)、共享 HTTPX 发行查询、filelock 与原子 JSON 写入,安装走 `standalone_update`。按 [interval trigger](https://apscheduler.readthedocs.io/en/3.x/modules/triggers/interval.html) 每分钟查是否到期,本机持久时间与文件锁协调多个服务;关闭、6/24/168 小时间隔与源码下载限制归 Peach。默认关闭,下载只准备安装,重启仍需确认;设置存 state 目录的 `automatic-updates.json`。- 版本与资产信息用 [GitHub Releases REST API](https://docs.github.com/en/rest/releases/assets)(测试通道含预发布),查询与流式下载用项目 HTTPX,ZIP 解压用标准库,互斥用 FileLock。只有已上传完整独立包的发布才进更新,优先选择 `*-update.zip`,历史完整 ZIP 保留原名供旧客户端更新。`package_windows_release.py` 从同一构建目录生成完整包、应用更新包与 FFmpeg、untrunc、cloudflared 工具包;更新包内清单固定工具文件哈希、工具包大小与 SHA-256,运行时只复用校验相符的文件,按需下载不符的工具。工具包路径限于对应工具目录,补齐后再次校验并沿用同卷暂存与目录回滚。复用已有 HTTPX、hashlib、zipfile、copy2,无新增依赖;不引入 Velopack 的包格式或二进制差分机制。隔离回归用实际生成的 ZIP 验证工具复用、独立补下载与失败保留现有安装,不使用真实 ledger。- 安装策略与进度归 Peach:下载校验后在程序同卷暂存,用户确认重启,复制出来的包内助手等原托盘退出再切换完整目录;失败保留或恢复旧目录。配置、数据库与媒体不进更新包。+- 轻量安装包复用应用更新包的工具清单、`standalone_update.prepare_tools` 与既有 HTTPX、hashlib、zipfile。Inno Setup 6.7.3 用 [external 文件](https://jrsoftware.org/ishelp/topic_filessection.htm)安装临时目录中已验证的工具,用[滚动进度页](https://jrsoftware.org/ishelp/topic_isxfunc_createoutputmarqueeprogresspage.htm)显示准备状态;官方 API 已于 2026-10-17 核对。工具先在预检目录准备,成功后才暂停任务并覆盖安装;安装包旁的工具 ZIP 同样按清单校验,不读取馆藏配置或增加依赖。不引入另一套下载器或更新框架,校验及解压路径与在线更新共用。- 不用 [Velopack](https://docs.velopack.io/packaging/operating-systems/windows)(要求其安装目录与包格式)与 [WinSparkle](https://winsparkle.org/)(要求 appcast 与原生更新界面):产物是 PyInstaller ZIP、进度在 Web 显示,沿用托盘进程与目录替换协议。- Web 复用 Fieldset、Progress、confirmModal;状态由 `standalone-update.json` 保存。下载按字节计量,解压按文件数计量,替换使用阶段进度;服务重启期间保留等待状态,恢复连接后核对版本。- 新版有待应用迁移时,重启安装复用 `migrate upgrade --yes`,先保存 SQLite 备份;迁移或启动失败时恢复数据库与程序。数据库备份位于用户数据根的 `state/update-backups/`。diff --git a/docs/TESTING_DESKTOP.md b/docs/TESTING_DESKTOP.mdindex 43b74910c..82c899a18 100644--- a/docs/TESTING_DESKTOP.md+++ b/docs/TESTING_DESKTOP.md@@ -1,14 +1,18 @@# Windows 测试版-Windows 测试版有安装包和免安装包两种,程序文件相同,都不需要安装 Python、Git、Node 或 OpenSSL。macOS 暂无独立包,请按 [README](https://github.com/peach-mitao/peach) 从源码运行。+Windows 版提供完整安装包、轻量安装包和免安装包,均无需另装 Python、Git、Node 或 OpenSSL。macOS 请按[源码运行](OPERATIONS.md#从源码运行windowsmacos)安装。-| | 安装包 | 免安装包 |-| --- | --- | --- |-| 文件 | `Peach-<版本>-windows-x64-setup.exe` | `Peach-<版本>-windows-x64.zip` |-| 程序位置 | 可选择,默认 `%LOCALAPPDATA%\Programs\Peach`,不需要管理员权限 | 解压到哪里就在哪里 |-| 开始菜单与系统设置里的卸载项 | 有 | 没有 |+| 文件 | 用途 |+| --- | --- |+| `Peach-<版本>-windows-x64-setup.exe` | 完整安装包,包含全部工具,可离线安装 |+| `Peach-<版本>-windows-x64-lite-setup.exe` | 轻量安装包,校验并复用已有工具,缺失或版本不符时自动下载 |+| `Peach-<版本>-windows-x64.zip` | 完整免安装包,解压后运行 `Peach.exe` |-两种的数据都在 `%LOCALAPPDATA%\Peach\peach-data`,换用另一种时设置和数据库照常沿用。+安装包默认装在 `%LOCALAPPDATA%\Programs\Peach`,可选择目录,无需管理员权限;两种安装包都提供开始菜单与系统设置里的卸载项。免安装包解压到哪里就在哪里。++三种包的数据都在 `%LOCALAPPDATA%\Peach\peach-data`,换用另一种时设置和数据库照常沿用。++轻量安装包先在临时目录备齐并校验工具,再停止旧程序并安装;下载失败可重试,现有安装会保留。安装包旁边已有对应的 `tools-*.zip` 时,可校验后直接使用。安装目录须为当前用户可写的独立文件夹,上级目录也须可写,以便自动更新。可选择空文件夹或已有的 Peach 安装目录;程序目录不能与数据目录重叠,也不能经过目录链接。升级默认沿用已有安装目录。需要换位置时,先卸载并保留数据,再安装到新目录。@@ -50,7 +54,7 @@ Windows 第一次询问防火墙权限时,只勾选「专用网络」。## 播放与 FFmpeg-完整安装包和完整免安装 ZIP 均包含 FFmpeg 与 ffprobe,位于程序目录的 `tools\ffmpeg\bin`。转码、媒体信息探测与缩略图可直接使用,无需安装系统工具或设置 PATH。应用更新包 `*-update.zip` 由 Peach 更新器使用,按文件 SHA-256 校验并复用已安装工具,仅下载缺失、损坏或版本变化的工具包。首次安装须使用完整包;`tools-*.zip` 由更新器按需处理。+完整安装包和完整免安装 ZIP 均包含 FFmpeg 与 ffprobe,位于程序目录的 `tools\ffmpeg\bin`;轻量安装包会在安装时备齐工具。转码、媒体信息探测与缩略图无需额外配置。`*-update.zip` 由 Peach 更新器校验和安装,不提供手动导入入口;首次安装使用任一安装包或完整免安装包。`tools-*.zip` 由更新器或轻量安装包按需处理。缺索引 MP4 修复使用随包的 `tools\untrunc\untrunc.exe`,需要同编码参数的完整片作为参照。该工具与其兼容的 FFmpeg 库独立构建,按 GPL-2.0-or-later 分发;完整对应源码制品为同一 Release 中的 `untrunc-corresponding-source.zip`。显式 `PEACH_UNTRUNC` 优先于随包工具,其后查数据目录与 PATH。diff --git a/scripts/build_app_entry.py b/scripts/build_app_entry.pyindex f54062b46..6785ff6b2 100644--- a/scripts/build_app_entry.py+++ b/scripts/build_app_entry.py@@ -107,6 +107,9 @@ def main(argv: list[str] | None = None) -> int:if len(argv) == 5 and argv[1] == "--installer-prepare":from peach.desktop_installer import preparereturn prepare(Path(argv[2]), int(argv[3]), Path(argv[4]))+ if len(argv) == 5 and argv[1] == "--installer-tools":+ from peach.desktop_installer import prepare_install_tools+ return prepare_install_tools(Path(argv[2]), Path(argv[3]), Path(argv[4]))if len(argv) == 4 and argv[1] == "--installer-finish":from peach.desktop_installer import finish_installreturn finish_install(Path(argv[2]), int(argv[3]))diff --git a/scripts/changelog.py b/scripts/changelog.pyindex 80e1243c3..5e634e158 100644--- a/scripts/changelog.py+++ b/scripts/changelog.py@@ -39,10 +39,9 @@ UNRELEASED = "未发布"#: Release 页正文里跟在变更日志后面的安装提示。每一版都一样,所以只写在这里一处,#: 工作流不再自己抄一份。-INSTALL_NOTE = ("Windows x64 独立测试包。完整解压后双击 Peach.exe,选择媒体文件夹即可开始。"- "也可运行安装包,选择程序目录。本机使用;无需 Python、Git 或 Node。"- "安装版和免安装版均携带 FFmpeg、ffprobe 与 untrunc,支持转码、缩略图与损坏 MP4 索引修复。"- "配置和日志入口见程序内「配置 Peach」。macOS 请按 README 使用源码安装。")+INSTALL_NOTE = ("Windows x64,支持本机和局域网浏览器访问;无需另装 Python 或媒体工具。"+ "安装与使用见 [Windows 使用说明](https://github.com/peach-mitao/peach/blob/master/docs/TESTING_DESKTOP.md),"+ "macOS 见 [源码运行](https://github.com/peach-mitao/peach/blob/master/docs/OPERATIONS.md#从源码运行windowsmacos)。")#: Conventional Commits 的主题形状:`type(scope)!: 描述`。SUBJECT = re.compile(r"^(?P<type>[a-z]+)(?:\((?P<scope>[^)]*)\))?(?P<bang>!)?:\s*(?P<text>.+)$")diff --git a/scripts/installer/peach.iss b/scripts/installer/peach.issindex 6d0fdbb7f..824467b92 100644--- a/scripts/installer/peach.iss+++ b/scripts/installer/peach.iss@@ -31,7 +31,11 @@ DisableProgramGroupPage=yesArchitecturesAllowed=x64compatibleArchitecturesInstallIn64BitMode=x64compatibleOutputDir={#OutputDir}+#ifdef LiteInstaller+OutputBaseFilename=Peach-{#AppVersion}-windows-x64-lite-setup+#elseOutputBaseFilename=Peach-{#AppVersion}-windows-x64-setup+#endifSetupIconFile=..\..\resources\peach.icoUninstallDisplayIcon={app}\Peach.exeUninstallDisplayName=Peach@@ -65,6 +69,11 @@ Type: filesandordirs; Name: "{app}\_internal"[Files]Source: "{#SourceDir}\*"; DestDir: "{app}"; Flags: ignoreversion recursesubdirs createallsubdirsSource: "{#SourceDir}\*"; DestDir: "{tmp}\Peach-preflight"; Flags: dontcopy recursesubdirs createallsubdirs+#ifdef LiteInstaller+Source: "{tmp}\Peach-preflight\tools\*"; DestDir: "{app}\tools"; ExternalSize: 0; Flags: external ignoreversion recursesubdirs createallsubdirs+Source: "{tmp}\Peach-preflight\cloudflared.exe"; DestDir: "{app}"; ExternalSize: 0; Flags: external ignoreversion+Source: "{tmp}\Peach-preflight\cloudflared-manifest.json"; DestDir: "{app}"; ExternalSize: 0; Flags: external ignoreversion+#endif[Icons]Name: "{userprograms}\Peach"; Filename: "{app}\Peach.exe"; Parameters: "--show"@@ -80,6 +89,10 @@ Type: filesandordirs; Name: "{app}"[Code]varGuardPrepared: Boolean;+#ifdef LiteInstaller+ ToolsPrepared: Boolean;+ ToolsPage: TOutputMarqueeProgressWizardPage;+#endiffunction GetCurrentProcessId(): LongWord;external '[email protected] stdcall';@@ -151,6 +164,31 @@ beginif GuardPrepared thenExit;ExtractTemporaryFiles('{tmp}\Peach-preflight\*');+#ifdef LiteInstaller+ if not ToolsPrepared then+ begin+ if ToolsPage = nil then+ ToolsPage := CreateOutputMarqueeProgressPage('准备媒体工具', '已有工具会校验后复用,缺少时自动下载。');+ ToolsPage.SetText('正在检查、下载并校验媒体工具,请稍候。', '下载失败可重试,现有安装会保留。');+ ToolsPage.Show;+ ToolsPage.Animate;+ try+ ToolsPrepared := Exec(ExpandConstant('{tmp}\Peach-preflight\Peach.exe'),+ '--installer-tools "' + ExpandConstant('{app}') + '" "' + ExpandConstant('{src}\.') ++ '" "' + ExpandConstant('{tmp}\Peach-preflight\tools-error.txt') + '"',+ ExpandConstant('{tmp}\Peach-preflight'), SW_HIDE, ewWaitUntilTerminated, ResultCode) and (ResultCode = 0);+ finally+ ToolsPage.Hide;+ end;+ if not ToolsPrepared then+ begin+ Result := '媒体工具未能准备完成,请检查网络后重试。';+ if LoadStringFromFile(ExpandConstant('{tmp}\Peach-preflight\tools-error.txt'), ErrorText) then+ Result := UTF8Decode(ErrorText);+ Exit;+ end;+ end;+#endifif not Exec(ExpandConstant('{tmp}\Peach-preflight\Peach.exe'),'--installer-prepare "' + ExpandConstant('{app}') + '" ' + IntToStr(GetCurrentProcessId()) +' "' + ExpandConstant('{tmp}\Peach-preflight\prepare-error.txt') + '"',diff --git a/scripts/package_windows_release.py b/scripts/package_windows_release.pyindex fa7c8176f..602307eee 100644--- a/scripts/package_windows_release.py+++ b/scripts/package_windows_release.py@@ -3,8 +3,12 @@ from __future__ import annotationsimport argparseimport json+import osfrom pathlib import Path+import shutil+import subprocessimport sys+import tempfileimport zipfilesys.path.insert(0, str(Path(__file__).resolve().parents[1] / "src"))@@ -21,6 +25,50 @@ def archive(destination: Path, root: Path, files: list[Path], manifest: dict | Npackage.writestr("Peach/" + MANIFEST, json.dumps(manifest, ensure_ascii=False, sort_keys=True))+def download_notes(version: str, *, lite_installer: bool = False) -> str:+ """发布页的下载入口与包类型说明。"""+ base = f"https://github.com/peach-mitao/peach/releases/download/v{version}/Peach-{version}-windows-x64"+ lite = (f"| [轻量安装包(lite-setup.exe)]({base}-lite-setup.exe) | 不含工具,安装时复用已有工具或按需联网下载 |\n"+ if lite_installer else "")+ return (+ "\n## 下载选择\n\n"+ "| 下载 | 用途 |\n| --- | --- |\n"+ f"| [安装包(setup.exe)]({base}-setup.exe) | 包含全部工具,首次安装推荐 |\n"+ + lite ++ f"| [完整免安装包(ZIP)]({base}.zip) | 包含全部工具,解压后运行 `Peach.exe` |\n"+ f"| [应用更新包(update.zip)]({base}-update.zip) | 不含工具,由 Peach 更新器安装,不能单独用于首次安装 |\n"+ f"| 工具包(tools-*.zip):[FFmpeg]({base}-tools-ffmpeg.zip) / "+ f"[untrunc]({base}-tools-untrunc.zip) / [cloudflared]({base}-tools-cloudflared.zip) "+ "| 更新器按需下载,普通使用无需手动选择 |\n"+ "| `*-corresponding-source.zip` | 第三方工具源码,普通使用无需下载 |\n\n"+ "已有 Peach:在「配置 → 应用与维护」检查更新,下载完成后确认重启安装。"+ "手动更新可运行安装包,或使用完整免安装包。\n"+ )+++def build_lite_installer(output: Path, version: str, compiler: Path | None = None) -> Path:+ """将应用更新包及其工具清单编入按需下载工具的安装器。"""+ from peach.standalone_update import extract+ output = output.resolve()+ if compiler is None:+ candidates = [os.environ.get('PEACH_ISCC'), shutil.which('ISCC.exe'),+ str(Path(os.environ.get('ProgramFiles(x86)', 'C:/Program Files (x86)')) / 'Inno Setup 6/ISCC.exe'),+ str(Path(os.environ.get('LOCALAPPDATA', '')) / 'Programs/Inno Setup 6/ISCC.exe')]+ compiler = next((Path(item) for item in candidates if item and Path(item).is_file()), None)+ if compiler is None:+ raise ValueError('未取得 Inno Setup 编译器,请设置 PEACH_ISCC。')+ with tempfile.TemporaryDirectory(prefix='peach-lite-installer-') as folder:+ source = extract(output / f'Peach-{version}-windows-x64-update.zip', Path(folder).resolve(), lambda *_: None)+ read_manifest(source, version)+ subprocess.run([str(compiler), '/Q', f'/DAppVersion={version}',+ f'/DSourceDir={source}', f'/DOutputDir={output}', '/DLiteInstaller=1',+ str(Path(__file__).resolve().parent / 'installer/peach.iss')], check=True)+ target = output / f'Peach-{version}-windows-x64-lite-setup.exe'+ if not target.is_file():+ raise ValueError('轻量安装包未生成。')+ return target++def package(root: Path, output: Path, version: str) -> dict:import reif not re.fullmatch(r"\d+\.\d+\.\d+", version):@@ -50,7 +98,6 @@ def package(root: Path, output: Path, version: str) -> dict:tool_files.update(selected)manifest = {"format": 1, "version": version, "tools": tools}# 用运行时的同一判据验证生成结果,不在完整包内留下更新专用文件。- import tempfilewith tempfile.TemporaryDirectory() as temp:check = Path(temp).resolve()(check / MANIFEST).write_text(json.dumps(manifest), encoding="utf-8")@@ -59,16 +106,7 @@ def package(root: Path, output: Path, version: str) -> dict:archive(output / f"Peach-{version}-windows-x64-update.zip", root,[path for path in files if path not in tool_files], manifest)(output / "DOWNLOADS.md").write_text(- "\n## 下载选择\n\n"- "| 文件 | 用途 | 媒体工具 |\n| --- | --- | --- |\n"- f"| `Peach-{version}-windows-x64-setup.exe` | 首次安装,推荐 | 包含 FFmpeg、ffprobe、untrunc |\n"- f"| `Peach-{version}-windows-x64.zip` | 完整免安装包,解压后运行 | 包含 FFmpeg、ffprobe、untrunc |\n"- f"| `Peach-{version}-windows-x64-update.zip` | 已安装用户的应用更新包,由 Peach 更新器使用 | 复用本机工具 |\n"- f"| `Peach-{version}-windows-x64-tools-*.zip` | 更新器按需下载的工具包 | 按工具分别打包 |\n\n"- "已有 Peach 请在「配置 → 应用与维护」检查更新。更新器校验并复用已安装工具,"- "仅在工具缺失、损坏或版本变化时下载相应工具包。应用更新包不能单独用于首次安装。"- "旧版更新器首次升级仍下载完整包,之后支持工具复用。\n",- encoding="utf-8")+ download_notes(version), encoding="utf-8")return manifest@@ -77,8 +115,13 @@ def main() -> int:parser.add_argument("--source", type=Path, required=True)parser.add_argument("--output", type=Path, required=True)parser.add_argument("--version", required=True)+ parser.add_argument("--lite-installer", action="store_true", help="同时编译按需下载工具的轻量安装包")+ parser.add_argument("--iscc", type=Path, help="Inno Setup 编译器路径")args = parser.parse_args()manifest = package(args.source, args.output, args.version)+ if args.lite_installer:+ build_lite_installer(args.output, args.version, args.iscc)+ (args.output / 'DOWNLOADS.md').write_text(download_notes(args.version, lite_installer=True), encoding='utf-8')print(json.dumps({"version": manifest["version"], "tools": list(manifest["tools"])}))return 0diff --git a/scripts/smoke_split_update.py b/scripts/smoke_split_update.pyindex e2c270f9d..d73dfd86f 100644--- a/scripts/smoke_split_update.py+++ b/scripts/smoke_split_update.py@@ -5,6 +5,7 @@ import argparseimport hashlibimport jsonfrom pathlib import Path, PurePosixPath+import subprocessimport zipfile@@ -24,7 +25,7 @@ def inventory(package: zipfile.ZipFile) -> dict[str, str]:return result-def verify(root: Path, version: str, destination: Path) -> dict:+def verify(root: Path, version: str, destination: Path, *, prepare_with_app: bool = False) -> dict:prefix = f"Peach-{version}-windows-x64"if destination.exists():raise ValueError("制品验收目录须不存在")@@ -53,9 +54,21 @@ def verify(root: Path, version: str, destination: Path) -> dict:if actual != expected:raise ValueError("应用更新包与工具包不能重建完整程序")thin.extractall(destination)- for path in tools:- with zipfile.ZipFile(path) as package:- package.extractall(destination)+ if prepare_with_app:+ error = destination / 'tools-error.txt'+ process = subprocess.run([str(destination / 'Peach/Peach.exe'), '--data-root', str(destination / 'setup-data'), '--installer-tools',+ str(destination / 'empty-install'), str(root), str(error)],+ capture_output=True, timeout=120)+ if process.returncode:+ raise ValueError(error.read_text(encoding='utf-8') if error.exists() else '轻量安装工具准备失败')+ for name, checksum in expected.items():+ with (destination / name).open('rb') as source:+ if hashlib.file_digest(source, 'sha256').hexdigest() != checksum:+ raise ValueError(f'轻量安装文件不符:{name}')+ else:+ for path in tools:+ with zipfile.ZipFile(path) as package:+ package.extractall(destination)return {"files": len(expected), "tools": len(tools), "application": str(destination / "Peach/Peach.exe")}@@ -64,5 +77,7 @@ if __name__ == "__main__":parser.add_argument("--root", type=Path, default=Path.cwd())parser.add_argument("--version", required=True)parser.add_argument("--destination", type=Path, required=True)+ parser.add_argument("--prepare-with-app", action="store_true", help="由实际应用准备轻量安装所需工具")args = parser.parse_args()- print(json.dumps(verify(args.root.resolve(), args.version, args.destination.resolve()), ensure_ascii=False))+ print(json.dumps(verify(args.root.resolve(), args.version, args.destination.resolve(),+ prepare_with_app=args.prepare_with_app), ensure_ascii=False))diff --git a/src/peach/desktop_installer.py b/src/peach/desktop_installer.pyindex 2bc8bee0f..d362c5114 100644--- a/src/peach/desktop_installer.py+++ b/src/peach/desktop_installer.py@@ -140,6 +140,34 @@ def prepare(program: Path, owner: int, error_file: Path) -> int:return 1+def prepare_install_tools(program: Path, cache: Path, error_file: Path, *, stage: Path | None = None) -> int:+ """在安装器临时目录备齐工具,不读取馆藏设置或修改现有安装。"""+ from . import __version__, standalone_update, update_packages+ from .fsutil import atomic_write_text+ import tempfile+ stage = (stage or Path(sys.executable).resolve().parent).resolve()+ try:+ def fetch(url, archive, size, checksum, progress):+ cached = cache / url.rsplit('/', 1)[-1]+ if cached.is_file():+ if cached.stat().st_size != size or update_packages.digest(cached) != checksum:+ raise ValueError(f'本地工具包校验失败:{cached.name}。请重新下载或移走此文件后重试。')+ shutil.copy2(cached, archive)+ progress(size)+ else:+ standalone_update.download(url, archive, size, checksum, progress)++ release = {'latest_version': __version__,+ 'asset_url': f'https://github.com/peach-mitao/peach/releases/download/v{__version__}/package.zip'}+ with tempfile.TemporaryDirectory(prefix='peach-installer-tools-', dir=stage.parent) as folder:+ standalone_update.prepare_tools(stage, program, Path(folder).resolve(), release, {'total': 0, 'downloaded': 0},+ report=lambda data, **changes: data.update(changes), fetch=fetch)+ return 0+ except Exception as exc:+ atomic_write_text(error_file, f'媒体工具准备失败:{exc}')+ return 1++def finish_install(program: Path, owner: int) -> int:"""安装完成或取消后撤销属于这个安装器的预约。"""from . import settings_file, update_tasksdiff --git a/src/peach/standalone_update.py b/src/peach/standalone_update.pyindex a69709e55..411f060cc 100644--- a/src/peach/standalone_update.py+++ b/src/peach/standalone_update.py@@ -118,10 +118,14 @@ def download(url: str, archive: Path, size: int, digest: str, progress) -> None:raise ValueError("更新包校验失败,请重新下载")-def prepare_tools(stage: Path, target: Path, transaction: Path, release: dict, data: dict) -> None:+def prepare_tools(stage: Path, target: Path, transaction: Path, release: dict, data: dict,+ *, report=None, fetch=None) -> None:+ report, fetch = report or write, fetch or downloadmanifest = update_packages.read_manifest(stage, release["latest_version"])missing = []for tool, bundle in manifest["tools"].items():+ if update_packages.matches(stage, bundle["files"]):+ continueif update_packages.matches(target, bundle["files"]):for name in bundle["files"]:destination = update_packages.checked_path(stage, name)@@ -130,17 +134,17 @@ def prepare_tools(stage: Path, target: Path, transaction: Path, release: dict, delse:missing.append((tool, bundle))total = data["total"] + sum(bundle["asset"]["size"] for _, bundle in missing)- write(data, total=total)+ report(data, total=total)for index, (tool, bundle) in enumerate(missing):asset = bundle["asset"]archive = transaction / f"tools-{tool}.zip"received = data["downloaded"]- write(data, state="downloading", message=f"正在下载 {tool} 工具包")- download(release["asset_url"].rsplit("/", 1)[0] + "/" + asset["name"], archive,+ report(data, state="downloading", message=f"正在下载 {tool} 工具包")+ fetch(release["asset_url"].rsplit("/", 1)[0] + "/" + asset["name"], archive,asset["size"], asset["sha256"],- lambda count, start=received, step=index, size=asset["size"]: write(+ lambda count, start=received, step=index, size=asset["size"]: report(data, downloaded=start + count, progress=75 + round((step + count / size) / len(missing) * 13)))- write(data, state="verifying", message=f"正在校验 {tool} 工具包")+ report(data, state="verifying", message=f"正在校验 {tool} 工具包")extracted = extract(archive, transaction / f"tool-{tool}", lambda *_: None, tool_files=set(bundle["files"]))if not update_packages.matches(extracted, bundle["files"]):raise ValueError(f"{tool} 工具包文件校验失败")diff --git a/tests/test_desktop_installer.py b/tests/test_desktop_installer.pyindex e6e729e8b..7cad80d5a 100644--- a/tests/test_desktop_installer.py+++ b/tests/test_desktop_installer.py@@ -155,6 +155,24 @@ class InstallerDirectoryTests(unittest.TestCase):f"/DOutputDir={self.root}")self.assertTrue((self.root / "Peach-0.0.0-windows-x64-setup.exe").is_file())+ def test_lite_installer_compiles_from_the_application_update_package(self):+ from peach.update_packages import TOOL_PATHS+ from scripts.package_windows_release import package, build_lite_installer+ payload = self.root / 'payload'+ (payload / '_internal').mkdir(parents=True)+ (payload / 'Peach.exe').write_bytes(b'compile fixture')+ (payload / '_internal/standalone.txt').touch()+ for prefix, required in TOOL_PATHS.values():+ for name in required:+ target = payload / prefix / name+ target.parent.mkdir(parents=True, exist_ok=True)+ target.write_bytes(b'fixture')+ output = self.root / 'release'+ package(payload, output, '0.0.0')+ installer = build_lite_installer(output, '0.0.0', Path(self.compiler))+ self.assertTrue(installer.is_file())+ self.assertEqual(installer.name, 'Peach-0.0.0-windows-x64-lite-setup.exe')+class InstallerHandoffTests(unittest.TestCase):def setUp(self):diff --git a/tests/test_scripts.py b/tests/test_scripts.pyindex 4a31a1fe5..2a1d03ef6 100644--- a/tests/test_scripts.py+++ b/tests/test_scripts.py@@ -1566,7 +1566,7 @@ class OperationalScriptTests(unittest.TestCase):self.assertIn("full|auto|follow|catalog|media|sync|metadata|tooling|web|checks|core|packaging)", posix)# 文档里可以「提到」裸命令来说明它为什么不可信,但绝不能让它单独出现成为一条可照抄的指令。# 判据因此不是黑名单,而是:凡出现该命令的行,必须在同一行指向某个正式入口。- for relative in ("AGENTS.md", "README.md", "docs/HANDOFF.md"):+ for relative in ("AGENTS.md", "docs/TESTING.md", "docs/HANDOFF.md"):instructions = (ROOT / relative).read_text(encoding="utf-8")self.assertIn("scripts\\test.ps1", instructions)self.assertIn("scripts/test.sh", instructions)diff --git a/tests/test_standalone_update.py b/tests/test_standalone_update.pyindex 20c5b2dbd..640733971 100644--- a/tests/test_standalone_update.py+++ b/tests/test_standalone_update.py@@ -232,6 +232,82 @@ class StandaloneUpdateTests(unittest.TestCase):self.assertTrue(update_packages.matches(Path(state["stage"]), bundle["files"]))self.assertEqual((target / "tools/ffmpeg/bin/codec.dll").read_bytes(), b"different version")+ def lite_fixture(self):+ source, output, manifest, target, archive, release = self.release_fixture()+ stage = update.extract(archive, self.root / 'preflight', lambda *_: None)+ return output, manifest, target, stage, self.root / 'tools-error.txt'++ def test_lite_installer_reuses_matching_tools_without_settings_or_network(self):+ from peach.desktop_installer import prepare_install_tools+ output, manifest, target, stage, error = self.lite_fixture()+ with patch('peach.__version__', '1.0.0'), patch.object(update, 'download') as download, \+ patch.object(settings_file, 'load_config') as configuration:+ self.assertEqual(prepare_install_tools(target, output, error, stage=stage), 0)+ download.assert_not_called()+ configuration.assert_not_called()+ for bundle in manifest['tools'].values():+ self.assertTrue(update_packages.matches(stage, bundle['files']))+ self.assertEqual((target / 'Peach.exe').read_bytes(), b'old application')++ def test_lite_installer_can_prepare_a_fresh_install_from_verified_sidecar_archives(self):+ from peach.desktop_installer import prepare_install_tools+ output, manifest, _, stage, error = self.lite_fixture()+ target = self.root / 'fresh-install'+ with patch('peach.__version__', '1.0.0'), patch.object(update, 'download') as download:+ self.assertEqual(prepare_install_tools(target, output, error, stage=stage), 0)+ download.assert_not_called()+ self.assertFalse(target.exists())+ for bundle in manifest['tools'].values():+ self.assertTrue(update_packages.matches(stage, bundle['files']))++ def test_lite_installer_downloads_only_a_tool_that_fails_file_verification(self):+ from peach.desktop_installer import prepare_install_tools+ output, manifest, target, stage, error = self.lite_fixture()+ (target / 'tools/ffmpeg/bin/ffmpeg.exe').write_bytes(b'damaged tool')+ requests = []+ original_client = httpx.Client++ def respond(request):+ name = request.url.path.rsplit('/', 1)[-1]+ requests.append(name)+ return httpx.Response(200, content=(output / name).read_bytes())++ def client(*args, **kwargs):+ return original_client(*args, **kwargs, transport=httpx.MockTransport(respond), trust_env=False)++ with patch('peach.__version__', '1.0.0'), patch.object(update.httpx, 'Client', side_effect=client):+ self.assertEqual(prepare_install_tools(target, self.root / 'empty-cache', error, stage=stage), 0)+ self.assertEqual(requests, [manifest['tools']['ffmpeg']['asset']['name']])+ self.assertEqual((target / 'tools/ffmpeg/bin/ffmpeg.exe').read_bytes(), b'damaged tool')+ for bundle in manifest['tools'].values():+ self.assertTrue(update_packages.matches(stage, bundle['files']))++ def test_lite_installer_rejects_a_corrupt_archive_and_can_retry_without_touching_the_install(self):+ from peach.desktop_installer import prepare_install_tools+ output, manifest, _, stage, error = self.lite_fixture()+ target = self.root / 'existing-without-tools'+ target.mkdir()+ (target / 'Peach.exe').write_bytes(b'keep existing application')+ bad = output / manifest['tools']['ffmpeg']['asset']['name']+ valid = bad.read_bytes()+ bad.write_bytes(b'corrupt archive')+ with patch('peach.__version__', '1.0.0'), patch.object(update, 'download') as download, \+ patch('peach.desktop_installer.stop') as stop:+ self.assertEqual(prepare_install_tools(target, output, error, stage=stage), 1)+ self.assertIn('校验失败', error.read_text(encoding='utf-8'))+ bad.write_bytes(valid)+ self.assertEqual(prepare_install_tools(target, output, error, stage=stage), 0)+ download.assert_not_called()+ stop.assert_not_called()+ self.assertEqual(list(target.iterdir()), [target / 'Peach.exe'])+ self.assertEqual((target / 'Peach.exe').read_bytes(), b'keep existing application')++ def test_packaged_entry_dispatches_lite_tool_preparation(self):+ from scripts.build_app_entry import main+ with patch('peach.error_reporting.install'), patch('peach.desktop_installer.prepare_install_tools', return_value=0) as prepare:+ self.assertEqual(main(['Peach.exe', '--installer-tools', 'target', 'cache', 'error.txt']), 0)+ prepare.assert_called_once_with(Path('target'), Path('cache'), Path('error.txt'))+def test_corrupt_tool_download_leaves_the_installed_program_and_tools_untouched(self):source, output, manifest, target, archive, release = self.release_fixture()binary = target / "tools/ffmpeg/bin/ffmpeg.exe"