Kareadita / Kavita

Kavita is a fast, feature rich, cross platform reading server. Built with the goal of being a full solution for all your reading needs. Setup your own server and share your reading collection with your friends and family.
http://www.kavitareader.com
GNU General Public License v3.0
6.52k stars 341 forks source link

Duplicate Chapters / Novels being added after automatic scan #1576

Closed drewcasebeer closed 2 years ago

drewcasebeer commented 2 years ago

If this is a feature request, request here instead. Feature requests will be deleted from Github.

Please put as much information as possible to help me understand your issue. OS, browser, version are very important!

Describe the bug After Comics, Manga, or Light Novels are added to the file system. The automatic scan will run but will create duplicates for several of the items.

To Reproduce Steps to reproduce the behavior:

  1. Running nightly 0.5.6.24
  2. Add new files to a folder on NAS. These are added into a folder structure that looks like comics/Manga/The Beginning After the End with all of the files just in that one folder
  3. Wait for Scanner to automatically run and finish
  4. Clicking on series from Recently Updated Series look at the latest ones and you will see duplicates

Expected behavior No duplicate records should be created during a scan

Screenshots If applicable, add screenshots to help explain your problem. image image image image

Desktop (please complete the following information):

Additional context If possible having a way of deleting these duplicates would be helpful as well from the database, not the actual files, either singly or en-masse.

majora2007 commented 2 years ago

Do you have folder watching enabled? I saw this happen and fixed it in a local branch but it was due to folder watching rather than just a nightly scan.

drewcasebeer commented 2 years ago

Yes I do, I have since turned it off as this was happening anytime new files were being added, but for testing happy to turn it on again

majora2007 commented 2 years ago

I believe this to be an bug in the scan loop. I have it fixed in https://github.com/Kareadita/Kavita/pull/1573/, which I'm doing extended testing on. Once I merge that in, I'd recommend you to check out the new release and test this (with or without folder testing).

You will have to delete the series before hand. I should have this build out today after a final round of testing.

majora2007 commented 2 years ago

Hi, with v0.5.6.25 out, could you please retest if you're getting this issue and if no longer getting, close the issue?

drewcasebeer commented 2 years ago

Looks to be a bit slower but everything is working great!

drewcasebeer commented 2 years ago

Actually, sorry looks like this is still an issue. Before it was always happening in the later chapters that were added but now it is in the earlier ones.

For this, it appears to only be happening on the last series that was added. As an example, I added 2 new series and the first one that was picked up from the scanner is perfectly fine while the second has duplicates. This doesn't matter how many series are added it will always be the last series that will have duplicates.

For this I am downloading the files directly from the internet into the network drive that they are being scanned from.

majora2007 commented 2 years ago

Can you delete the series then rescan? Or check your logs, there is enhanced logging to tell you of corruption and steps to take.

Use [ScannerService] for searching

drewcasebeer commented 2 years ago

Yuppers when I ran the manual scan after deleting them they worked correctly. As for searching for Corruption do you want me to delete the series and move the out of the folder. Then re-add the series with the Folder Watching on?

majora2007 commented 2 years ago

Yes, if you see the corrupted error message, you just delete the series in Kavita only and the next rescan should fix everything up. No need to muck around with the actual files.

drewcasebeer commented 2 years ago

Gotcha, I am seeing the Kavita found corrupted volume entries on... messages in my logs and deleting the series and running a manual scan works for cleaning things up.

Would you like me to keep this issue open as it seems like having the Folder Watching turned on still creates these duplicate entries?

majora2007 commented 2 years ago

No, let's close this and open a new one up, since it's a separate issue.