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

Add folder check in move-to-archive #11262

Merged
merged 7 commits into from Dec 27, 2023

Conversation

mergen3107
Copy link
Contributor

@mergen3107 mergen3107 commented Dec 25, 2023

First try.
Function is taken from: https://www.geeks3d.com/hacklab/20210901/how-to-check-if-a-directory-exists-in-lua-and-in-python/

Use case:

  1. Open KOReader with MoveToArchive plugin enabled, setup folder for it.
  2. While KOReader is open, rename that folder to something else.
  3. Try to go to that folder from the plugin menu. Now instead of crashing, it should ask about setting a new folder for MoveToArchive.

This change is Reviewable

@mergen3107
Copy link
Contributor Author

Supposed to close #11245
Please let me know:

  1. If there is an existing function to check if the folder exists that I should use instead of this new function.
  2. If this is a robust way to do this.
  3. If can add this somewhere else as well? News Downloader, and other plugins?

I tested quickly on Kindle Scribe.

Thanks!

@mergen3107
Copy link
Contributor Author

(OK, CircleCI stopped complaining, I hope I did it right... :D)

@Frenzie Frenzie added this to the 2024.01 milestone Dec 25, 2023
@Frenzie Frenzie added the Plugin label Dec 25, 2023
@mergen3107
Copy link
Contributor Author

Thank you guys! Is this way better? :D
If so, I can go around and check other plugins/places where this could be handy.

frontend/util.lua Outdated Show resolved Hide resolved
@Frenzie Frenzie modified the milestones: 2024.01, 2023.12 Dec 27, 2023
@Frenzie Frenzie merged commit 57cbde5 into koreader:master Dec 27, 2023
3 checks passed
@mergen3107 mergen3107 deleted the Move-to-archive-add-folder-check branch December 28, 2023 15:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants