Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Feature Request] Redownload corrupted files automatically / flag them to the user #49

Open
Rick1029 opened this issue May 29, 2020 · 11 comments
Labels
enhancement New feature or request

Comments

@Rick1029
Copy link

Recently, Mango would launch telling me several files were corrupted or not a valid zip. They were working fine previously but ah well, things happen.

Is it possible for Mango to flag these and redownload them from their source? (in my case, Mangadex.) Potentially if they were local files downloaded outside of Mango, visibly flag them to tell the user that these files are corrupted and need replacing (Right now, it tells me in the command line when starting, but no gui feedback. Some people on auto start scripts might miss that some files are corrupt.) I've had to remove the entire library (hand deleting and redownloading the 40+ files that are corrupted would take a while) and redownload from scratch, which is annoying because Mangadex downloads are slow.

Thanks!

@Rick1029 Rick1029 added the enhancement New feature or request label May 29, 2020
@Docteh
Copy link

Docteh commented May 29, 2020

I had two fail chapters, and it let me retry them from the "Download Manager". Did they show as fine over there?

@hkalexling
Copy link
Member

Thanks for reaching out!

@Docteh I think @Rick1029 has the chapters downloaded and removed from the queue already, so retrying from the download manager is not an option.

@Rick1029 Unfortunately in the current version Mango does not store the source of downloaded chapters, so there's no way for it to automatically re-download corrupted files. But I got your point and I agree this would be a useful feature to have. I will plan ahead and have it included in a future release.

hand deleting and redownloading the 40+ files that are corrupted would take a while

It's unlikely to have so many files corrupted, and It's probably a permission issue. When scanning the library, Mango would check the integrity of the archives by attempting to open them. If Mango fails to do so, it reports the warning message. The same message would be printed if Mango doesn't have the read permission to open the files. I admit it's a bad design, and I will make sure permission issues are reported separately in the next version.

For now, I would suggest setting the log level to debug so Mango would report the reasons that it fails to open the archives.

[DEBUG]   2020/05/30 12:23:37 | Starting Kemal server
[WARNING] 2020/05/30 12:23:37 | File /home/alex_ling/mango/library/InvalidZip/haha.cbz is corrupted or is not a valid archive. Ignoring it.
[DEBUG]   2020/05/30 12:23:37 | Archive error: Unable to seek: Invalid argument
[WARNING] 2020/05/30 12:23:37 | File /home/alex_ling/mango/library/InvalidZip/test.zip is corrupted or is not a valid archive. Ignoring it.
[DEBUG]   2020/05/30 12:23:37 | Archive error: Unable to seek: Invalid argument
[WARNING] 2020/05/30 12:23:37 | File /home/alex_ling/mango/library/mangadex-7139 One Punch-Man/Ch.109 Fake.cbz is corrupted or is not a valid archive. Ignoring it.
[DEBUG]   2020/05/30 12:23:37 | Archive error: Couldn't find directory end signature in the last 65KB
[DEBUG]   2020/05/30 12:23:37 | Scan completed
[INFO]    2020/05/30 12:23:37 | Scanned 22 titles in 353.594ms

@hkalexling
Copy link
Member

hkalexling commented May 30, 2020

  • Report permission issues
  • Display corrupted archives in the web interface
  • Add options to delete or re-download them if they are downloaded from MangaDex

@Rick1029
Copy link
Author

You’re probably right, must’ve been a permission issue. I already went and redownloaded the files so I can’t check, but I set the permissions properly just in case. Thanks for the quick reply, still loving the app!

@hkalexling
Copy link
Member

Great! No need to close the issue; I will close it when the todos above are completed.

@hkalexling
Copy link
Member

I am replying to @jaredlt's questions in #41 here as it's more relevant to this issue.

I see in #49 you are looking to be more specific with the error messages regarding permissions. Will you also do the same regarding solid support etc?

We definitely need detailed error messages for these at the info log level. This will be added to the new release (v0.5.0) soon.

You also mention displaying corrupted archives in the web interface. I think this will be really useful. Will this apply for all errors or unsupported archives? Basically, anything where the logger says ignoring it?

Yes, I plan to display archives that cannot be opened in the web interface and show the error messages there. Otherwise, our users would be surprised if they find a few chapters missing from the list. Here's a quick mockup to illustrate:

Screenshot 2020-06-01 at 8 41 00 PM

If the archive cannot be opened, we use the Mango icon as its thumbnail and apply the grayscale CSS filter. The error message will be displayed when hovering over the card:

Screenshot 2020-06-01 at 8 41 09 PM

Some edge cases to consider:

  • When the user finishes an entry, if the next entry is an invalid archive, the "Next Entry" button should report that when pressed and redirect the user back to the title page.
  • If the invalid archive has a custom thumbnail uploaded by the user, we should display the thumbnail instead of the default Mango icon, and apply the same filter.

Your inputs are always welcome!

@jaredlt
Copy link
Collaborator

jaredlt commented Jun 1, 2020

@hkalexling this looks really good!

One additional feature I spotted in Komga that I think would be useful is a dedicated page that lists all the archives that have issues. I guess it would sit in the Admin area and allow admins to see at-a-glance all the files that need intervention.

komga-archive-errors

Let me know if I should spin this out to its own issue.

@hkalexling
Copy link
Member

@jaredlt In fact I have been planning something along the line, but more powerful - perhaps we can have a notification page? Anything that requires user attention will show up there, including archives having issues and new version releases. In terms of UI, we can have a message icon next to the light/dark theme switch icon, and a badge shows up on the icon when there are new notifications available.

What do you think? Feel free to open a new issue to brainstorm and track progress.

@jaredlt
Copy link
Collaborator

jaredlt commented Jun 3, 2020

@hkalexling yep, sounds perfect! I'll open an issue and dump some thoughts 👍

@ghost
Copy link

ghost commented Jun 7, 2020

Hey, i like to sometimes use waifu2x to upscale my manga pages for series where the image quality is lackluster, so i would like to see this atleast be optional

@jaredlt
Copy link
Collaborator

jaredlt commented Jun 7, 2020

@outnos I suggest you open a separate issue for your feature request. It feels like a good fit for the planned plugin system.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

4 participants