From 577d9e1babb7dedbf301c20c3c92e92f522c2563 Mon Sep 17 00:00:00 2001 From: phantomptr Date: Sun, 22 Nov 2026 14:39:51 -0800 Subject: [PATCH 1/7] Add to queue streams packages instead of copying them first On Upload & Install, Add to queue (single pick, batch list and the package viewer) queued a .pkg/.fpkg as an upload-then-install, so a queued package was always copied to the PS5 first. It now queues the same Stream & install the main button does, without starting the queue. Upload & install still copies first. A failed stream row keeps its Retry via upload. enqueueInstall/installStream take start:false to add without startAdded. Co-Authored-By: Claude Opus 5.5 Claude-Session: https://claude.ai/code/session_01GtiJiJdHq1hekoZ6vizvVT --- CHANGELOG.md | 1 + client/src/i18n/locales/ar.ts | 2 + client/src/i18n/locales/bn.ts | 2 + client/src/i18n/locales/de.ts | 2 + client/src/i18n/locales/en.ts | 2 + client/src/i18n/locales/es.ts | 2 + client/src/i18n/locales/fa.ts | 2 + client/src/i18n/locales/fr.ts | 2 + client/src/i18n/locales/hi.ts | 2 + client/src/i18n/locales/hu.ts | 2 + client/src/i18n/locales/id.ts | 2 + client/src/i18n/locales/it.ts | 2 + client/src/i18n/locales/ja.ts | 2 + client/src/i18n/locales/ko.ts | 2 + client/src/i18n/locales/pl.ts | 2 + client/src/i18n/locales/pt-BR.ts | 2 + client/src/i18n/locales/ru.ts | 2 + client/src/i18n/locales/th.ts | 2 + client/src/i18n/locales/tr.ts | 2 + client/src/i18n/locales/vi.ts | 2 + client/src/i18n/locales/zh-CN.ts | 2 + client/src/i18n/locales/zh-TW.ts | 2 + client/src/screens/Upload/BatchReview.tsx | 24 ++++- client/src/screens/Upload/index.tsx | 91 +++++++++++-------- .../src/screens/Upload/streamPackages.test.ts | 33 +++++++ client/src/screens/Upload/streamPackages.ts | 37 ++++++++ client/src/state/consoleQueueBridge.ts | 3 + client/src/state/pkgLibrary.ts | 3 + client/src/state/uploadQueue.test.ts | 25 +++++ client/src/state/uploadQueue.ts | 3 +- scripts/i18n-source-hashes.json | 2 + 31 files changed, 223 insertions(+), 41 deletions(-) create mode 100644 client/src/screens/Upload/streamPackages.test.ts create mode 100644 client/src/screens/Upload/streamPackages.ts diff --git a/CHANGELOG.md b/CHANGELOG.md index ab5d8e086..e09234368 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -9,6 +9,7 @@ What's new in ps5upload, written for humans. **Uploads** - **The check on the PS5 after an upload shows its progress (#873).** Before a big file counts as done, the PS5 reads it back from its drive to check it. When the drive can't keep up while the file is still arriving, part of that check is left for after the last byte, which on a 70–160 GB game can take several minutes, and the row said the PS5 had reported no progress. It now shows "Checking on the PS5: X of Y" with the time left, and the no-progress warning stays off while the check moves. - **A stopped upload that you resume isn't checked twice (#873).** The part the PS5 had already checked before the Stop isn't read again, as long as the helper wasn't restarted in between and the file hasn't changed since. Tried on a PS5: a 20 GB upload stopped at 10 GB and resumed checked only the new 10 GB. +- **Add to queue streams packages too.** On Upload & Install, Add to queue used to copy a .pkg or .fpkg to the PS5 before installing it. It now adds it as a Stream & install, the same as the main button, but waits for Start queue. To copy a package first, use Upload & install. **Other** - **Clear all in the notification bell (#911).** Thanks @Dang3rZone. diff --git a/client/src/i18n/locales/ar.ts b/client/src/i18n/locales/ar.ts index 50d23382d..f5cbce5ee 100644 --- a/client/src/i18n/locales/ar.ts +++ b/client/src/i18n/locales/ar.ts @@ -455,6 +455,7 @@ queue_title: "قائمة الانتظار", "batch_resume_hint": "عند الإيقاف: يُستبدل كل وجهة موجودة.", "batch_upload_now": "رفع {count} الآن", "batch_add": "إضافة {count} إلى قائمة الانتظار", +"batch_add_stream_hint": "تنضم الحزم إلى قائمة الانتظار كـ «بث وتثبيت»، فلا يُنسخ شيء إلى PS5 أولًا. يضيفها دون بدء قائمة الانتظار.", "batch_scan": "إضافة ألعاب من مجلد…", "cq_not_games": "تم تخطي {count} مجلد(ات) لأنها ليست ألعابًا.", "cq_skipped_not_image": "تم تخطي {count}: لا يمكن أن يصبح صورة لعبة إلا مجلد لعبة أو صورة لعبة أو حزمة أو أرشيف (.zip أو .7z أو .rar).", @@ -1535,6 +1536,7 @@ sendpayload_elfldr_convention: "يطابق اصطلاح elfldr — قم بالت sendpayload_sent_followup: "إذا كان الملف عبارة عن حمولة عاملة، فإن جهاز PS5 الخاص بك يقوم بتشغيله الآن. لا تومض معظم اللوادر بتغيير واضح في واجهة المستخدم — تحقق من إشعار الحمولة أو مؤشر الحالة على وحدة التحكم.", sendpayload_no_sends_yet: "لا توجد عمليات إرسال حتى الآن. ستظهر عمليات الإرسال الناجحة والفشلة هنا لإعادة التشغيل السريع.", upload_add_to_queue_tooltip: "أضف هذا التحميل إلى قائمة الانتظار دون بدء تشغيله", +upload_add_stream_to_queue_tooltip: "أضف «بث وتثبيت» إلى قائمة الانتظار دون بدئها. لا يُنسخ شيء إلى PS5 أولًا.", upload_dialog_resume_desc: "تخطي الملفات الموجودة بالفعل ؛ فقط أرسل ما هو جديد أو تم تغييره. يقارن أحجام الملفات - التحقق من BLAKE3 لكل شارد على التحميل الفعلي يكتشف أي عدم تطابق.", upload_dialog_turn_off_prompt: "يمكنك إيقاف تشغيل هذه المطالبة في \"→تحميل الإعدادات\".", upload_status_checking_existing: "التحقق مما هو موجود بالفعل على جهاز PS5 الخاص بك...", diff --git a/client/src/i18n/locales/bn.ts b/client/src/i18n/locales/bn.ts index f577afc33..c4881f32e 100644 --- a/client/src/i18n/locales/bn.ts +++ b/client/src/i18n/locales/bn.ts @@ -455,6 +455,7 @@ queue_title: "সারি", "batch_resume_hint": "বন্ধ থাকলে: আগে থেকে থাকা প্রতিটি গন্তব্য প্রতিস্থাপিত হবে।", "batch_upload_now": "এখনই {count}টি আপলোড", "batch_add": "{count}টি কিউতে যোগ করুন", +"batch_add_stream_hint": "প্যাকেজগুলো স্ট্রিম ও ইনস্টল হিসেবে কিউতে যোগ হয়, তাই আগে PS5-এ কিছুই কপি হয় না। কিউ শুরু না করেই এগুলো যোগ করে।", "batch_scan": "একটি ফোল্ডার থেকে গেম যোগ করুন…", "cq_not_games": "{count}টি ফোল্ডার গেম নয়, তাই বাদ দেওয়া হয়েছে।", "cq_skipped_not_image": "{count}টি বাদ দেওয়া হয়েছে: শুধু গেম ফোল্ডার, গেম ইমেজ, প্যাকেজ বা আর্কাইভ (.zip, .7z, .rar) গেম ইমেজ হতে পারে।", @@ -1460,6 +1461,7 @@ shortcuts_title: "কীবোর্ড শর্টকাট", smp_blank_delete: "(খালি=মুছুন)", upload_add_to_queue: "সারিতে যোগ করুন", upload_add_to_queue_tooltip: "এই আপলোডটি শুরু না করে সারিতে যোগ করুন", +upload_add_stream_to_queue_tooltip: "কিউ শুরু না করেই একটি স্ট্রিম ও ইনস্টল কিউতে যোগ করুন। আগে PS5-এ কিছুই কপি হয় না।", upload_apply_exclude_rules: "বাদ দেওয়ার নিয়ম প্রয়োগ করুন", upload_change_source: "উৎস পরিবর্তন করুন", upload_choose_diff_source: "একটি ভিন্ন উৎস বেছে নিন", diff --git a/client/src/i18n/locales/de.ts b/client/src/i18n/locales/de.ts index fc175d24f..b914d5f8b 100644 --- a/client/src/i18n/locales/de.ts +++ b/client/src/i18n/locales/de.ts @@ -456,6 +456,7 @@ queue_title: "Warteschlange", "batch_resume_hint": "Aus: Jedes bereits vorhandene Ziel wird ersetzt.", "batch_upload_now": "{count} jetzt hochladen", "batch_add": "{count} zur Warteschlange", +"batch_add_stream_hint": "Pakete kommen als „Streamen & installieren“ in die Warteschlange, es wird also nichts vorher auf die PS5 kopiert. Fügt sie hinzu, ohne die Warteschlange zu starten.", "batch_scan": "Spiele aus einem Ordner hinzufügen…", "cq_not_games": "{count} Ordner waren keine Spiele und wurden übersprungen.", "cq_skipped_not_image": "{count} übersprungen: Nur ein Spielordner, ein Spiel-Image, ein Paket oder ein Archiv (.zip, .7z, .rar) kann zu einem Spiel-Image werden.", @@ -1461,6 +1462,7 @@ shortcuts_title: "Tastenkürzel", smp_blank_delete: "(leer = löschen)", upload_add_to_queue: "Zur Warteschlange hinzufügen", upload_add_to_queue_tooltip: "Diesen Upload zur Warteschlange hinzufügen, ohne ihn zu starten", +upload_add_stream_to_queue_tooltip: "„Streamen & installieren“ zur Warteschlange hinzufügen, ohne sie zu starten. Es wird nichts vorher auf die PS5 kopiert.", upload_apply_exclude_rules: "Ausschlussregeln anwenden", upload_change_source: "Quelle ändern", upload_choose_diff_source: "Andere Quelle wählen", diff --git a/client/src/i18n/locales/en.ts b/client/src/i18n/locales/en.ts index 533c774ce..37d65d94d 100644 --- a/client/src/i18n/locales/en.ts +++ b/client/src/i18n/locales/en.ts @@ -725,6 +725,7 @@ queue_title: "Queue", "batch_resume_hint": "Off: every destination that already exists is replaced.", "batch_upload_now": "Upload {count} now", "batch_add": "Add {count} to queue", +"batch_add_stream_hint": "Packages join the queue as Stream & install, so nothing is copied to the PS5 first. Adds them without starting the queue.", "batch_scan": "Add games from a folder…", "cq_not_games": "{count} folder(s) were not games and were skipped.", "cq_skipped_not_image": "Skipped {count}: only a game folder, game image, package or archive (.zip, .7z, .rar) can become a game image.", @@ -2620,6 +2621,7 @@ sendpayload_sent_followup: "If the file was a working payload, your PS5 is now r sendpayload_no_sends_yet: "No sends yet. Successful and failed sends will both appear here for quick replay.", settings_schedule_label_placeholder_v2: "Label (e.g. back up saves)", upload_add_to_queue_tooltip: "Add this upload to the queue without starting it", +upload_add_stream_to_queue_tooltip: "Add a Stream & install to the queue without starting it. Nothing is copied to the PS5 first.", upload_dialog_resume_desc: "Skip files that are already there; only send what's new or changed. Compares file sizes -- per-shard BLAKE3 verification on the actual upload catches any mismatch.", upload_dialog_turn_off_prompt: "You can turn off this prompt in Settings → Upload.", upload_status_checking_existing: "Checking what's already on your PS5…", diff --git a/client/src/i18n/locales/es.ts b/client/src/i18n/locales/es.ts index d3ad85289..eebb549f7 100644 --- a/client/src/i18n/locales/es.ts +++ b/client/src/i18n/locales/es.ts @@ -455,6 +455,7 @@ queue_title: "Cola", "batch_resume_hint": "Desactivado: se reemplaza cada destino que ya exista.", "batch_upload_now": "Subir {count} ahora", "batch_add": "Añadir {count} a la cola", +"batch_add_stream_hint": "Los paquetes se añaden a la cola como Transmitir e instalar, así que no se copia nada a la PS5 antes. Los añade sin iniciar la cola.", "batch_scan": "Añadir juegos de una carpeta…", "cq_not_games": "{count} carpeta(s) no eran juegos y se omitieron.", "cq_skipped_not_image": "Omitidos {count}: solo una carpeta de juego, una imagen de juego, un paquete o un archivo comprimido (.zip, .7z, .rar) puede convertirse en una imagen de juego.", @@ -1460,6 +1461,7 @@ shortcuts_title: "Atajos de teclado", smp_blank_delete: "(vacío = eliminar)", upload_add_to_queue: "Añadir a la cola", upload_add_to_queue_tooltip: "Añadir esta subida a la cola sin iniciarla", +upload_add_stream_to_queue_tooltip: "Añade un Transmitir e instalar a la cola sin iniciarla. No se copia nada a la PS5 antes.", upload_apply_exclude_rules: "Aplicar reglas de exclusión", upload_change_source: "Cambiar origen", upload_choose_diff_source: "Elegir una fuente diferente", diff --git a/client/src/i18n/locales/fa.ts b/client/src/i18n/locales/fa.ts index bcaffef8f..08d8dd4ac 100644 --- a/client/src/i18n/locales/fa.ts +++ b/client/src/i18n/locales/fa.ts @@ -674,6 +674,7 @@ queue_title: "صف", "batch_resume_hint": "خاموش: هر مقصدی که از قبل وجود دارد جایگزین می‌شود.", "batch_upload_now": "بارگذاری {count} الان", "batch_add": "افزودن {count} به صف", +"batch_add_stream_hint": "بسته‌ها به‌صورت «استریم و نصب» به صف اضافه می‌شوند، پس از قبل چیزی روی PS5 کپی نمی‌شود. آن‌ها را بدون شروع صف اضافه می‌کند.", "batch_scan": "افزودن بازی از پوشه…", "cq_not_games": "{count} پوشه بازی نبودند و رد شدند.", "cq_skipped_not_image": "{count} مورد رد شد: فقط پوشهٔ بازی، ایمیج بازی، بسته یا آرشیو (.zip، .7z، .rar) می‌تواند به ایمیج بازی تبدیل شود.", @@ -2449,6 +2450,7 @@ sendpayload_elfldr_convention: "مطابق قرارداد elfldr — تنها ا sendpayload_sent_followup: "اگر فایل یک payload کارآمد بود، PS5 شما اکنون آن را اجرا می‌کند. بیشتر بارگذارها تغییر رابط آشکاری نشان نمی‌دهند — اعلان یا نشانگر وضعیت خود payload را روی کنسول بررسی کنید.", sendpayload_no_sends_yet: "هنوز ارسالی نیست. ارسال‌های موفق و ناموفق هر دو برای پخش سریع اینجا ظاهر می‌شوند.", upload_add_to_queue_tooltip: "این بارگذاری را بدون شروع به صف اضافه کن", +upload_add_stream_to_queue_tooltip: "یک «استریم و نصب» را بدون شروع صف به آن اضافه کنید. از قبل چیزی روی PS5 کپی نمی‌شود.", upload_dialog_resume_desc: "از فایل‌هایی که از قبل آنجا هستند صرف‌نظر می‌کند؛ فقط آنچه جدید یا تغییر کرده ارسال می‌شود. اندازه‌ی فایل‌ها را مقایسه می‌کند — تأیید هر shard BLAKE3 در بارگذاری واقعی هر مغایرتی را می‌گیرد.", upload_dialog_turn_off_prompt: "می‌توانید این پرسش را در Settings ← Upload خاموش کنید.", upload_status_checking_existing: "بررسی آنچه از قبل روی PS5 شما هست…", diff --git a/client/src/i18n/locales/fr.ts b/client/src/i18n/locales/fr.ts index af3dc584d..c08525b9e 100644 --- a/client/src/i18n/locales/fr.ts +++ b/client/src/i18n/locales/fr.ts @@ -455,6 +455,7 @@ queue_title: "File d’attente", "batch_resume_hint": "Désactivé : chaque destination existante est remplacée.", "batch_upload_now": "Téléverser {count} maintenant", "batch_add": "Ajouter {count} à la file", +"batch_add_stream_hint": "Les paquets rejoignent la file en Diffuser et installer : rien n'est copié sur la PS5 au préalable. Les ajoute sans démarrer la file.", "batch_scan": "Ajouter les jeux d'un dossier…", "cq_not_games": "{count} dossier(s) n'étaient pas des jeux et ont été ignorés.", "cq_skipped_not_image": "{count} ignoré(s) : seul un dossier de jeu, une image de jeu, un paquet ou une archive (.zip, .7z, .rar) peut devenir une image de jeu.", @@ -1460,6 +1461,7 @@ shortcuts_title: "Raccourcis clavier", smp_blank_delete: "(vide = supprimer)", upload_add_to_queue: "Ajouter à la file d'attente", upload_add_to_queue_tooltip: "Ajouter cet envoi à la file d'attente sans le démarrer", +upload_add_stream_to_queue_tooltip: "Ajouter un Diffuser et installer à la file sans la démarrer. Rien n'est copié sur la PS5 au préalable.", upload_apply_exclude_rules: "Appliquer les règles d'exclusion", upload_change_source: "Changer de source", upload_choose_diff_source: "Choisir une autre source", diff --git a/client/src/i18n/locales/hi.ts b/client/src/i18n/locales/hi.ts index fcec19b64..719055803 100644 --- a/client/src/i18n/locales/hi.ts +++ b/client/src/i18n/locales/hi.ts @@ -455,6 +455,7 @@ queue_title: "कतार", "batch_resume_hint": "बंद: पहले से मौजूद हर गंतव्य बदल दिया जाएगा।", "batch_upload_now": "{count} अभी अपलोड करें", "batch_add": "{count} कतार में जोड़ें", +"batch_add_stream_hint": "पैकेज स्ट्रीम और इंस्टॉल के रूप में कतार में जुड़ते हैं, इसलिए पहले PS5 पर कुछ भी कॉपी नहीं होता। कतार शुरू किए बिना इन्हें जोड़ता है।", "batch_scan": "फ़ोल्डर से गेम जोड़ें…", "cq_not_games": "{count} फ़ोल्डर गेम नहीं थे, इसलिए छोड़ दिए गए।", "cq_skipped_not_image": "{count} छोड़े गए: केवल गेम फ़ोल्डर, गेम इमेज, पैकेज या आर्काइव (.zip, .7z, .rar) ही गेम इमेज बन सकता है।", @@ -1461,6 +1462,7 @@ shortcuts_title: "कीबोर्ड शॉर्टकट", smp_blank_delete: "(खाली=हटाएँ)", upload_add_to_queue: "कतार में जोड़ें", upload_add_to_queue_tooltip: "इस अपलोड को शुरू किए बिना कतार में जोड़ें", +upload_add_stream_to_queue_tooltip: "कतार शुरू किए बिना उसमें एक स्ट्रीम और इंस्टॉल जोड़ें। पहले PS5 पर कुछ भी कॉपी नहीं होता।", upload_apply_exclude_rules: "बहिष्करण नियम लागू करें", upload_change_source: "स्रोत बदलें", upload_choose_diff_source: "एक अलग स्रोत चुनें", diff --git a/client/src/i18n/locales/hu.ts b/client/src/i18n/locales/hu.ts index 06a339fef..343c9cdaf 100644 --- a/client/src/i18n/locales/hu.ts +++ b/client/src/i18n/locales/hu.ts @@ -676,6 +676,7 @@ queue_title: "Sor", "batch_resume_hint": "Ki: minden már létező cél felülíródik.", "batch_upload_now": "{count} feltöltése most", "batch_add": "{count} hozzáadása a sorhoz", +"batch_add_stream_hint": "A csomagok Streamelés és telepítés módban kerülnek a sorba, így előtte semmi sem másolódik a PS5-re. A sor elindítása nélkül adja hozzá őket.", "batch_scan": "Játékok hozzáadása mappából…", "cq_not_games": "{count} mappa nem játék volt, ezért kihagytuk.", "cq_skipped_not_image": "{count} kihagyva: játékképfájl csak játékmappából, játékképfájlból, csomagból vagy archívumból (.zip, .7z, .rar) készülhet.", @@ -2271,6 +2272,7 @@ sendpayload_elfldr_convention: "megfelel az elfldr konvenciónak — csak akkor sendpayload_sent_followup: "Ha a fájl egy működő payload volt, a PS5-öd most már futtatja. A legtöbb loader nem villant fel egyértelmű UI-változást — nézd meg a payload saját értesítését vagy állapotjelzőjét a konzolon.", sendpayload_no_sends_yet: "Még nincs küldés. A sikeres és sikertelen küldések is itt fognak megjelenni gyors visszajátszáshoz.", upload_add_to_queue_tooltip: "Feltöltés hozzáadása a várólistához indítás nélkül", +upload_add_stream_to_queue_tooltip: "Streamelés és telepítés hozzáadása a sorhoz annak elindítása nélkül. Előtte semmi sem másolódik a PS5-re.", upload_dialog_resume_desc: "Kihagyja a már ott lévő fájlokat; csak az újat vagy módosultat küldi. Fájlméretet hasonlít össze -- a tényleges feltöltés shardonkénti BLAKE3-ellenőrzése minden eltérést elkap.", upload_dialog_turn_off_prompt: "Ezt a felkérést kikapcsolhatod a Beállítások → Feltöltés alatt.", upload_status_checking_existing: "Ellenőrzés, mi van már a PS5-ödön…", diff --git a/client/src/i18n/locales/id.ts b/client/src/i18n/locales/id.ts index 8d859fc3f..52ead195e 100644 --- a/client/src/i18n/locales/id.ts +++ b/client/src/i18n/locales/id.ts @@ -455,6 +455,7 @@ queue_title: "Antrean", "batch_resume_hint": "Mati: setiap tujuan yang sudah ada akan diganti.", "batch_upload_now": "Unggah {count} sekarang", "batch_add": "Tambahkan {count} ke antrean", +"batch_add_stream_hint": "Paket masuk antrean sebagai Stream & instal, jadi tidak ada yang disalin ke PS5 lebih dulu. Menambahkannya tanpa memulai antrean.", "batch_scan": "Tambahkan game dari folder…", "cq_not_games": "{count} folder bukan game dan dilewati.", "cq_skipped_not_image": "{count} dilewati: hanya folder game, image game, paket, atau arsip (.zip, .7z, .rar) yang dapat dijadikan image game.", @@ -1460,6 +1461,7 @@ shortcuts_title: "Pintasan keyboard", smp_blank_delete: "(kosong=hapus)", upload_add_to_queue: "Tambah ke antrean", upload_add_to_queue_tooltip: "Tambahkan unggahan ini ke antrean tanpa memulainya", +upload_add_stream_to_queue_tooltip: "Tambahkan Stream & instal ke antrean tanpa memulainya. Tidak ada yang disalin ke PS5 lebih dulu.", upload_apply_exclude_rules: "Terapkan aturan pengecualian", upload_change_source: "Ganti sumber", upload_choose_diff_source: "Pilih sumber yang berbeda", diff --git a/client/src/i18n/locales/it.ts b/client/src/i18n/locales/it.ts index a07f1ba56..8686ac6ff 100644 --- a/client/src/i18n/locales/it.ts +++ b/client/src/i18n/locales/it.ts @@ -455,6 +455,7 @@ queue_title: "Coda", "batch_resume_hint": "Disattivato: ogni destinazione esistente viene sostituita.", "batch_upload_now": "Carica {count} ora", "batch_add": "Aggiungi {count} alla coda", +"batch_add_stream_hint": "I pacchetti entrano in coda come Trasmetti e installa, quindi nulla viene copiato prima sulla PS5. Li aggiunge senza avviare la coda.", "batch_scan": "Aggiungi giochi da una cartella…", "cq_not_games": "{count} cartella/e non erano giochi e sono state saltate.", "cq_skipped_not_image": "{count} saltati: solo una cartella di gioco, un'immagine di gioco, un pacchetto o un archivio (.zip, .7z, .rar) può diventare un'immagine di gioco.", @@ -1460,6 +1461,7 @@ shortcuts_title: "Scorciatoie da tastiera", smp_blank_delete: "(vuoto = elimina)", upload_add_to_queue: "Aggiungi alla coda", upload_add_to_queue_tooltip: "Aggiungi questo caricamento alla coda senza avviarlo", +upload_add_stream_to_queue_tooltip: "Aggiungi un Trasmetti e installa alla coda senza avviarla. Nulla viene copiato prima sulla PS5.", upload_apply_exclude_rules: "Applica regole di esclusione", upload_change_source: "Cambia origine", upload_choose_diff_source: "Scegli un'altra origine", diff --git a/client/src/i18n/locales/ja.ts b/client/src/i18n/locales/ja.ts index 612ba0113..c28f6658e 100644 --- a/client/src/i18n/locales/ja.ts +++ b/client/src/i18n/locales/ja.ts @@ -456,6 +456,7 @@ queue_title: "キュー", "batch_resume_hint": "オフ:既存の保存先はすべて置き換えます。", "batch_upload_now": "{count} 件を今すぐアップロード", "batch_add": "{count} 件をキューに追加", +"batch_add_stream_hint": "パッケージはストリーム&インストールとしてキューに入るため、先に PS5 へコピーされることはありません。キューを開始せずに追加します。", "batch_scan": "フォルダーからゲームを追加…", "cq_not_games": "{count} 個のフォルダーはゲームではないためスキップしました。", "cq_skipped_not_image": "{count} 件をスキップ: ゲームイメージにできるのは、ゲームフォルダー、ゲームイメージ、パッケージ、またはアーカイブ (.zip、.7z、.rar) だけです。", @@ -1461,6 +1462,7 @@ shortcuts_title: "キーボードショートカット", smp_blank_delete: "(空欄=削除)", upload_add_to_queue: "キューに追加", upload_add_to_queue_tooltip: "このアップロードを開始せずにキューに追加します", +upload_add_stream_to_queue_tooltip: "キューを開始せずにストリーム&インストールを追加します。先に PS5 へコピーされることはありません。", upload_apply_exclude_rules: "除外ルールを適用", upload_change_source: "ソースを変更", upload_choose_diff_source: "別のソースを選択", diff --git a/client/src/i18n/locales/ko.ts b/client/src/i18n/locales/ko.ts index 5f55c3aea..19679dd8a 100644 --- a/client/src/i18n/locales/ko.ts +++ b/client/src/i18n/locales/ko.ts @@ -456,6 +456,7 @@ queue_title: "대기열", "batch_resume_hint": "끄면: 이미 있는 대상은 모두 교체됩니다.", "batch_upload_now": "지금 {count}개 업로드", "batch_add": "대기열에 {count}개 추가", +"batch_add_stream_hint": "패키지는 스트림 및 설치로 대기열에 추가되므로 PS5에 먼저 복사되는 것이 없습니다. 대기열을 시작하지 않고 추가합니다.", "batch_scan": "폴더에서 게임 추가…", "cq_not_games": "폴더 {count}개는 게임이 아니어서 건너뛰었습니다.", "cq_skipped_not_image": "{count}개 건너뜀: 게임 폴더, 게임 이미지, 패키지 또는 압축 파일(.zip, .7z, .rar)만 게임 이미지로 만들 수 있습니다.", @@ -1461,6 +1462,7 @@ shortcuts_title: "키보드 단축키", smp_blank_delete: "(공백=삭제)", upload_add_to_queue: "대기열에 추가", upload_add_to_queue_tooltip: "이 업로드를 시작하지 않고 대기열에 추가합니다", +upload_add_stream_to_queue_tooltip: "대기열을 시작하지 않고 스트림 및 설치를 추가합니다. PS5에 먼저 복사되는 것이 없습니다.", upload_apply_exclude_rules: "제외 규칙 적용", upload_change_source: "소스 변경", upload_choose_diff_source: "다른 소스 선택", diff --git a/client/src/i18n/locales/pl.ts b/client/src/i18n/locales/pl.ts index 09d02ac31..ae5736502 100644 --- a/client/src/i18n/locales/pl.ts +++ b/client/src/i18n/locales/pl.ts @@ -664,6 +664,7 @@ queue_title: "Kolejka", "batch_resume_hint": "Wyłączone: każde istniejące miejsce docelowe zostanie zastąpione.", "batch_upload_now": "Wyślij teraz: {count}", "batch_add": "Dodaj do kolejki: {count}", +"batch_add_stream_hint": "Pakiety trafiają do kolejki jako Strumieniuj i zainstaluj, więc nic nie jest najpierw kopiowane na PS5. Dodaje je bez uruchamiania kolejki.", "batch_scan": "Dodaj gry z folderu…", "cq_not_games": "Pominięto foldery niebędące grami: {count}.", "cq_skipped_not_image": "Pominięto {count}: obrazem gry może stać się tylko folder gry, obraz gry, pakiet lub archiwum (.zip, .7z, .rar).", @@ -1994,6 +1995,7 @@ sendpayload_elfldr_convention: "zgodne z konwencją elfldr — zmień tylko wted sendpayload_sent_followup: "Jeśli plik był działającym payloadem, Twoje PS5 teraz go uruchamia. Większość loaderów nie wyświetla wyraźnych zmian w interfejsie — sprawdź powiadomienie lub wskaźnik stanu samego payloadu na konsoli.", sendpayload_no_sends_yet: "Brak wysłanych plików. Zarówno udane, jak i nieudane próby pojawią się tutaj w celu szybkiego ponowienia.", upload_add_to_queue_tooltip: "Dodaj to przesyłanie do kolejki bez uruchamiania go", +upload_add_stream_to_queue_tooltip: "Dodaj Strumieniuj i zainstaluj do kolejki bez jej uruchamiania. Nic nie jest najpierw kopiowane na PS5.", upload_dialog_resume_desc: "Pomiń pliki, które już tam są; wyślij tylko to, co nowe lub zmienione. Porównuje rozmiary plików — weryfikacja BLAKE3 dla każdego sharda podczas właściwego przesyłania wyłapie wszelkie niezgodności.", upload_dialog_turn_off_prompt: "Możesz wyłączyć ten monit w Ustawienia → Przesyłanie.", upload_status_checking_existing: "Sprawdzanie, co znajduje się już na Twoim PS5…", diff --git a/client/src/i18n/locales/pt-BR.ts b/client/src/i18n/locales/pt-BR.ts index 3f9b937e8..c82f3e80e 100644 --- a/client/src/i18n/locales/pt-BR.ts +++ b/client/src/i18n/locales/pt-BR.ts @@ -455,6 +455,7 @@ queue_title: "Fila", "batch_resume_hint": "Desativado: cada destino existente é substituído.", "batch_upload_now": "Enviar {count} agora", "batch_add": "Adicionar {count} à fila", +"batch_add_stream_hint": "Os pacotes entram na fila como Transmitir e instalar, então nada é copiado para o PS5 antes. Adiciona sem iniciar a fila.", "batch_scan": "Adicionar jogos de uma pasta…", "cq_not_games": "{count} pasta(s) não eram jogos e foram ignoradas.", "cq_skipped_not_image": "{count} ignorado(s): somente uma pasta de jogo, imagem de jogo, pacote ou arquivo compactado (.zip, .7z, .rar) pode virar uma imagem de jogo.", @@ -1460,6 +1461,7 @@ shortcuts_title: "Atalhos de teclado", smp_blank_delete: "(em branco=excluir)", upload_add_to_queue: "Adicionar à fila", upload_add_to_queue_tooltip: "Adicionar este envio à fila sem iniciá-lo", +upload_add_stream_to_queue_tooltip: "Adiciona um Transmitir e instalar à fila sem iniciá-la. Nada é copiado para o PS5 antes.", upload_apply_exclude_rules: "Aplicar regras de exclusão", upload_change_source: "Trocar origem", upload_choose_diff_source: "Escolher uma origem diferente", diff --git a/client/src/i18n/locales/ru.ts b/client/src/i18n/locales/ru.ts index c8b340339..33f69cd92 100644 --- a/client/src/i18n/locales/ru.ts +++ b/client/src/i18n/locales/ru.ts @@ -455,6 +455,7 @@ queue_title: "Очередь", "batch_resume_hint": "Выкл.: все уже существующие места назначения заменяются.", "batch_upload_now": "Загрузить сейчас: {count}", "batch_add": "Добавить в очередь: {count}", +"batch_add_stream_hint": "Пакеты попадают в очередь как «Стриминг и установка», поэтому на PS5 заранее ничего не копируется. Добавляет их, не запуская очередь.", "batch_scan": "Добавить игры из папки…", "cq_not_games": "Пропущено папок, не являющихся играми: {count}.", "cq_skipped_not_image": "Пропущено {count}: образом игры может стать только папка игры, образ игры, пакет или архив (.zip, .7z, .rar).", @@ -1460,6 +1461,7 @@ shortcuts_title: "Сочетания клавиш", smp_blank_delete: "(пусто=удалить)", upload_add_to_queue: "Добавить в очередь", upload_add_to_queue_tooltip: "Добавить эту загрузку в очередь, не запуская её", +upload_add_stream_to_queue_tooltip: "Добавить «Стриминг и установку» в очередь, не запуская её. На PS5 заранее ничего не копируется.", upload_apply_exclude_rules: "Применить правила исключения", upload_change_source: "Сменить источник", upload_choose_diff_source: "Выбрать другой источник", diff --git a/client/src/i18n/locales/th.ts b/client/src/i18n/locales/th.ts index 7e7448380..762f33a05 100644 --- a/client/src/i18n/locales/th.ts +++ b/client/src/i18n/locales/th.ts @@ -455,6 +455,7 @@ queue_title: "คิว", "batch_resume_hint": "ปิด: ปลายทางที่มีอยู่แล้วทั้งหมดจะถูกแทนที่", "batch_upload_now": "อัปโหลด {count} ตอนนี้", "batch_add": "เพิ่ม {count} ลงคิว", +"batch_add_stream_hint": "แพ็กเกจจะเข้าคิวแบบสตรีมและติดตั้ง จึงไม่มีการคัดลอกไปยัง PS5 ก่อน เพิ่มโดยไม่เริ่มคิว", "batch_scan": "เพิ่มเกมจากโฟลเดอร์…", "cq_not_games": "ข้าม {count} โฟลเดอร์ที่ไม่ใช่เกม", "cq_skipped_not_image": "ข้าม {count} รายการ: เฉพาะโฟลเดอร์เกม อิมเมจเกม แพ็กเกจ หรือไฟล์บีบอัด (.zip, .7z, .rar) เท่านั้นที่สร้างเป็นอิมเมจเกมได้", @@ -1460,6 +1461,7 @@ shortcuts_title: "แป้นพิมพ์ลัด", smp_blank_delete: "(ว่าง=ลบ)", upload_add_to_queue: "เพิ่มลงในคิว", upload_add_to_queue_tooltip: "เพิ่มการอัปโหลดนี้ลงในคิวโดยไม่เริ่มทันที", +upload_add_stream_to_queue_tooltip: "เพิ่มสตรีมและติดตั้งลงในคิวโดยไม่เริ่มคิว ไม่มีการคัดลอกไปยัง PS5 ก่อน", upload_apply_exclude_rules: "ใช้กฎการยกเว้น", upload_change_source: "เปลี่ยนต้นทาง", upload_choose_diff_source: "เลือกแหล่งที่มาอื่น", diff --git a/client/src/i18n/locales/tr.ts b/client/src/i18n/locales/tr.ts index 5aaf44b54..4ebae31c8 100644 --- a/client/src/i18n/locales/tr.ts +++ b/client/src/i18n/locales/tr.ts @@ -455,6 +455,7 @@ queue_title: "Kuyruk", "batch_resume_hint": "Kapalı: var olan her hedef değiştirilir.", "batch_upload_now": "{count} öğeyi şimdi yükle", "batch_add": "{count} öğeyi kuyruğa ekle", +"batch_add_stream_hint": "Paketler kuyruğa Akışla kur olarak eklenir, yani önce PS5'e hiçbir şey kopyalanmaz. Kuyruğu başlatmadan ekler.", "batch_scan": "Klasörden oyun ekle…", "cq_not_games": "{count} klasör oyun değildi ve atlandı.", "cq_skipped_not_image": "{count} atlandı: yalnızca bir oyun klasörü, oyun imajı, paket veya arşiv (.zip, .7z, .rar) oyun imajına dönüştürülebilir.", @@ -1460,6 +1461,7 @@ shortcuts_title: "Klavye kısayolları", smp_blank_delete: "(boş=sil)", upload_add_to_queue: "Kuyruğa ekle", upload_add_to_queue_tooltip: "Bu yüklemeyi başlatmadan kuyruğa ekle", +upload_add_stream_to_queue_tooltip: "Kuyruğu başlatmadan bir Akışla kur ekler. Önce PS5'e hiçbir şey kopyalanmaz.", upload_apply_exclude_rules: "Hariç tutma kurallarını uygula", upload_change_source: "Kaynağı değiştir", upload_choose_diff_source: "Farklı bir kaynak seç", diff --git a/client/src/i18n/locales/vi.ts b/client/src/i18n/locales/vi.ts index 29523f8c2..e0960305e 100644 --- a/client/src/i18n/locales/vi.ts +++ b/client/src/i18n/locales/vi.ts @@ -456,6 +456,7 @@ queue_title: "Hàng đợi", "batch_resume_hint": "Tắt: mọi đích đã có sẽ bị thay thế.", "batch_upload_now": "Tải lên {count} ngay", "batch_add": "Thêm {count} vào hàng đợi", +"batch_add_stream_hint": "Các gói được thêm vào hàng đợi dưới dạng Truyền và cài đặt, nên không có gì được sao chép sang PS5 trước. Thêm mà không bắt đầu hàng đợi.", "batch_scan": "Thêm game từ thư mục…", "cq_not_games": "Đã bỏ qua {count} thư mục không phải game.", "cq_skipped_not_image": "Đã bỏ qua {count}: chỉ thư mục game, image game, gói hoặc tệp nén (.zip, .7z, .rar) mới có thể thành image game.", @@ -1462,6 +1463,7 @@ shortcuts_title: "Phím tắt", smp_blank_delete: "(để trống=xóa)", upload_add_to_queue: "Thêm vào hàng đợi", upload_add_to_queue_tooltip: "Thêm lần tải lên này vào hàng đợi mà không bắt đầu", +upload_add_stream_to_queue_tooltip: "Thêm một Truyền và cài đặt vào hàng đợi mà không bắt đầu. Không có gì được sao chép sang PS5 trước.", upload_apply_exclude_rules: "Áp dụng quy tắc loại trừ", upload_change_source: "Đổi nguồn", upload_choose_diff_source: "Chọn nguồn khác", diff --git a/client/src/i18n/locales/zh-CN.ts b/client/src/i18n/locales/zh-CN.ts index ec977085c..ddf0c8062 100644 --- a/client/src/i18n/locales/zh-CN.ts +++ b/client/src/i18n/locales/zh-CN.ts @@ -462,6 +462,7 @@ queue_title: "队列", "batch_resume_hint": "关闭:已存在的目标都会被替换。", "batch_upload_now": "立即上传 {count} 个", "batch_add": "将 {count} 个加入队列", +"batch_add_stream_hint": "软件包以流式安装的方式加入队列,不会先复制到 PS5。添加后不会启动队列。", "batch_scan": "从文件夹添加游戏…", "cq_not_games": "{count} 个文件夹不是游戏,已跳过。", "cq_skipped_not_image": "已跳过 {count} 个:只有游戏文件夹、游戏镜像、安装包或压缩包(.zip、.7z、.rar)才能制作成游戏镜像。", @@ -1467,6 +1468,7 @@ shortcuts_title: "键盘快捷键", smp_blank_delete: "(留空=删除)", upload_add_to_queue: "加入队列", upload_add_to_queue_tooltip: "将此上传加入队列但不立即开始", +upload_add_stream_to_queue_tooltip: "将流式安装加入队列但不启动队列。不会先复制到 PS5。", upload_apply_exclude_rules: "应用排除规则", upload_change_source: "更换来源", upload_choose_diff_source: "选择其他来源", diff --git a/client/src/i18n/locales/zh-TW.ts b/client/src/i18n/locales/zh-TW.ts index 54694993a..2d0544827 100644 --- a/client/src/i18n/locales/zh-TW.ts +++ b/client/src/i18n/locales/zh-TW.ts @@ -456,6 +456,7 @@ queue_title: "佇列", "batch_resume_hint": "關閉:已存在的目標都會被取代。", "batch_upload_now": "立即上傳 {count} 個", "batch_add": "將 {count} 個加入佇列", +"batch_add_stream_hint": "套件會以串流安裝的方式加入佇列,不會先複製到 PS5。加入後不會啟動佇列。", "batch_scan": "從資料夾加入遊戲…", "cq_not_games": "{count} 個資料夾不是遊戲,已略過。", "cq_skipped_not_image": "已略過 {count} 個:只有遊戲資料夾、遊戲映像檔、安裝包或壓縮檔(.zip、.7z、.rar)才能製作成遊戲映像檔。", @@ -1461,6 +1462,7 @@ shortcuts_title: "鍵盤快速鍵", smp_blank_delete: "(留空=刪除)", upload_add_to_queue: "加入佇列", upload_add_to_queue_tooltip: "將此上傳加入佇列但不立即開始", +upload_add_stream_to_queue_tooltip: "將串流安裝加入佇列但不啟動佇列。不會先複製到 PS5。", upload_apply_exclude_rules: "套用排除規則", upload_change_source: "更換來源", upload_choose_diff_source: "選擇其他來源", diff --git a/client/src/screens/Upload/BatchReview.tsx b/client/src/screens/Upload/BatchReview.tsx index 918301da7..45c4d1885 100644 --- a/client/src/screens/Upload/BatchReview.tsx +++ b/client/src/screens/Upload/BatchReview.tsx @@ -38,6 +38,9 @@ export interface BatchReviewProps { restCount?: number; canStream?: boolean; onStream?: () => void; + /** Add to queue with packages in the list: they join the queue as stream installs, and + * nothing starts (the rest is added as uploads). */ + onQueueStream?: () => void; onRemove: (id: string) => void; onInclude: (id: string, include: boolean) => void; onPassword: (id: string, password: string) => void; @@ -291,9 +294,24 @@ export function BatchReview(p: BatchReviewProps) { - + {streams && p.onQueueStream ? ( + + ) : ( + + )} ); diff --git a/client/src/screens/Upload/index.tsx b/client/src/screens/Upload/index.tsx index 0882cbee7..50f3e5803 100644 --- a/client/src/screens/Upload/index.tsx +++ b/client/src/screens/Upload/index.tsx @@ -130,7 +130,7 @@ import { import { krakenRuns, useMounterFor } from "../../lib/mounter"; import { useSmpState } from "../GameHub/SmpNeeded"; import { STICKY_ACTIONS } from "./stickyActions"; -import { inStreamOrder } from "../../lib/streamSelection"; +import { streamPackages } from "./streamPackages"; import { resolveUploadDest } from "../../lib/uploadDest"; import { QueuePanel } from "./QueuePanel"; import { RunningEngineJobs } from "../../components/RunningEngineJobs"; @@ -933,7 +933,9 @@ export default function UploadScreen({ batchPkgs.length > 0 && included.every((r) => r.status !== "inspecting") && (batchRest.length === 0 || (!batchCheck.blocked && !batchUndecided)); - const streamBatch = async (now: number) => { + // `start`: Stream & install starts the console's queue as any add does; Add to queue only adds + // the rows (packages as stream installs too), and they wait for Start queue. + const streamBatch = async (now: number, start = true) => { if (!canStreamBatch || !host) return; const pkgs = batchPkgs; const rest = batchRest; @@ -948,29 +950,24 @@ export default function UploadScreen({ if (item) ids.push(queueAdd(item)); }); batch.clear(); - if (ids.length) queueStartAdded(hostOf(host), ids); + if (start && ids.length) queueStartAdded(hostOf(host), ids); // Games, then updates, then DLC (as Install Package's picker did before 8.7.0), each in the - // list's order. Each joins the console's queue as it is called, so they queue in that order; - // the promises settle only when each install ends (its outcome stays on its queue row). + // list's order. const lib = pkgLibraryStore(host).getState(); - const planned = inStreamOrder( - pkgs.map((r) => { - const info = r.source?.kind === "pkg" ? r.source.pkgInfo : null; - return { - path: r.path, - category: info?.category ?? undefined, - contentId: info?.contentId || undefined, - size: info?.totalBytes ? info.totalBytes : null, - }; - }), - ); await Promise.all( - planned.map((p) => - lib.installStream(p.path, host, { - category: p.category, - contentId: p.contentId, - sizeBytes: p.size, + streamPackages( + lib.installStream, + host, + pkgs.map((r) => { + const info = r.source?.kind === "pkg" ? r.source.pkgInfo : null; + return { + path: r.path, + category: info?.category ?? undefined, + contentId: info?.contentId || undefined, + size: info?.totalBytes ? info.totalBytes : null, + }; }), + start, ), ); }; @@ -1121,6 +1118,7 @@ export default function UploadScreen({ restCount={batchRest.length} canStream={canStreamBatch} onStream={() => void streamBatch(Date.now())} + onQueueStream={() => void streamBatch(Date.now(), false)} onRemove={(id) => batch.remove(id)} onInclude={(id, v) => batch.setInclude(id, v)} onPassword={(id, pw) => batch.setPassword(id, pw)} @@ -1413,20 +1411,32 @@ function Step2Options(props: { onQueueAllParts, } = props; // A package's main action (#81, #580's report): Stream & install from this computer, nothing - // copied to the PS5 first; queued on the console's queue, and the pick is done. - const streamThis = + // copied to the PS5 first; queued on the console's queue, and the pick is done. Add to queue + // queues the same stream install without starting the queue (`start` false). + const streamPkg = source?.kind === "pkg" && consoleHost - ? () => { - void pkgLibraryStore(consoleHost) - .getState() - .installStream(source.path, consoleHost, { - category: source.pkgInfo?.category ?? undefined, - contentId: source.pkgInfo?.contentId || undefined, - sizeBytes: source.pkgInfo?.totalBytes ?? null, - }); + ? (start: boolean) => { + void Promise.all( + streamPackages( + pkgLibraryStore(consoleHost).getState().installStream, + consoleHost, + [ + { + path: source.path, + category: source.pkgInfo?.category ?? undefined, + contentId: source.pkgInfo?.contentId || undefined, + size: source.pkgInfo?.totalBytes ?? null, + }, + ], + start, + ), + ); onClear(); } : undefined; + const streamThis = streamPkg ? () => streamPkg(true) : undefined; + const addToQueue = () => + streamPkg ? streamPkg(false) : onAddToQueue("overwrite"); // The .pkg source is open in the package viewer. const [viewingPkg, setViewingPkg] = useState(false); const tr = useTr(); @@ -1961,7 +1971,7 @@ function Step2Options(props: { primary: true, onClick: () => { setViewingPkg(false); - onAddToQueue("overwrite"); + addToQueue(); }, }, ]} @@ -2063,7 +2073,7 @@ function Step2Options(props: { don't reconcile), so it's hidden for image/file sources. */} @@ -113,11 +112,17 @@ export function CopyToUserView({ game, source, targets, state, onPick, onConfirm

{source.kind === "save" - ? tr( - "saves_copy_confirm", - { target, game, source: source.owner }, - "Replace {target}'s save of {game} with {source}'s? {target}'s current save is backed up first.", - ) + ? state.target.save + ? tr( + "saves_copy_confirm", + { target, game, source: source.owner }, + "Replace {target}'s save of {game} with {source}'s? {target}'s current save is backed up first.", + ) + : tr( + "saves_copy_new_confirm", + { target, game, source: source.owner }, + "Give {target} {source}'s save of {game}? {target} has no save of this game yet, so nothing is replaced.", + ) : state.target.save ? tr( "save_backup_restore_to_user_confirm", @@ -142,7 +147,9 @@ export function CopyToUserView({ game, source, targets, state, onPick, onConfirm > {state.target.save ? tr("saves_copy_replace", undefined, "Replace save") - : tr("save_backup_restore", undefined, "Restore")} + : restore + ? tr("save_backup_restore", undefined, "Restore") + : tr("copy", undefined, "Copy")}

@@ -224,7 +231,7 @@ export default function CopyToUserDialog({ }) { const tr = useTr(); const [state, setState] = useState({ step: "pick" }); - const go = (e: CopyEvent) => setState((s) => copyStep(s, e, source.kind === "backup")); + const go = (e: CopyEvent) => setState((s) => copyStep(s, e)); const confirm = async () => { if (state.step !== "confirm") return; const target = state.target; diff --git a/client/src/screens/Saves/copyTargets.ts b/client/src/screens/Saves/copyTargets.ts index 1f59040ee..f9822c90f 100644 --- a/client/src/screens/Saves/copyTargets.ts +++ b/client/src/screens/Saves/copyTargets.ts @@ -1,7 +1,8 @@ // Moving a PS5 save to another account on the same console (#612): who it can go to. // -// The engine only replaces the files in a save the console already made, so a user with no save -// of the game is listed but can't be picked: they start the game once and save first. +// A user with a save of the game gets theirs replaced; one with none (or lacking some of its +// slots, as every user of a game that names each save its own way does) gets the save's images +// whole, made theirs by the engine (save_copy.rs `copy_whole`). import type { ProfileUser, SaveEntry } from "../../api/ps5"; import { userHex, userName } from "./saveUsers"; @@ -10,7 +11,7 @@ export interface CopyTarget { uid: number; /** Their name, or null when the console didn't name them. */ name: string | null; - /** Their PS5 save of the game, or null: start the game once as them and save. */ + /** Their PS5 save of the game, or null: the copy becomes their save. */ save: SaveEntry | null; } diff --git a/client/src/screens/Saves/index.tsx b/client/src/screens/Saves/index.tsx index b6bf37074..9c6eddd28 100644 --- a/client/src/screens/Saves/index.tsx +++ b/client/src/screens/Saves/index.tsx @@ -37,6 +37,7 @@ import { import { useRosterStore } from "../../state/roster"; import { CopyToConsoleDialog, isEmulatorSave } from "./CopyToConsoleDialog"; import CopyToUserDialog from "./CopyToUserDialog"; +import { partMissingText } from "./partMissing"; import { canCopyToOtherUser, copyTargets, localUserCount } from "./copyTargets"; import { saveImagesOf } from "./saveImages"; import { saveFile } from "../../lib/rpCapture"; @@ -236,15 +237,9 @@ export default function SavesScreen() { const whoseName = (e: SaveEntry) => ownerName(e) ?? tr("saves_user_other", { id: userHex(e.user_id) }, "Other user ({id})"); /** The engine's refusal in plain words: the parts the target's save is missing. */ - const missingText = (e: unknown, game: string, user: string) => { + const missingText = (e: unknown, game: string, user: string, from: "file" | "copy") => { if (!(e instanceof SaveCopyError) || e.missing.length === 0) return errorText(e); - const main = tr("saves_part_main", undefined, "main save"); - const part = e.missing.map((m) => partLabel(m, main)).join(", "); - return tr( - "saves_part_missing", - { game, part, user }, - "{user} doesn't have {game}'s {part} yet, and a save can only replace a save slot {user} already has. Start the game as {user}, save in the same slot, then try again.", - ); + return partMissingText(tr, e.missing, game, user, from); }; // A file for a friend or another PS5: every part of this save in one .zip. const doShare = async (entry: SaveEntry) => { @@ -356,7 +351,7 @@ export default function SavesScreen() { void refresh(); } catch (e) { // The file's name too: a backup beside the shared file is easy to pick instead (#633). - pushNotification("error", tr("saves_use_shared_failed_v2", { error: `${file.name}: ${missingText(e, game, user)}` }, "Could not load the save file: {error}")); + pushNotification("error", tr("saves_use_shared_failed_v2", { error: `${file.name}: ${missingText(e, game, user, "file")}` }, "Could not load the save file: {error}")); } finally { setOpenBusy(false); markBusy(target.path, false); @@ -1356,7 +1351,7 @@ export default function SavesScreen() { const game = await gameNameOf(copyFrom.title_id); // The same error, said plainly (the parts the target is missing). if (e instanceof Error) { - e.message = missingText(e, game, t.name ?? tr("saves_user_other", { id: userHex(t.uid) }, "Other user ({id})")); + e.message = missingText(e, game, t.name ?? tr("saves_user_other", { id: userHex(t.uid) }, "Other user ({id})"), "copy"); } throw e; } diff --git a/client/src/screens/Saves/partMissing.test.ts b/client/src/screens/Saves/partMissing.test.ts new file mode 100644 index 000000000..5656aae44 --- /dev/null +++ b/client/src/screens/Saves/partMissing.test.ts @@ -0,0 +1,29 @@ +import { describe, expect, it } from "vitest"; +import type { Translator } from "../../state/lang"; +import { partMissingText } from "./partMissing"; + +// English through the fallback, as the app shows it before a locale loads. +const tr = ((key: string, vars?: Record | string, fallback?: string) => { + const text = typeof vars === "string" ? vars : (fallback ?? key); + const v = typeof vars === "object" ? vars : {}; + return text.replace(/\{(\w+)\}/g, (_, k: string) => String(v[k] ?? `{${k}}`)); +}) as Translator; + +const witcher = ["sdimg_Auto.8559a.7ea54c00.4dd04c1", "sdimg_Manual.53db9.7ea54c00.4f3261a"]; + +describe("a save that needs slots the other user doesn't have", () => { + it("a copy only stops for an old helper, and says to send the new one (not to save in the same slot)", () => { + const text = partMissingText(tr, witcher, "The Witcher 3", "Playsteed5", "copy"); + expect(text).toContain("Auto.8559a.7ea54c00.4dd04c1, Manual.53db9.7ea54c00.4f3261a"); + expect(text).toContain("too old to add save slots for Playsteed5"); + expect(text).toContain("Send the helper"); + expect(text).not.toContain("same slot"); + }); + + it("a save file points a game with its own save names at a copy on the PS5 the save is on", () => { + const text = partMissingText(tr, ["sdimg_sce_sdmemory"], "Astro Bot", "Ben", "file"); + expect(text).toContain("Ben doesn't have Astro Bot's main save yet"); + expect(text).toContain("save in the same slot"); + expect(text).toContain("use Copy to another user or Copy to another console"); + }); +}); diff --git a/client/src/screens/Saves/partMissing.ts b/client/src/screens/Saves/partMissing.ts new file mode 100644 index 000000000..d41df18da --- /dev/null +++ b/client/src/screens/Saves/partMissing.ts @@ -0,0 +1,35 @@ +// The engine's refusal of a save that needs slots the target doesn't have (save_copy.rs), said +// plainly. Some games give every save a name of its own (The Witcher 3: +// `Manual.53db9.7ea54c00.4f3261a`), so another user never makes a slot of the same name and +// "save in the same slot" can't help them. +// +// - "file": a save file (decrypted files) only goes into a slot the user has. The way round it is +// a copy on the PS5 the save is on, which adds the slots. +// - "copy": a copy or a backup adds the missing slots whole and makes them theirs; it is refused +// only when the helper on the PS5 is too old to change a save's owner. +import type { Translator } from "../../state/lang"; +import { partLabel } from "../../api/saveShare"; + +export type MissingFrom = "file" | "copy"; + +export function partMissingText( + tr: Translator, + missing: readonly string[], + game: string, + user: string, + from: MissingFrom, +): string { + const main = tr("saves_part_main", undefined, "main save"); + const part = missing.map((m) => partLabel(m, main)).join(", "); + return from === "file" + ? tr( + "saves_part_missing_file", + { game, part, user }, + "{user} doesn't have {game}'s {part} yet, and a save file can only go into a save slot {user} already has. Start the game as {user}, save in the same slot, then try again. If the game gives every save a name of its own (The Witcher 3 does), use Copy to another user or Copy to another console on the PS5 the save is on instead.", + ) + : tr( + "saves_part_missing_helper", + { game, part, user }, + "{user} doesn't have {game}'s {part} yet, and the helper running on the PS5 is too old to add save slots for {user}. Send the helper from this version of the app (Connection), then try again.", + ); +} diff --git a/engine/crates/ps5upload-engine/src/save_copy.rs b/engine/crates/ps5upload-engine/src/save_copy.rs index 5b08a9c1d..3d81663ed 100644 --- a/engine/crates/ps5upload-engine/src/save_copy.rs +++ b/engine/crates/ps5upload-engine/src/save_copy.rs @@ -16,10 +16,15 @@ //! A game's save is often several images in its folder (`sdimg_STARBOARD`, `sdimg_sce_sdmemory`, //! …), and the console keeps its own backup copy of each (`sdimg_sce_bu_`). They go //! together: every image of the game (never the console's backup copies) is in the one file, as a -//! folder of its own, and each goes into the target's image of the same name. A target missing -//! one of those images is refused before anything changes, naming what is missing: a game makes -//! the same images for every account once it has saved, so this asks for one more start of the -//! game at most, while putting in only some parts could leave a save the game can't read. +//! folder of its own, and each goes into the target's image of the same name. Not every game +//! makes the same images for every account: The Witcher 3 names each save of its own +//! (`Manual.53db9.7ea54c00.4f3261a`), so another user never has one of the same name. A copy to +//! a target missing any of them (or with no save of the game) sends the save as Restore to +//! another user sends a backup: the source's encrypted images, backed up, go into the target's +//! folder whole and are made theirs (`copy_whole`). A save file holds decrypted files only, +//! which go into an image the target has: one missing is refused before anything changes, as +//! is everything when the helper can't change a save's owner. Putting in only some parts could +//! leave a save the game can't read. //! //! - **Share** (`POST /api/save-backup/share`): the file. //! - **Use a shared save** (`POST /api/save-backup/use-shared`): a file into a user's save. @@ -717,11 +722,22 @@ pub fn match_parts( } } +/// Why the parts a user lacks could not be added for them. +#[derive(Debug, Clone, Copy, PartialEq)] +enum Slots { + /// A shared save file: decrypted files, which only go into an image the user has. + File, + /// A copy or a backup: the images could be added whole and made theirs, but the helper on + /// the PS5 is too old to change a save's owner. + Helper, +} + /// The error for parts a user's save doesn't have yet. -fn missing_error(title_id: &str, who: &str, missing: Vec) -> Failed { +fn missing_error(title_id: &str, who: &str, missing: Vec, why: Slots) -> Failed { let labels: Vec = missing.iter().map(|m| part_label(m)).collect(); - // A game makes each save slot the first time it saves there (RDR2 has several, #729), and - // the console only knows the slots a user has: one can't be added from here. + // A game makes each save slot the first time it saves there (RDR2 has several, #729). Some + // give every save a name of its own (The Witcher 3: `Manual.53db9.7ea54c00.4f3261a`), so + // another user never gets a slot of the same name: saving again as them can't help there. let (what, how) = match labels.as_slice() { [one] if one == "main save" => ("main save".to_string(), "once"), [one] => (format!("save slot {one}"), "in that slot"), @@ -735,12 +751,15 @@ fn missing_error(title_id: &str, who: &str, missing: Vec) -> Failed { .next() .map(|c| c.to_uppercase().chain(cap).collect()) .unwrap_or_default(); - Failed { - msg: format!( - "{who_cap} doesn't have {title_id}'s {what} yet, and a save can only replace one {who} already has. Start the game as {who} and save {how}, then try again." + let msg = match why { + Slots::File => format!( + "{who_cap} doesn't have {title_id}'s {what} yet, and a save file can only go into save slots {who} already has. Start the game as {who} and save {how}, then try again. If the game gives every save a name of its own, use Copy to another user or Copy to another console on the PS5 the save is on instead." ), - missing, - } + Slots::Helper => format!( + "{who_cap} doesn't have {title_id}'s {what} yet, and the helper running on the PS5 is too old to add a save slot for {who}. Send the helper from this version of the app (Connection), then try again." + ), + }; + Failed { msg, missing } } /// Put a shared save (`zip_bytes`) into the save folder `folder` of `user_id`: each image into @@ -819,8 +838,8 @@ fn import_as( Err(e) if e == NO_MANIFEST => unlabelled_parts(&zip, &base.join(&title_id), &images)?, Err(e) => return Err(e.into()), }; - let pairs = - match_parts(&parts, &images, compat).map_err(|m| missing_error(&title_id, who, m))?; + let pairs = match_parts(&parts, &images, compat) + .map_err(|m| missing_error(&title_id, who, m, Slots::File))?; checks(c, &title_id)?; // A part too big for its image is refused before anything changes. for (image, src) in &pairs { @@ -915,6 +934,82 @@ fn target_save<'a>( }) } +/// `target_save`, None when the user has no save of the game at all. +fn target_or_none<'a>( + saves: &'a [SaveEntry], + title_id: &str, + user: u32, +) -> Result, String> { + match target_save(saves, title_id, user) { + Ok(to) => Ok(Some(to)), + Err(e) if e == no_target_save(title_id) => Ok(None), + Err(e) => Err(e), + } +} + +/// The tag of the backup of the save a copy sends whole (`copy_whole`). +pub const COPY_SOURCE_TAG: &str = "copysource"; + +/// Whether a copy of `from` (on `src`) into `to` (on `dst`; None: no save of the game there) has +/// to add save slots: Some(the images the target lacks) when it does. A save's files only go +/// into an image the target has, so those are added whole and made theirs (`copy_whole`). Err, +/// changing nothing, when the helper there can't do that. +fn adds_slots( + src: &dyn Console, + dst: &dyn Console, + title_id: &str, + from: &SaveEntry, + to: Option<&SaveEntry>, +) -> Result>, Failed> { + let images = src.images(&from.path)?; + let missing = match to { + Some(to) => lacking(&images, &dst.images(&to.path)?), + None => images, + }; + if missing.is_empty() { + return Ok(None); + } + if !dst.can_make_owner() { + return Err(match to { + Some(_) => missing_error(title_id, "the other user", missing, Slots::Helper), + None => no_target_save(title_id).into(), + }); + } + Ok(Some(missing)) +} + +/// Copies `from` (on `src`) into `to_user`'s saves on `dst` as whole images made theirs, for a +/// target lacking some of its slots (a game that names every save its own way, like The Witcher +/// 3, never makes the same slot for another user). The source is backed up (tagged +/// `copysource`), and that backup goes in as Restore to another user puts one in: the target's +/// slots of other names stay, theirs of the same name are replaced, and their save folder is +/// backed up first and put back if a step fails. +fn copy_whole( + src: &dyn Console, + dst: &dyn Console, + title_id: &str, + from: &SaveEntry, + to_user: u32, + added: Vec, +) -> Result { + crate::log_info!( + "save copy: {title_id} goes to user {to_user:08x} as whole images, adding {}", + added.join(", ") + ); + let zip = src + .back_up(from, COPY_SOURCE_TAG) + .map_err(|e| format!("could not take a copy of the save to send: {e}"))?; + let file = zip + .file_name() + .map(|f| f.to_string_lossy().into_owned()) + .unwrap_or_default(); + let d = put_backup(dst, title_id, &file, &zip, to_user)?; + Ok(Done { + from: from.path.clone(), + ..d + }) +} + /// Parts in `from` that `to` lacks (names), each image matched by name. fn lacking(from: &[String], to: &[String]) -> Vec { from.iter().filter(|f| !to.contains(f)).cloned().collect() @@ -952,12 +1047,14 @@ pub fn copy_to_user(c: &dyn Console, b: &CopyBody) -> Result { c.can_back_up()?; let saves = c.saves()?; let from = ps5_save_of(&saves, &title_id, b.from_user, "This user")?; - let to = target_save(&saves, &title_id, b.to_user)?; + let to = target_or_none(&saves, &title_id, b.to_user)?; checks(c, &title_id)?; - let missing = lacking(&c.images(&from.path)?, &c.images(&to.path)?); - if !missing.is_empty() { - return Err(missing_error(&title_id, "the other user", missing)); + if let Some(added) = adds_slots(c, c, &title_id, from, to)? { + return copy_whole(c, c, &title_id, from, b.to_user, added); } + let Some(to) = to else { + return Err(no_target_save(&title_id).into()); + }; let (_, zip) = share(c, &from.path)?; let parts = import_as( c, @@ -996,6 +1093,20 @@ pub fn restore_to_user( if from_user == to_user { return Err("This backup is already this user's: use Restore.".into()); } + put_backup(c, &title_id, file, zip, to_user) +} + +/// `restore_to_user` once the backup is known to be another user's (`title_id` checked +/// already); `file` names the backup in what is done. +fn put_backup( + c: &dyn Console, + title_id: &str, + file: &str, + zip: &Path, + to_user: u32, +) -> Result { + let _op = hold(&[c]); + let title_id = title_id.to_string(); // A backup made on another PS5 opens here too (a save image is not tied to the console that // made it: measured on FW 13.60, #809), so where it was made is not asked. let saves = c.saves()?; @@ -1035,7 +1146,7 @@ pub fn restore_to_user( }; if !missing.is_empty() && !c.can_make_owner() { return Err(match &to { - Some(_) => missing_error(&title_id, "the other user", missing), + Some(_) => missing_error(&title_id, "the other user", missing, Slots::Helper), None => no_target_save(&title_id).into(), }); } @@ -1052,7 +1163,9 @@ pub fn restore_to_user( &missing, ) .map_err(|e| match (&to, e.msg == OWNER_UNSUPPORTED) { - (Some(_), true) => missing_error(&title_id, "the other user", missing), + (Some(_), true) => { + missing_error(&title_id, "the other user", missing, Slots::Helper) + } (None, true) => no_target_save(&title_id).into(), _ => e, }); @@ -1737,13 +1850,15 @@ pub fn copy_to_console( let source = from.saves()?; let there = to.saves()?; let src = ps5_save_of(&source, &title_id, from_user, "This user")?; - let dst = target_save(&there, &title_id, to_user)?; + let dst = target_or_none(&there, &title_id, to_user)?; checks(from, &title_id)?; checks(to, &title_id)?; - let missing = lacking(&from.images(&src.path)?, &to.images(&dst.path)?); - if !missing.is_empty() { - return Err(missing_error(&title_id, "the other user", missing)); + if let Some(added) = adds_slots(from, to, &title_id, src, dst)? { + return copy_whole(from, to, &title_id, src, to_user, added); } + let Some(dst) = dst else { + return Err(no_target_save(&title_id).into()); + }; let (_, zip) = share(from, &src.path)?; let parts = import_as( to, @@ -2108,6 +2223,8 @@ mod tests { calls: RefCell>, /// Image → the game file put in it. replaced: RefCell>>, + /// What a backup of the save a copy sends whole (`copysource`) gives: a real zip. + source_zip: Option, } impl Fake { @@ -2135,6 +2252,7 @@ mod tests { sys: 0, calls: RefCell::default(), replaced: RefCell::default(), + source_zip: None, } } fn both(images: &[&str]) -> Self { @@ -2183,6 +2301,11 @@ mod tests { } fn back_up(&self, entry: &SaveEntry, tag: &str) -> Result { self.log(format!("back_up {} {tag}", entry.path)); + if tag == COPY_SOURCE_TAG { + if let Some(zip) = &self.source_zip { + return Ok(zip.clone()); + } + } Ok(PathBuf::from(format!( "/backups/{T}_user{:08x}_x_{tag}.zip", entry.user_id as u32 @@ -2420,7 +2543,9 @@ mod tests { assert_eq!(r[STAR], format!("{}/{STAR}", folder(A)).into_bytes()); } - /// A part the target lacks refuses the copy before anything is read or written. + /// With a helper that can't change a save's owner, a part the target lacks refuses the copy + /// before anything is read or written, and says what would let it go ahead (not "save in + /// the same slot": a game that names every save its own way never makes that slot). #[test] fn copy_refuses_a_missing_part_before_changing_anything() { let c = Fake::two_users(&[MAIN, STAR], &[MAIN]); @@ -2429,7 +2554,8 @@ mod tests { assert!( e.msg .starts_with("The other user doesn't have PPSA01650's save slot STARBOARD yet") - && e.msg.contains("save in that slot"), + && e.msg.contains("too old to add a save slot") + && !e.msg.contains("save in that slot"), "{}", e.msg ); @@ -3100,4 +3226,172 @@ mod tests { .unwrap_err(); assert!(e.msg.contains("Start the game once"), "{}", e.msg); } + + // The Witcher 3 names every save of its own: another user never has a slot of the same name. + const W_AUTO: &str = "sdimg_Auto.8559a.7ea54c00.4dd04c1"; + const W_MANUAL: &str = "sdimg_Manual.53db9.7ea54c00.4f3261a"; + const W_THEIRS: &str = "sdimg_Manual.11aa2.7ea54c00.5000001"; + + /// A copy into a user whose save has none of the source's slot names (The Witcher 3): the + /// source is backed up, and its images go into the target's folder whole and are made + /// theirs, the target's own save backed up first. Their slot of another name stays. + #[test] + fn a_copy_adds_the_slots_the_other_user_lacks_as_theirs() { + let tmp = make_temp_dir("copywhole").unwrap(); + let c = Fake { + owner: true, + source_zip: Some(backup_zip(&tmp, &[W_AUTO, W_MANUAL])), + ..Fake::two_users(&[W_AUTO, W_MANUAL], &[W_THEIRS]) + }; + let d = copy_to_user(&c, &body(A, B)).unwrap(); + assert_eq!(d.from, folder(A)); + assert_eq!(d.to, folder(B)); + assert_eq!(d.parts, vec![W_AUTO.to_string(), W_MANUAL.to_string()]); + assert_eq!( + c.calls(), + vec![ + format!("back_up {} copysource", folder(A)), + format!("back_up {} beforecopy", folder(B)), + format!("put_added {}", folder(B)), + format!("owner {}/{W_AUTO}", folder(B)), + format!("owner {}/{W_MANUAL}", folder(B)), + ] + ); + // Nothing was opened or filled: whole images, never the target's own slot. + assert!(c.replaced.borrow().is_empty()); + assert!(!c.calls().iter().any(|x| x.contains(W_THEIRS))); + let _ = cleanup_temp_dir(&tmp.to_string_lossy()); + } + + /// Some slots in common and some not: the whole save goes across (a game's slots go + /// together), the same names replaced, the rest added. + #[test] + fn a_copy_with_some_slots_in_common_sends_the_whole_save() { + let tmp = make_temp_dir("copywhole").unwrap(); + let c = Fake { + owner: true, + source_zip: Some(backup_zip(&tmp, &[MAIN, STAR])), + ..Fake::two_users(&[MAIN, STAR], &[MAIN]) + }; + let d = copy_to_user(&c, &body(A, B)).unwrap(); + assert_eq!(d.parts, vec![STAR.to_string(), MAIN.to_string()]); + let calls = c.calls(); + assert_eq!(calls.iter().filter(|x| x.starts_with("owner ")).count(), 2); + assert!(calls.contains(&format!("back_up {} beforecopy", folder(B)))); + let _ = cleanup_temp_dir(&tmp.to_string_lossy()); + } + + /// A user with no save of the game gets the copy as theirs too; nothing of theirs to back up. + #[test] + fn a_copy_to_a_user_with_no_save_of_the_game_makes_it_theirs() { + let tmp = make_temp_dir("copywhole").unwrap(); + let c = Fake { + saves: vec![entry(A, "ps5")], + owner: true, + source_zip: Some(backup_zip(&tmp, &[W_AUTO])), + ..Fake::two_users(&[W_AUTO], &[]) + }; + let d = copy_to_user(&c, &body(A, B)).unwrap(); + assert_eq!(d.to, folder(B)); + assert_eq!( + c.calls(), + vec![ + format!("back_up {} copysource", folder(A)), + format!("put_added {}", folder(B)), + format!("owner {}/{W_AUTO}", folder(B)), + ] + ); + // With no save database for them yet, refused before anything is put there. + let c = Fake { + saves: vec![entry(A, "ps5")], + owner: true, + no_database: true, + source_zip: Some(backup_zip(&tmp, &[W_AUTO])), + ..Fake::two_users(&[W_AUTO], &[]) + }; + let e = copy_to_user(&c, &body(A, B)).unwrap_err().msg; + assert!(e.contains("no saved data on this PS5 yet"), "{e}"); + assert!(!c.calls().iter().any(|x| x.starts_with("put_"))); + let _ = cleanup_temp_dir(&tmp.to_string_lossy()); + } + + /// A failed change of owner during such a copy puts the target's save back. + #[test] + fn a_failed_whole_copy_puts_the_targets_save_back() { + let tmp = make_temp_dir("copywhole").unwrap(); + let c = Fake { + owner: true, + fail_owner: Some(W_MANUAL.into()), + source_zip: Some(backup_zip(&tmp, &[W_AUTO, W_MANUAL])), + ..Fake::two_users(&[W_AUTO, W_MANUAL], &[W_THEIRS]) + }; + let e = copy_to_user(&c, &body(A, B)).unwrap_err().msg; + assert!(e.ends_with("The save there before was put back."), "{e}"); + assert!(c.calls().last().unwrap().starts_with("put_back")); + let _ = cleanup_temp_dir(&tmp.to_string_lossy()); + } + + /// The same names copy the old way: files into the target's images, no whole images. + #[test] + fn a_copy_with_every_slot_there_never_adds_images() { + let c = Fake { + owner: true, + ..Fake::both(&[W_AUTO, W_MANUAL]) + }; + copy_to_user(&c, &body(A, B)).unwrap(); + let calls = c.calls(); + assert!(!calls + .iter() + .any(|x| x.contains("copysource") || x.starts_with("owner "))); + assert_eq!(c.replaced.borrow().len(), 2); + } + + /// Another console: the source backed up there, its images added and made theirs here. + #[test] + fn a_copy_to_another_console_adds_the_slots_the_user_there_lacks() { + let tmp = make_temp_dir("copywhole").unwrap(); + let from = Fake { + source_zip: Some(backup_zip(&tmp, &[W_AUTO])), + ..Fake::two_users(&[W_AUTO], &[]) + }; + let to = Fake { + owner: true, + ..Fake::two_users(&[], &[W_THEIRS]) + }; + let d = copy_to_console(&from, &to, T, A, B).unwrap(); + assert_eq!(d.from, folder(A)); + assert_eq!( + from.calls(), + vec![format!("back_up {} copysource", folder(A))] + ); + assert_eq!( + to.calls(), + vec![ + format!("back_up {} beforecopy", folder(B)), + format!("put_added {}", folder(B)), + format!("owner {}/{W_AUTO}", folder(B)), + ] + ); + let _ = cleanup_temp_dir(&tmp.to_string_lossy()); + } + + /// A save file holds decrypted files, which only go into a slot the user has: the refusal + /// says so, and what to use for a game that names every save its own way. + #[test] + fn a_save_file_missing_a_slot_says_what_to_use_instead() { + let zip = shared_zip(&[W_MANUAL]); + let c = Fake { + owner: true, + ..Fake::two_users(&[W_MANUAL], &[W_THEIRS]) + }; + let e = import(&c, &folder(B), B, &zip, None, None).unwrap_err(); + assert_eq!(e.missing, vec![W_MANUAL.to_string()]); + assert!( + e.msg.contains("a save file can only go into save slots") + && e.msg.contains("use Copy to another user"), + "{}", + e.msg + ); + assert!(!c.wrote()); + } } diff --git a/scripts/i18n-source-hashes.json b/scripts/i18n-source-hashes.json index a7c820f23..51b514931 100644 --- a/scripts/i18n-source-hashes.json +++ b/scripts/i18n-source-hashes.json @@ -7626,7 +7626,8 @@ "saves_copy_done": "866a7d7b nQWwqLvOZWfiOtadLKqOzlfuvYtG1kxemH3t7tJtkKyRYGreqhtBvCnrMD56", "saves_copy_failed": "fa081330 acKvcAjGja9z1UlGgQTwF6oOgWbJUhvyhzj6_4gDTSBcqA-bWrGK5YkzrM-j", "saves_copy_has_save": "665a8081 8uu2IeN_qgCr8U-MmpfoycUR6iBlYtZKQAeVs9T96fvYEqxxJAGo6xcAC6UC", - "saves_copy_no_save": "a7c7a7ce sqbEq_JEg3PZwq1uwcToVazhf8e61-VtfZLcUjctyOtzf4DuOAxmC89ux1Ja", + "saves_copy_new_confirm": "e1bdca28 BZYZtkFXjU8W28tAHrlXF-3jgN8jCshfOrHSvWQlLZM2C1jN5v8zngVZ7-PJ", + "saves_copy_new_hint": "052c08f7 8KQWcphKwZ10jfeI_5Yi6pfTT1D5hLAI1zTP6oxuObaJSWhlj1Cw03gL3Av3", "saves_copy_pick": "ce6808ac XxHa7dAHiwgkaxjq_fW5XeKS5tpBCi1Z7urp4k4fKGEOEcuEhhXflVgkDp0P", "saves_copy_replace": "29231849 5Q0QQjBVx4gotgMilfKksN1njqtwZWyEKMUqaQv32f_TLKUHTO5zdpYeJqGj", "saves_copy_same_place": "23c1296a aGQHo6UV8jRN7oxXNW6B0QliIa8QrxqvGYLGEDAW0kdRDg-3kdw7oREK4I26", @@ -7715,7 +7716,8 @@ "saves_opened": "ba0fc773 v_QmjTeMgBziopT8AlswUl2g--CA-hvpQT7q4FVl0zWlwOyoiQEteGn_Uy0u", "saves_opened_body": "0011f0a8 xn294w1u_UGaPFqsABV5k3pQO9x_7MR_qVh4TGp2H36Te8WLMUzwarAaTvo-", "saves_part_main": "ff24f488 f-QSFSfHW_yf39oT4betMrBk3IjA4LqY_FY9LL4H9px00nbRUE3QIqD4VEBg", - "saves_part_missing": "113fd83c TKxKEtU2DW52OR3KVlj8EfDe2mlqpbdHHWW2jOlgxNNtMdSjQtDeEbmsJOBT", + "saves_part_missing_file": "1cdb4027 vaoFI0XvMspLqYEqgDoTk9sNbQ03ZsErm8aRwmERA5ozGxf71PbLQk6hjpYb", + "saves_part_missing_helper": "26471df4 exVm2h6Y1zk7_G3Z50OarmOasfU9ou9NTPF13GP2ap03NbBDxYMVnuwfSjlU", "saves_ps1_title": "7de93058 EwxSGVwxjfYAtdVG_s2WwdgBwQcCbad5a1_TwQcfYApKiV5dfJa9_rn4dqU3", "saves_ps2_backup_hint": "86a70440 TSON534t_VvuC7SGwLy-1bX9gA0ZGjTi3q0Kcm-AUGKKViJqbTHfH3Sr2axR", "saves_ps2_cards": "360a0e2d 9_DOTPZBzYh3kLPnXaqNNQqmBPoRDNNURBW77vnRYHVc1nwo93YOHnFa5o1H", From 7b4963850ef4959a7755337defe77f35953b3b2c Mon Sep 17 00:00:00 2001 From: phantomptr Date: Sun, 22 Nov 2026 14:50:41 -0800 Subject: [PATCH 5/7] Catch up to 12.6.22 Co-Authored-By: Claude Opus 5.5 Claude-Session: https://claude.ai/code/session_01GtiJiJdHq1hekoZ6vizvVT --- CHANGELOG.md | 8 +++++-- VERSION | 2 +- client/package-lock.json | 4 ++-- client/package.json | 2 +- client/src-tauri/Cargo.lock | 30 ++++++++++++------------ client/src-tauri/Cargo.toml | 2 +- client/src-tauri/tauri.conf.json | 2 +- engine/Cargo.lock | 40 ++++++++++++++++---------------- engine/Cargo.toml | 2 +- payload/include/config.h | 2 +- 10 files changed, 49 insertions(+), 45 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index f05f7821d..79e4351a0 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -7,8 +7,6 @@ What's new in ps5upload, written for humans. ## Unreleased **Uploads** -- **The check on the PS5 after an upload shows its progress (#873).** Before a big file counts as done, the PS5 reads it back from its drive to check it. When the drive can't keep up while the file is still arriving, part of that check is left for after the last byte, which on a 70–160 GB game can take several minutes, and the row said the PS5 had reported no progress. It now shows "Checking on the PS5: X of Y" with the time left, and the no-progress warning stays off while the check moves. -- **A stopped upload that you resume isn't checked twice (#873).** The part the PS5 had already checked before the Stop isn't read again, as long as the helper wasn't restarted in between and the file hasn't changed since. Tried on a PS5: a 20 GB upload stopped at 10 GB and resumed checked only the new 10 GB. - **Add to queue streams packages too.** On Upload & Install, Add to queue used to copy a .pkg or .fpkg to the PS5 before installing it. It now adds it as a Stream & install, the same as the main button, but waits for Start queue. To copy a package first, use Upload & install. **Windows** @@ -24,6 +22,12 @@ What's new in ps5upload, written for humans. **Saves** - **Copy to another user works for games that name every save differently, like The Witcher 3.** These games never make a save slot with the same name for another user, so the copy used to stop and ask you to "save in the same slot", which could never work. The save's slots are now added to the other user and made theirs; their other saves of the game stay, and their save is backed up first. The same goes for Copy to another console, and for a user with no save of the game yet. +## 12.6.22 + +**Uploads** +- **The check on the PS5 after an upload shows its progress (#873).** Before a big file counts as done, the PS5 reads it back from its drive to check it. When the drive can't keep up while the file is still arriving, part of that check is left for after the last byte, which on a 70–160 GB game can take several minutes, and the row said the PS5 had reported no progress. It now shows "Checking on the PS5: X of Y" with the time left, and the no-progress warning stays off while the check moves. +- **A stopped upload that you resume isn't checked twice (#873).** The part the PS5 had already checked before the Stop isn't read again, as long as the helper wasn't restarted in between and the file hasn't changed since. Tried on a PS5: a 20 GB upload stopped at 10 GB and resumed checked only the new 10 GB. + **Other** - **Clear all in the notification bell (#911).** Thanks @Dang3rZone. - **Security:** updated the `url` library for a newly published advisory (RUSTSEC-2026-0592). diff --git a/VERSION b/VERSION index 8d98e4dc8..71743a16b 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -12.6.21 +12.6.22 diff --git a/client/package-lock.json b/client/package-lock.json index f9ae34ca9..9db3d80d6 100644 --- a/client/package-lock.json +++ b/client/package-lock.json @@ -1,12 +1,12 @@ { "name": "ps5upload-client", - "version": "12.6.21", + "version": "12.6.22", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "ps5upload-client", - "version": "12.6.21", + "version": "12.6.22", "dependencies": { "@tauri-apps/api": "^2.12.5", "@tauri-apps/plugin-dialog": "^2.8.4", diff --git a/client/package.json b/client/package.json index a3a333793..3f6da9ab9 100644 --- a/client/package.json +++ b/client/package.json @@ -2,7 +2,7 @@ "name": "ps5upload-client", "private": true, "type": "module", - "version": "12.6.21", + "version": "12.6.22", "description": "The all-in-one PS5 companion app.", "homepage": "https://github.com/phantomptr/ps5upload", "author": "PhantomPtr ", diff --git a/client/src-tauri/Cargo.lock b/client/src-tauri/Cargo.lock index 85d6d1dd2..d11130cc2 100644 --- a/client/src-tauri/Cargo.lock +++ b/client/src-tauri/Cargo.lock @@ -4752,7 +4752,7 @@ dependencies = [ [[package]] name = "ps5-dump-forge-exfat" -version = "12.6.21" +version = "12.6.22" dependencies = [ "ps5-dump-forge-patch", "ps5upload-fpkg", @@ -4761,14 +4761,14 @@ dependencies = [ [[package]] name = "ps5-dump-forge-patch" -version = "12.6.21" +version = "12.6.22" dependencies = [ "crc32fast", ] [[package]] name = "ps5-dump-forge-pfs" -version = "12.6.21" +version = "12.6.22" dependencies = [ "flate2", "ps5-dump-forge-patch", @@ -4777,7 +4777,7 @@ dependencies = [ [[package]] name = "ps5-dump-forge-ufs2" -version = "12.6.21" +version = "12.6.22" dependencies = [ "ps5-dump-forge-patch", "ps5upload-fpkg", @@ -4786,7 +4786,7 @@ dependencies = [ [[package]] name = "ps5-dump-forge-zstd" -version = "12.6.21" +version = "12.6.22" dependencies = [ "crc32fast", "getrandom 0.4.3", @@ -4797,7 +4797,7 @@ dependencies = [ [[package]] name = "ps5upload-archive" -version = "12.6.21" +version = "12.6.22" dependencies = [ "anyhow", "crc32fast", @@ -4807,7 +4807,7 @@ dependencies = [ [[package]] name = "ps5upload-ava1" -version = "12.6.21" +version = "12.6.22" dependencies = [ "anyhow", "ava1", @@ -4826,7 +4826,7 @@ dependencies = [ [[package]] name = "ps5upload-convert-core" -version = "12.6.21" +version = "12.6.22" dependencies = [ "blake3", "libc", @@ -4843,7 +4843,7 @@ dependencies = [ [[package]] name = "ps5upload-core" -version = "12.6.21" +version = "12.6.22" dependencies = [ "aes 0.9.2", "aes-gcm 0.11.0", @@ -4877,7 +4877,7 @@ dependencies = [ [[package]] name = "ps5upload-desktop" -version = "12.6.21" +version = "12.6.22" dependencies = [ "anyhow", "ava1", @@ -4918,7 +4918,7 @@ dependencies = [ [[package]] name = "ps5upload-engine" -version = "12.6.21" +version = "12.6.22" dependencies = [ "aes 0.9.2", "aes-gcm 0.11.0", @@ -4982,7 +4982,7 @@ dependencies = [ [[package]] name = "ps5upload-fpkg" -version = "12.6.21" +version = "12.6.22" dependencies = [ "aes 0.9.2", "crc32fast", @@ -5005,7 +5005,7 @@ dependencies = [ [[package]] name = "ps5upload-hub" -version = "12.6.21" +version = "12.6.22" dependencies = [ "axum", "base64 0.23.1", @@ -5019,7 +5019,7 @@ dependencies = [ [[package]] name = "ps5upload-pkg" -version = "12.6.21" +version = "12.6.22" dependencies = [ "aes 0.9.2", "blake3", @@ -5031,7 +5031,7 @@ dependencies = [ [[package]] name = "ps5upload-tailnet" -version = "12.6.21" +version = "12.6.22" dependencies = [ "cc", ] diff --git a/client/src-tauri/Cargo.toml b/client/src-tauri/Cargo.toml index ee703b23b..564963b51 100644 --- a/client/src-tauri/Cargo.toml +++ b/client/src-tauri/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "ps5upload-desktop" -version = "12.6.21" +version = "12.6.22" description = "The all-in-one PS5 companion app." license = "GPL-3.0-or-later" edition = "2021" diff --git a/client/src-tauri/tauri.conf.json b/client/src-tauri/tauri.conf.json index 450d1e323..fc47060a8 100644 --- a/client/src-tauri/tauri.conf.json +++ b/client/src-tauri/tauri.conf.json @@ -1,7 +1,7 @@ { "$schema": "https://schema.tauri.app/config/2", "productName": "PS5Upload", - "version": "12.6.21", + "version": "12.6.22", "identifier": "com.phantomptr.ps5upload", "build": { "beforeDevCommand": "npm run dev:vite", diff --git a/engine/Cargo.lock b/engine/Cargo.lock index a7f236774..57cc48ff1 100644 --- a/engine/Cargo.lock +++ b/engine/Cargo.lock @@ -2570,7 +2570,7 @@ dependencies = [ [[package]] name = "ps5-dump-forge-exfat" -version = "12.6.21" +version = "12.6.22" dependencies = [ "ps5-dump-forge-patch", "ps5upload-fpkg", @@ -2579,14 +2579,14 @@ dependencies = [ [[package]] name = "ps5-dump-forge-patch" -version = "12.6.21" +version = "12.6.22" dependencies = [ "crc32fast", ] [[package]] name = "ps5-dump-forge-pfs" -version = "12.6.21" +version = "12.6.22" dependencies = [ "flate2", "ps5-dump-forge-patch", @@ -2596,7 +2596,7 @@ dependencies = [ [[package]] name = "ps5-dump-forge-ufs2" -version = "12.6.21" +version = "12.6.22" dependencies = [ "ps5-dump-forge-patch", "ps5upload-fpkg", @@ -2606,7 +2606,7 @@ dependencies = [ [[package]] name = "ps5-dump-forge-zstd" -version = "12.6.21" +version = "12.6.22" dependencies = [ "crc32fast", "getrandom 0.4.3", @@ -2617,7 +2617,7 @@ dependencies = [ [[package]] name = "ps5upload-apidoc" -version = "12.6.21" +version = "12.6.22" dependencies = [ "proc-macro2", "quote", @@ -2627,7 +2627,7 @@ dependencies = [ [[package]] name = "ps5upload-archive" -version = "12.6.21" +version = "12.6.22" dependencies = [ "anyhow", "crc32fast", @@ -2637,7 +2637,7 @@ dependencies = [ [[package]] name = "ps5upload-ava1" -version = "12.6.21" +version = "12.6.22" dependencies = [ "anyhow", "ava1", @@ -2660,7 +2660,7 @@ dependencies = [ [[package]] name = "ps5upload-convert" -version = "12.6.21" +version = "12.6.22" dependencies = [ "libc", "ps5upload-archive", @@ -2675,7 +2675,7 @@ dependencies = [ [[package]] name = "ps5upload-convert-core" -version = "12.6.21" +version = "12.6.22" dependencies = [ "blake3", "flate2", @@ -2695,7 +2695,7 @@ dependencies = [ [[package]] name = "ps5upload-core" -version = "12.6.21" +version = "12.6.22" dependencies = [ "aes 0.9.4", "aes-gcm 0.11.1", @@ -2729,7 +2729,7 @@ dependencies = [ [[package]] name = "ps5upload-ctest" -version = "12.6.21" +version = "12.6.22" dependencies = [ "anyhow", "ava1", @@ -2745,7 +2745,7 @@ dependencies = [ [[package]] name = "ps5upload-engine" -version = "12.6.21" +version = "12.6.22" dependencies = [ "aes 0.9.4", "aes-gcm 0.11.1", @@ -2813,7 +2813,7 @@ dependencies = [ [[package]] name = "ps5upload-fpkg" -version = "12.6.21" +version = "12.6.22" dependencies = [ "aes 0.9.4", "blake3", @@ -2837,7 +2837,7 @@ dependencies = [ [[package]] name = "ps5upload-hub" -version = "12.6.21" +version = "12.6.22" dependencies = [ "axum", "base64 0.23.1", @@ -2852,7 +2852,7 @@ dependencies = [ [[package]] name = "ps5upload-lab" -version = "12.6.21" +version = "12.6.22" dependencies = [ "anyhow", "ava1", @@ -2870,7 +2870,7 @@ dependencies = [ [[package]] name = "ps5upload-pkg" -version = "12.6.21" +version = "12.6.22" dependencies = [ "aes 0.9.4", "blake3", @@ -2882,14 +2882,14 @@ dependencies = [ [[package]] name = "ps5upload-tailnet" -version = "12.6.21" +version = "12.6.22" dependencies = [ "cc", ] [[package]] name = "ps5upload-tests" -version = "12.6.21" +version = "12.6.22" dependencies = [ "anyhow", "ava1", @@ -2907,7 +2907,7 @@ dependencies = [ [[package]] name = "ps5upload-unrar" -version = "12.6.21" +version = "12.6.22" dependencies = [ "serde", "serde_json", diff --git a/engine/Cargo.toml b/engine/Cargo.toml index c789cc321..f0a0322d1 100644 --- a/engine/Cargo.toml +++ b/engine/Cargo.toml @@ -32,7 +32,7 @@ resolver = "2" [workspace.package] edition = "2021" license = "GPL-3.0-or-later" -version = "12.6.21" +version = "12.6.22" [workspace.dependencies] # AVA1 (github.com/phantomptr/ava1): the Rust crate from crates.io; the payload builds the C side diff --git a/payload/include/config.h b/payload/include/config.h index 8b20cfcba..bac937538 100644 --- a/payload/include/config.h +++ b/payload/include/config.h @@ -5,7 +5,7 @@ * UI tell apart an old payload still running from a build that includes * a particular fix, without having to boot the console. Keep in sync * with the desktop app's package.json during releases. */ -#define PS5UPLOAD2_VERSION "12.6.21" +#define PS5UPLOAD2_VERSION "12.6.22" /* Author credit — embedded in the startup toast so anyone looking at * the console screen knows who wrote the software that just loaded. * Kept separate from VERSION so release scripts can bump the version From 36817a5e747b87387ceaad379556616a7965f9bb Mon Sep 17 00:00:00 2001 From: phantomptr Date: Sun, 22 Nov 2026 15:04:26 -0800 Subject: [PATCH 6/7] e2e: a user with no save of the game can now be picked for a copy Co-Authored-By: Claude Opus 5.5 Claude-Session: https://claude.ai/code/session_01GtiJiJdHq1hekoZ6vizvVT --- client/e2e/save-copy.spec.ts | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/client/e2e/save-copy.spec.ts b/client/e2e/save-copy.spec.ts index 8312e6a3e..381d09b51 100644 --- a/client/e2e/save-copy.spec.ts +++ b/client/e2e/save-copy.spec.ts @@ -135,13 +135,13 @@ test("Copy to another user, Back up now, then Restore to another user", async ({ const ann = page.getByTestId("save-row").filter({ hasText: "Ann" }); await expect(ann.getByTestId("save-backup-status")).toHaveText("Not backed up yet"); - // Copy to › Another user on this PS5: Ben has a save and can be picked, Cy can't. + // Copy to › Another user on this PS5: Ben has a save; Cy has none, and the copy would become Cy's. await ann.getByRole("button", { name: "Move or share this save" }).click(); await page.getByTestId("save-copy-to-user").click(); const picker = page.getByTestId("copy-user-picker"); await expect(picker.getByTestId("copy-user-target")).toHaveCount(2); - await expect(picker.getByText("Start PPSA01650 once as Cy and save, then come back.")).toBeVisible(); - await expect(picker.locator('[data-has-save="false"]')).toBeDisabled(); + await expect(picker.getByText("No save of this game yet. The copy becomes this user's save.")).toBeVisible(); + await expect(picker.locator('[data-has-save="false"]')).toBeEnabled(); await picker.locator('[data-has-save="true"]').click(); await expect(page.getByTestId("copy-user-confirm")).toContainText("Replace Ben's save of PPSA01650 with Ann's?"); await page.getByTestId("copy-user-replace").click(); @@ -227,7 +227,7 @@ test("Copy to another console: pick the console, then a user there with a save o await page.getByTestId("save-copy-to-console").click(); await page.getByTestId("copy-console-target").filter({ hasText: "Away" }).click(); const targets = page.getByTestId("copy-user-target"); - await expect(targets.filter({ hasText: "Cy there" })).toBeDisabled(); + await expect(targets.filter({ hasText: "Cy there" })).toBeEnabled(); await targets.filter({ hasText: "Ben there" }).click(); await page.getByTestId("copy-user-replace").click(); await expect From 005105f511acb9a761d31a8871899559600f8da0 Mon Sep 17 00:00:00 2001 From: phantomptr Date: Sun, 22 Nov 2026 15:17:44 -0800 Subject: [PATCH 7/7] Test: give the go-live stop test a stop window a slow machine can't miss Co-Authored-By: Claude Opus 5.5 Claude-Session: https://claude.ai/code/session_01GtiJiJdHq1hekoZ6vizvVT --- engine/crates/ps5upload-engine/src/rp_golive_tests.rs | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/engine/crates/ps5upload-engine/src/rp_golive_tests.rs b/engine/crates/ps5upload-engine/src/rp_golive_tests.rs index d921a4af7..8ec65204c 100644 --- a/engine/crates/ps5upload-engine/src/rp_golive_tests.rs +++ b/engine/crates/ps5upload-engine/src/rp_golive_tests.rs @@ -728,7 +728,13 @@ mod pretend { let s = pretend_session(); // Never reads its input and never ends on its own. let ff = fake_ffmpeg(&dir, "exec sleep 300"); - let r = start_run_with(one_site(), 160, ff.clone(), quick()).unwrap(); + // A grace long enough that the checks below run while it is still stopping, however + // slow the machine (the diagnostics call can take a few hundred ms on a busy Mac). + let slow_stop = Timing { + stop_grace: Duration::from_secs(3), + ..quick() + }; + let r = start_run_with(one_site(), 160, ff.clone(), slow_stop).unwrap(); wait_for(&r, 5, "started", |v| v["phase"] == "starting").await; assert!( start_run_with(one_site(), 160, ff.clone(), quick()).is_none(),