"Export Patch" does nothing in Local Storage view in Windows version.
Closed this issue · 20 comments
Describe the bug
"Export Patch" does nothing in Local Storage view. No dialog appears asking to select the patch slot.
Desktop (please complete the following information):
- OS: Mac OS , Windows 10
- Version 1.1
Additional context
This functionality has a bug in Mac version too. It does display a window asking for the destination slot, but then refers to the wrong folder when making determination whether the slot is empty or not.
Downloaded the 1.1 Mac zip and attempted to export - can't seem to replicate the bug.
Not sure what to tell you. The app behaves very differently. It claims that the slots are taken even though they are not. It is not clear which folder it selects as the export destination at all. Very generally speaking, I think the problem is that your system seems to not be very representative and reliable as a test environment.
Could you provide some screenshots or video of the attempts you’ve made so far?
The prompts for export should denote the destination directory and slot, though you did mention before that no dialog box showed up.
I’ll poke around the code to try and understand why this is happening.
Some things that might be helpful to rule out:
- SD lock tab is down (dumb, but it happens)
- Invalid patches in the backend to export (requires checking in on the directories in
/Users/user/Library/Application Support/.ZoiaLibraryApp
for Mac, and the same location as you checked in #99 for Windows) - Other buttons in the app function, like do all of them cause issue or just a couple?
I think I figured it out, but it requires that the SD location is pulled before app closure. On shutdown, it will attempt to collect a bunch of preferences (like the UI sizes, SD card, dark mode, etc). If there is no SD location saved from that process or the SD is absent during init, it won't have a location to use and the Export button will fail. The steps I took were the following:
- (make sure SD is not inserted) Open app, close app to reset the SD preferences
- Open app, insert SD
- Either navigate to the SD tab or set the location from the Files menu
- Export from Local Storage (and banks) should now work
The fix is pretty straightforward in terms of coding, will try to update the zip shortly. For now, let me know if those steps work.
Try setting the SD a different way?
Apologies about the "attempt to export" option for the setting the SD, I had tried that after making the code fix and it works, but obviously your version won't have that change. The other 2 methods of SD location should work though, so I'm effectively stumped. You can roll back to 1.0 if this local export is crucial or wait for the new zip with the bugfix. Thanks for experimenting a bit.
Appreciate the feedback. Please see the updated Mac and/or Windows release here for the fix related to this bug, and for the Help items to actually display: https://github.com/meanmedianmoge/zoia_lib/releases/tag/v1.1.
Neither Windows or Mac version seems to have been updated.
Wasn't sure if I should open a new issue or not, but I believe I'm experiencing the same behavior on Windows as well, and I think I've figured out the root cause.
The main problem is that if the to_zoia
folder already exists on the SD card, any attempts to load a patch from local storage onto the card will fail completely.
This can be replicated by deleting the to_zoia
folder, then trying to export a patch from local storage, which will actually succeed. However, on the next attempt nothing will happen - no popup windows or anything, and the patch never gets put on the SD card.
Running latest master locally and doing the above, I end up getting the following error:
Traceback (most recent call last):
File "C:\Users\jamie\Documents\zoia-librarian\zoia_lib\zoia_lib\UI\ZOIALibrarian_local.py", line 272, in initiate_export
os.mkdir(os.path.join(self.sd.get_sd_root(), export_dir))
FileExistsError: [WinError 183] Cannot create a file when that file already exists: 'E:to_zoia'
It seems like this is happening because the check here:
zoia_lib/zoia_lib/UI/ZOIALibrarian_local.py
Line 271 in b75b250
always returns true.
I believe that happens because the output of os.listdir(self.sd.get_sd_root())
includes "to_zoia", but export_dir
is "E:to_zoia", so the two will never be the same, always returning true
in that conditional check.
Hopefully this was helpful. If you need any more testing on Windows let me know, I'll gladly help out.
Good catch @Jmeferlater, thanks for debugging! I’ll put in a patch for this soon and will update the release to reflect the change.
I'm pretty sure changing the os.mkdir command on line 272 to
os.makedirs(os.path.join(self.sd.get_sd_root(), export_dir), exist_ok=True)
will suffice; could either of you confirm using Windows? @Jmeferlater @john-breton
Yup, that worked for me!
Perfect, thanks! The patch has been merged to master, will update the release files shortly.
This works if the SD card is connected BUT if it is not, there is no prompt to select the path to it, nothing happens.