Easy_xkcd icon indicating copy to clipboard operation
Easy_xkcd copied to clipboard

[Feature] Download only missing images when anabling offline mode

Open SebiderSushi opened this issue 5 years ago • 6 comments

Use case

I regularly back up my easy xkcd folder, partly because i like to prevent that i have to download them again, partly because i also manually fixed a few images by manually downloading comics Easy xkcd didn't fetch properly for me. If needed, i simply restore that folder from a backup. While setting up Easy xkcd on a new device, i see no option to prevent downloading exisiting images again.

I would like to have a way to tell the app to look for existing files in the offline directory (also for what-if) and re-use them instead of forcibly reloading all comics. I know that i can replace the easy xkcd directory after that but there might be situations where downloading ~200MB can be a problem, and at the very least is it unnecessary in my case and also takes up a few minutes.

SebiderSushi avatar Jun 17 '20 15:06 SebiderSushi

@tom-anders is this something you agree with and something i can start work on?

markolo25 avatar Oct 02 '20 01:10 markolo25

@markolo25 Definitely, go for it!

tom-anders avatar Oct 02 '20 05:10 tom-anders

I had started to work on a patch yesterday and I'm in the middle of finishing it up; I guess we can see how our implementations differ.

nogarcia avatar Oct 02 '20 16:10 nogarcia

Closing this along with the PR

tom-anders avatar Apr 09 '22 14:04 tom-anders

Thanks! This works very well now.

One thing i noticed is that Easy xkcd version 8.0.4 allows enabling the offline modes even without internet access. I'm not sure in which state the internal index is after doing that. What i observed was that Easy xkcd would open up and poperly load the current comic and swiping would work to some extent (maybe on the comics that had cached metadata from before enabling offline mode?), but especially when picking comics from the overview screen Easy xkcd would keep showing the loading animation even on comics that i had put into the offlineData directory.

I went ahead and wiped Easy xkcd's app data, copied the comic files i had to the offlineData directory again, then re-enabled offline mode while being connected to the internet. The notification appeared, showing that Easy xkcd would fetch the index. None of the image files were overwritten and everything works as expected now.

SebiderSushi avatar Apr 24 '22 19:04 SebiderSushi

Thanks for pointing that out, I think enabling offline mode should be blocked when offline.

tom-anders avatar Apr 24 '22 21:04 tom-anders