neil-morrison44/pocket-sync

Pocket Sync freaks out if there is a folder in the screenshots folder

mcclure opened this issue · 5 comments

I have Pocket Sync 4.7.0 installed. I put one of my two Pocket SD cards into the computer and run Pocket Sync. I open "Screenshots".

image

What?

I look in the SD card, in the screenshots directory.

image

Looks like at some point I accidentally created a second directory inside Screenshots named "Screenshots". I think what you're doing is getting a directory listing in Screenshots and trying to open every file. But the directory listing has a directory in it and you cannot open a directory as a file. You should check if the file is actually a directory before trying to open it.

This bug is worse than it could be because it isn't just the Screenshots pane broken. I can't go into Settings or anything. The whole app refuses to run.

Expected behaviour

Directories in the Screenshots directory should be ignored. Or you could look inside them for more screenshots, I don't care.

Logs
Copy over the log from the folder that opens when you click the "Open Log Folder" button at the bottom of settings.
Pocket Sync.log.txt

Desktop (please complete the following information):
Windows 10 build 19045

Additional notes

I did some additional tests:

Removed the second Screenshots directory from inside Screenshots. Reran Pocket Sync. Result: Works fine.

Tried putting, instead of a directory, some garbage files inside the screenshots directory. Tried an empty file named WOIJFWEOIJG.txt, a file named WOIJFWEOIJG.txt with some keysmash ascii in it, a file named WOIJFWEOIJG.jpg with keysmash ascii in it. Result: Works fine, Pocket Sync shows a dead image icon which is helpful and what I'd expect.

I'll have a look & see what's going on - usually for this kind of thing (files out of place / invalid) I just try to make the error message as helpful as I can rather than try to compensate for it & have to add more conditional code.

That error is rubbish though so I'll improve it at least.

OK. Thing is tho it would actually be kind of convenient if I could make subfolders in my screenshots for organizing old screenshots. I don't need these folders to be visible to Pocket Sync, but if just making subfolders at all crashes Pocket Sync that means I either can't reorganize my screenshots this way or I can't use Pocket Sync at all…

Does the Pocket itself show the folders under Screenshots? If it does I'll support it to match.

For archiving purposes I'd recommend exporting the screenshots since the format the Pocket saves them in is some sort of weird bitmap PNG so they'll be taking up a lot of space.

Though you'd be losing the metadata of what core, game etc it came from.

I could probably append that data on to the exported PNGs but not many apps would read it & display it - but it's nicer than losing it.

Does the Pocket itself show the folders under Screenshots? If it does I'll support it to match.

The Pocket ignores folders. Which I think is fine. The problem with Pocket Sync is if there are ANY folders, the ENTIRE screenshots pane crashes. You can't look at any screenshots at all. If you want to match the Pocket behavior exactly, just ignore subfolders.

This should be fixed now in v4.8.0, though it's just that it doesn't break - will have a think about nice ways to tackle screenshot organisation at some point down the line