[PR #683] [MERGED] fix: Ensure bookmark files are correctly downloaded before deleting current ones #728

Closed
opened 2026-02-25 23:35:16 +03:00 by kerem · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/go-shiori/shiori/pull/683
Author: @Monirzadeh
Created: 7/28/2023
Status: Merged
Merged: 8/20/2023
Merged by: @fmartingr

Base: masterHead: cache-recovery


📝 Commits (10+)

  • 7aa37d2 generate ebook get dstPath
  • 91937b3 Archive and ebook can recover if download faild
  • c12e3f2 recover thumb if download faild
  • 379a3ba thumb image create just if image processing is sucssesful
  • 42afd23 create epub in tmp if it sucssesful copy to destination
  • 624a746 archive file create in tmp if it successful move to destination
  • 2ec8e5e move to destination as function
  • 44b9a13 update ebook download api and remove .epub from file name
  • 622ff9d report faild item to user
  • bf31c3b not show dialog if error not happen

📊 Changes

11 files changed (+682 additions, -267 deletions)

View changed files

📝 internal/core/ebook.go (+34 -21)
📝 internal/core/ebook_test.go (+159 -203)
📝 internal/core/processing.go (+78 -28)
internal/core/processing_test.go (+349 -0)
📝 internal/view/assets/js/page/home.js (+30 -9)
📝 internal/webserver/handler-api.go (+25 -5)
📝 internal/webserver/handler-ui.go (+1 -1)
testdata/big_image.png (+0 -0)
testdata/favicon.png (+0 -0)
testdata/favicon.svg (+6 -0)
testdata/medium_image.png (+0 -0)

📄 Description

This pull request should recover old version of Archive and e-book if download Processes failed.
It should close #634
fix #524

TODO:

  • generate ebook to dstPath
  • Archive Recover
  • E-Book Recover
  • Thumb Recover
  • E-Book Download API should manage if ebook file exist not download as TODO in code
  • if download Failed and recover old file, it should report to user in UI
  • thumbnail will update in update archive #524 #680
  • update old unit test.
  • add more unit test to cover processing.go 87.7%
  • add test image file to repository
  • replace URL with sample file

Things need more time:

should we recover thumb image? What if thumb image remove from source like #524. How we should detect that


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/go-shiori/shiori/pull/683 **Author:** [@Monirzadeh](https://github.com/Monirzadeh) **Created:** 7/28/2023 **Status:** ✅ Merged **Merged:** 8/20/2023 **Merged by:** [@fmartingr](https://github.com/fmartingr) **Base:** `master` ← **Head:** `cache-recovery` --- ### 📝 Commits (10+) - [`7aa37d2`](https://github.com/go-shiori/shiori/commit/7aa37d2e11d2d77600dcf406eeb23fc74b60ce61) generate ebook get dstPath - [`91937b3`](https://github.com/go-shiori/shiori/commit/91937b3e252eb6872a6cd588ff86e728a11b0ce2) Archive and ebook can recover if download faild - [`c12e3f2`](https://github.com/go-shiori/shiori/commit/c12e3f213c0162abe2cd8b3748b681c233880816) recover thumb if download faild - [`379a3ba`](https://github.com/go-shiori/shiori/commit/379a3ba476189863cc932f0adb6d629f3ba4a387) thumb image create just if image processing is sucssesful - [`42afd23`](https://github.com/go-shiori/shiori/commit/42afd233b4cca947020b7f4cd936180cca7869f6) create epub in tmp if it sucssesful copy to destination - [`624a746`](https://github.com/go-shiori/shiori/commit/624a74638a00e38b0f82e3432988358f3b4bdf49) archive file create in tmp if it successful move to destination - [`2ec8e5e`](https://github.com/go-shiori/shiori/commit/2ec8e5ebdcd468f324e112a7630d4489907f7813) move to destination as function - [`44b9a13`](https://github.com/go-shiori/shiori/commit/44b9a13c048f15aebf56f351e045b25137c6b488) update ebook download api and remove .epub from file name - [`622ff9d`](https://github.com/go-shiori/shiori/commit/622ff9d275cfe8730127df3a152da26a189ada37) report faild item to user - [`bf31c3b`](https://github.com/go-shiori/shiori/commit/bf31c3b4284a9caa23802e2337a142cda9015d7f) not show dialog if error not happen ### 📊 Changes **11 files changed** (+682 additions, -267 deletions) <details> <summary>View changed files</summary> 📝 `internal/core/ebook.go` (+34 -21) 📝 `internal/core/ebook_test.go` (+159 -203) 📝 `internal/core/processing.go` (+78 -28) ➕ `internal/core/processing_test.go` (+349 -0) 📝 `internal/view/assets/js/page/home.js` (+30 -9) 📝 `internal/webserver/handler-api.go` (+25 -5) 📝 `internal/webserver/handler-ui.go` (+1 -1) ➕ `testdata/big_image.png` (+0 -0) ➕ `testdata/favicon.png` (+0 -0) ➕ `testdata/favicon.svg` (+6 -0) ➕ `testdata/medium_image.png` (+0 -0) </details> ### 📄 Description This pull request should recover old version of Archive and e-book if download Processes failed. It should close #634 fix #524 # TODO: - [x] generate ebook to dstPath - [x] Archive Recover - [x] E-Book Recover - [x] Thumb Recover - [x] E-Book Download API should manage if ebook file exist not download as TODO in code - [x] if download Failed and recover old file, it should report to user in UI - [x] thumbnail will update in update archive #524 #680 - [x] update old unit test. - [x] add more unit test to cover `processing.go` 87.7% - [x] add test image file to repository - [x] replace URL with sample file # Things need more time: should we recover thumb image? What if thumb image remove from source like #524. How we should detect that --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
kerem 2026-02-25 23:35:16 +03:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/shiori#728
No description provided.