Kodi Community Forum
MariaDB has duplicate entries - Printable Version

+- Kodi Community Forum (https://forum.kodi.tv)
+-- Forum: Support (https://forum.kodi.tv/forumdisplay.php?fid=33)
+--- Forum: General Support (https://forum.kodi.tv/forumdisplay.php?fid=111)
+---- Forum: OS independent / Other (https://forum.kodi.tv/forumdisplay.php?fid=228)
+---- Thread: MariaDB has duplicate entries (/showthread.php?tid=376941)



MariaDB has duplicate entries - windomsparks - 2024-04-05

I am having a problem with duplicates in my video library. It started when I used the Library Auto Update addon from the Kodi repository. It happens on SMB shares. Some of the DB entries, as an example, use a path smb://192.168.0.10 and some use smb://102.168.0.10:445. I think this came about from carrying over the DB to fresh installs. The addon seems to have ignored the path with the port and made a 'duplicate' using the non-port path. That is, one entry using the path with the port one without the port. I think the first step is to make sure my video sources are corrected (without port?). I am not blaming the addon. I am not even sure it caused the problem. It's just that it's the only thing I can connect to the timing of the problem.

What would be the best approach to fixing this problem without recreating the library? I am capable of writing my own DB scrub as long as I know what tables and columns would be affected besides strPATH in table path. Any ideas?

If I have to recreate the DB, is there a way to carry over the episode-watched setting?

I am using Kodi 20.3 on android and X64 and MariaDB 10.3 on a Synology box (Not in docker).

=w=


RE: MariaDB has duplicate entries - PatK - 2024-04-08

(2024-04-05, 16:20)windomsparks Wrote: fixing this problem without recreating the library?
I don't think you can, but if you have exported as separate files re-scanning should not be a big effort. Suggest you peruse some of the hardware forums like windows support, I see plenty of MariaDB posts, or switch over to the specific add-on support for a focused response.


RE: MariaDB has duplicate entries - CrystalP - 2024-04-10

The path is also in the movie table. files is related to the path table. That's from a quick look at the db.


RE: MariaDB has duplicate entries - NahsiN - 2024-04-14

Quote:I am capable of writing my own DB scrub as long as I know what tables and columns would be affected besides strPATH in table path. Any ideas?
Ok then you can inner join path (P) and files (F) tables using idPath to get a list of file ids (idFile) you want to delete. Then the tables you need to delete rows from using idFile are:
  1. files
  2. bookmark
  3. settings
  4. stacktimes
  5. streamdetails
  6. movie or episode or musicvideo. This really depends on what the file was. 
Hope that helps and good luck.