-
-
Notifications
You must be signed in to change notification settings - Fork 433
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
Recursively search CUSTOM folder for images (i.e. subdirectories) #2251
Conversation
Should the same apply to Maybe somebody wants to have folders for different games and such. |
We should use this for custom sets too. What happens if I put a symlink to the root directory inside custom? Will this then try to scan the whole file system? |
I'll update it to include the custom sets dir, and true about symlinks. I can have it ignore them |
Does root take priority over subfolders? |
@Daenyth @ZeldaZach I'd rather Cockatrice not ignore symlinks; I can see a use case for storing images on a separate drive/mount and symlinking the directory. I think that most anyone who's savvy enough to create symlinks is also smart enough not to symlink |
That said, that could also be addressed by adding some kind of directory traversal limit—just stop searching deeper after some number of directories, say 10. |
I can try implementing a limit on how far down you can go @Nightfirecat, but do you think that's an optimal idea? |
I took a second look at what I've done and what I feel should be done. Second, for symlinks I feel that we should allow them, but limit the depth to 4 ( Finally, I feel the current selection algorithm (alphabetically by directory/filename) is the best choice, but I'm open to hearing other ideas on how we should sort the CUSTOM folder. |
I haven't had a chance to review code yet, but I'd really like to see logs on load time so that someone can read their debug log and see what cockatrice tried to find, and the results |
@Daenyth Can you explain a little bit more on what you mean for the logs? |
As you iterate through directories, log them |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM assuming it works right; I'd still like a qDebug or something in the while loop
I can put a qDebug if you'd like, but it's a bit wasteful imo. |
What about that players who do other game as well, or several ones? Pokémon, Yu-Gi-Oh!, Hearthstone... It doesn't hurt to have it anyway? |
What happens to "qDebug" and "doing the same in customsets folder"?! |
If it's still relevant, open a new ticket describing the needed improvements; "doing the same in customsets folder" doesn't really belong to this PR anyway. |
Agreed on all counts
…On Thu, Dec 8, 2016, 1:45 PM ctrlaltca ***@***.***> wrote:
If it's still relevant, open a new ticket describing the needed
improvements; "doing the same in customsets folder" doesn't really belong
to this PR anyway.
The PR was approved by @Daenyth <https://github.com/Daenyth> and stuck
for 38 days, i think that the user originally reporting the bug at #2250
<#2250> will approve being
finally able to use this feature.
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#2251 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AAA5NIDHt1PkEL3aVJCCqcJshTHtvb06ks5rGFBfgaJpZM4KknS0>
.
|
Fix #2250.
This will allow for a recursive search through the CUSTOM folder until every image is checked to see if it matches the name of the card in question. If not found, continue like normal.
Checks subdirectories alphabetically, so if you have
The
Bar/example.jpg
will be used.