tfonteyn / NeverTooManyBooks

A book collection app for Android
GNU General Public License v3.0
80 stars 5 forks source link

Importing Zip file to new device, no book covers #77

Open didispe opened 1 week ago

didispe commented 1 week ago

When I import the zip file on a new device the book covers are missing though they are contained in the ZIP. Any Idea?

tfonteyn commented 1 week ago

they should be... of course providing you had that enabled when exporting (which it is by default). Can you please: 1) Open the zip file on a computer and simple check if the images's are there? 2) Make sure that you had enough space on the new device where you uploaded the zip file. I've seen imports fails due to truncated zip files. 3) On the new device, in the app, goto "Settings", scroll to the bottom, choose "Maintenance" and then create a bug-report with "log-files" and "settings". It will generate a small file which you can save to your device, and then upload here.

Is this an export from an NTMB installation on another device? Or is this an export from the old Book-Catalogue app? Either way, if you are willing, can you upload the zip file here, and I'll take a look in detail.

didispe commented 1 week ago

thanks for the quicj reply 1 they are there 2 enough space 3 here the file ntmb-debug-2024-11-04.zip

didispe commented 1 week ago

Export from NTMB from other device

tfonteyn commented 1 week ago

I'll do a quick test here, but I think I know what the problem is. I'll get back to you a little later today.

tfonteyn commented 1 week ago

The error log shows no issues at all. However, the settings show that on the old device you had (likely) moved the images to secondary storage (i.e. an internal SDCARD), and I presume the new device does not have secondary storage.

Can you please on a computer, create a new folder, and extract the backup zip. Obviously keep the original zip file as backup! i.e. you should end up with:

folder/*.jpg 
folder/*.json

One of them will be "folder/preferences.json"

Open the "preferences.json" file in a simple text editor (notepad.exe, TextEdit, or your preferred Linux plain text editor). Careful now... it will likely show as a single line of text. Locate the text which says:

"storage.volume.index":"1"

and change the "1" to a "0"

"storage.volume.index":"0"

Save the file, overwriting the old one.

If your editor created a backup file in the same folder, remove it. Now create a new zip file with all the files IN the folder. In other words, do NOT zip up the folder itself, but zip up by selecting all the files (jpg's, json's)

Double check the new zip file that all files are at the root of the archive and not wrapped up inside an extra folder. Import this zip file on the new device. For the books, just select "All books".

That should fix the problem.

Obviously this is not user-friendly, so I will make some changes in the code to prevent this issue from happening.

didispe commented 1 week ago

GREAT! that solved the problem, thanks a lot !

didispe commented 1 week ago

So I have to to do this procedure every time I transfer a backup? (for example: Updates on the phone and transfer to the tablet)

tfonteyn commented 1 week ago

So I have to to do this procedure every time I transfer a backup? (for example: Updates on the phone and transfer to the tablet)

If you do this procedure with the current version 6.3, then you can:

This will be permanently fixed in the upcoming 6.4 release. I have been improving searching for books without isbn numbers and expect to release 6.4 either late this week or next week.

I'll keep this issue open, and let you know when 6.4 is out.

tfonteyn commented 5 days ago

I'm delaying 6.4... needs more work and "life" is interfering 👎

So, I back-ported the fix and released 6.3.1 instead.

It will simply ignore the device-specific setting for the storage volume, so importing will work properly now. No need to re-export btw, it will/should work just fine as long as your new device has the 6.3.1 but obviously please install on both devices.

Please confirm this is working for you now.