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

"Show all subfolders" stalls forever if selected folder is a symlink #132

Closed
zetaPRIME opened this issue Jan 20, 2025 · 5 comments · Fixed by #134
Closed

"Show all subfolders" stalls forever if selected folder is a symlink #132

zetaPRIME opened this issue Jan 20, 2025 · 5 comments · Fixed by #134

Comments

@zetaPRIME
Copy link

As the title states. Specifically, it stalls on "caching images" if the main directory is a symlink.

@anufrievroman
Copy link
Owner

Interesting! Thank you for reporting.
And when it's not "show all subfolders" it works fine?

Probably, related to the way glob indexes files. We implemented it with @nikolaizombie1 to speed up things, but might need to return to the old way, just with deeper indexing.

@zetaPRIME
Copy link
Author

Works fine with normal search; stall also seems to happen with any directory symlink within the tree. If it were only the main directory I'd just say to check and resolve the link first, but given that it's any link, doing a limited recursive search manually seems reasonable. (There may be additional options within glob to test first, though.)

anufrievroman added a commit that referenced this issue Jan 24, 2025
Now the depth is defined in the config, so user can decide how many
folders to be indexed. Thus, it address the issue #132
@anufrievroman
Copy link
Owner

I reimplemented the subfolder system. Now it should not fail, but you'll have to decide the desired depth in the config with the new parameter (it will be automatically added there after the first run). May I ask you to test it because I don't realy have symlink folders at hand?

@nikolaizombie1
Copy link
Contributor

I fixed the bug. It was caused by the fact that glob.glob does not handle symlinks. However, pathlib.Path.glob does but requires more manual filtering and mapping than glob.glob. I tested on a symlinked image folder and it worked correctly.

@anufrievroman
Copy link
Owner

Okay, I reimplemented things a bit more to keep just one function for everything and remove the obscure "depth" parameter. I think now it should work fine. Basically, now there are two possibilities, either show one level of subfolders or all.

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

Successfully merging a pull request may close this issue.

3 participants