-
-
Notifications
You must be signed in to change notification settings - Fork 170
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
Archives can sometimes be "duplicated" in the entries after modifying their contents #671
Comments
👋 Running a database cleanup should fix this. Changed IDs should normally clean up their older variant, but depending on the state of the background worker(especially on windows) it might've missed it. Backup your db just in case and let me know how it goes! Support for updated archives is fairly recent. |
Well, that's the exact reason why I'm opening this issue. I know that support for updated archives was added in 0.8.6, but these archives in question were also modified after said update (well, the original archives were added to the database before the update, does that matter?), which is why I find it a bit weird. I've already manually fixed the issue so unfortunately I can't let you know what a database cleanup will do.
I think this might be the issue here. If this is a thing that can be optimized/fixed then it'll be great. If not then oh well. haha |
P.S. It seems that as long as the first file is not changed then everything usually works fine, but when it is then this issue ALWAYS happens. Maybe this is the cause of the problem? P.P.S: Cleaning the database will get rid of the duplicate file, but it's the old file ID that's being removed, and the metadata of said old archive does not carry over to the new one - which means that all the metadata of that archive is lost. This shouldn't be intended behavior and hopefully will be fixed in the future. Edit - looks like we've found the cause. in #685 we've learnt that by modifying the first 512kb of a file the archive ID will change, thus resulting in another duplicate gallery being created - but what shouldn't happen is A. The old archive not being deleted and still "stuck" to the new archive (deleting either archive in LR will result in the both of them being removed). B. The old archive's metadata not being copied to the new archive. This means that in the event a user wishes to clear the duplicate by cleaning the database, they will also lose all the metadata they've attatched to this archive. Let's see if there'll be a good fix for this issue. |
record_19_34_57.mp4Seems to work as expected, more testing would be welcome. Anything you see wrong here? @Difegue |
That does look like it'd do the trick - - Although we shouldn't have to do this since the redis Maybe I missed something in the docs about it, needs some more digging. |
And you are right, we don't have to and i found the problem. For clarity: I replaced test2.cbz and it tells me it changed the ID but the archive itself disappears.
Now if you press "clean database", the archive appears again BUT it turns the ID back to the old ID despite it still being the new file.
So now it renamed it back to the old ID and if you rescan the archive folder it will create duplicates
Now clean database again, and it gets rid of the old (and duplicate) archive, but now you're left with a new archive and without any of the metadata carried over.
This is avoided if you "rescan archive directory" before doing "clean database". It will also carry over the metadata if you do that (since it doesn't create a new entry in the database and just replaces the old one as it should) I added 2 videos that hopefully make it a bit more clear whats happening. rescan.archive.first.-.clean.database.mp4clean.database.mp4 |
Thanks for the detailed breakdown (and sorry for having taken so long to look at it!); Turns out the ID update code wasn't re-updating the master ID list after changing it, which would lead to issues like this when cleaning the DB later. I'll have a fix for this in 0.8.7. |
Win10 0.8.6 msi
Description:
When locally editing a archive's contents (e.g. adding/removing images), said archive can sometimes get "duplicated" in the app's database, meaning that it'll show up as two different entries with different IDs despite being the same source file.
This means that deleting either one of these two entries will also lead to the other one being deleted - which is extremely annoying since you'll need to add the metadata all over again.
See:
The source file is exactly the same while the IDs are somehow different:
The text was updated successfully, but these errors were encountered: