BUG: Adding an existing folder doesn't let you add newly created sub-folders
Is there an existing issue for this?
- [x] I have searched the existing issues
What happened?
Currently: When you add a folder to PictoPy it adds all the sub-folders with it. Therefore, adding an existing folder again should add back the previously deleted/newly created sub-folders. But the UI directly denies this action by saying 'Folder already exists'.
Ideal Behaviour:
- Adding an existing folder should add the previously non added subfolders.
Although, this can be achieved by adding the subfolders individually, this logic of adding missing subfolders is intuitive as per the logic of adding new folders into PictoPy.
Example of the problem:
- User adds one 'Main' folder with 20 subfolders.
- Later he decides to add 10 more subfolders, but he cannot add the 'Main' folder again since the UI will block it by saying 'Main folder already exists.
- User will have to add these folders one by one.
Expected example solution:
- To resolve this we will let users add an existing folder again if there is updated data in that folder. And alert if they add the same folder with exact same data.
Record
- [x] I agree to follow this project's Code of Conduct
👋 Thanks for opening this issue! The maintainers will review it shortly. Till then, do not open any PR. This is a strict rule we like to follow around here :)
Discussions are carried on Discord.
Instead of commenting here, join the AOSSIE Discord server and go to Projects → PictoPy.
If you find this project useful, a GitHub star would be appreciated.
@rohan-pandeyy i want to work on this issue can i get assigned to it?
I would like to propose an enhancement to PictoPy's existing folder-import functionality.
Currently, when a user tries to add a folder that has already been imported, the application displays a "Folder already exists" message and prevents the operation.
However, users may create additional subfolders inside that directory after the initial import. They may also want to restore previously deleted subfolder entries.
Concrete User Workflow
- A user has a folder named
Maincontaining 20 subfolders. - They add
Mainto PictoPy, which imports all 20 subfolders. - A few days later, they create 10 additional subfolders inside
Main. - They try to add
Mainagain so PictoPy can discover the newly created subfolders. - Currently, PictoPy blocks the operation with a "Main folder already exists" message.
- The user must manually add all 10 subfolders individually.
Proposed Behaviour
Instead of rejecting the operation, PictoPy should scan the existing directory and compare its subfolders with the entries already registered.
- If new subfolders are found, import only those missing subfolders without duplicating existing entries.
- If no new subfolders are found, display a message such as "Folder is already up to date."
- If previously removed subfolder entries still exist on disk, allow users to restore them.
This enhancement would eliminate the need to manually add multiple subfolders, make folder importing more intuitive, and improve the overall user experience.
I believe this functionality would be a valuable addition to PictoPy's existing folder-import workflow.
Hi @rohan-pandeyy, I'd like to take this one, please assign me.
My plan:
- Right now the add-folder flow rejects the request as soon as the folder path already exists in the DB. I'll change that so it doesn't stop there.
- Instead, when the folder already exists, walk its subfolders on disk, compare them against what's already registered, and insert only the missing ones (no duplicates).
- If nothing new is found, return a clear "Folder is already up to date" message instead of the current error, so the "same folder, same data" case still gets an alert like the issue asks.
- Add backend tests for 3 cases: new subfolders found, nothing new, and a previously removed subfolder that still exists on disk.
- Update the frontend toast/message so the user sees "added X new subfolders" vs "already up to date".
I'll keep the PR small and focused on just this. I'll wait for assignment before opening any PR.