Solved Duplicate entry in database (information)
#1
Hello all.

1st/ This post is for information (for community) and a memory to myself in case of need.
2nd/ My version of Kodi is running on RaspberryPI (B) on the OSMC distro (raspbian-fork)

3rd/ Here WAS my issue.
When I performed a "Search" I got for some files a duplicate entry (same name, same category, from a technical point of view same file (field c22) but different idFile (of course)...) one is usable,the other is not

Please trust me on this:
- I do not know or even have the tiniest idea how this came...
- my sources.xml file is PERFECTLY sane (no duplicate entry, no subdirectory sources....)
- I perform several times "clean of database"
- until this I NEVER manipulate the MyVideo90 database

4th and last/ My solution.
I connect to my SQL database (in my case mariadb to be precise, but same for sqlite)
I perform this SQL-"command":
Code:
select count(*) from movie
  where not exists
  ( select * from files
  where movie.idFile=files.idFile);
answer was 303 (on 1593 entries), the "not exists" is particulary mandatory!

Thus I need to do something, delete the empty records :
Code:
delete from movie
  where not exists
  ( select * from files
  where movie.idFile=files.idFile);
It took a couple of ms

my issue is gone.
Reply

Logout Mark Read Team Forum Stats Members Help
Duplicate entry in database (information)0