Duplicates after rescan; delete movie
#1
I was lacking movie covers for some reason and did a new scan (by using set content) to try to fix it. But this resulted in duplicates of each movie. Is there some way to remove the duplicates? Clean library didn't work.
I thought I maybe could delete all duplicated rows from the database manually, but looks like there are a lot of interconnection between several tables so not sure that's a good idea...
Is there some easy way to remove the duplicates?
-----
I'm using a shared mysql database and I think the reason that I got duplicates is that I've added the movie source (on a nas) on both computers running xbmc. But only one computer have been updating the database. So when I did a manual rescan on the other computer it created duplicates. Doesn't xmbc check filepath to see if it's already in the database?
Reply
#2
Star 
Set Content is a normal spec that must be done to get the scraper working.

Usually 'clean library' deletes covers etc if there is no 'real' video attached. But from your message.. I'm not sure that is the case. When you have extraneous data in the same folder as your video, CD1 CD2, dat etc, or improperly named trailers... (I'm supposing you have all your videos in separate individual folders, named as the file) these get scraped along with the main file and if you have 'use folder names' toggled without stack... these result in multiple listings. So in your case... the covers are connected to files, to check what the connection is... toggle the info page and look at what the path is pointing at.. delete as needed. Clean the library and you should be good to go.
Reply
#3
Hmm, this is weird. How does XBMC check if a video already is in the database?

I have 1 server containing all the movies/tv shows and a mysql db running.
2 XBMC clients connect to this db. So far I've had the sources (tv/movie) added on both clients without problems. But then I ran a rescan of movies on client 1 and got duplicates. I removed the movie source on client 1 and the duplicates was removed.

But then I removed the tv source on client 1 and now there suddenly is no tv shows in the db. The movie and tv source is still on client 2.

How does XBMC know if a movie/tv shows is already added to the database? Shouldn't this be done by path?
And when it cleans up, does it check which client has added the video to the database?
----
Is there some kind of cache locally? I re-added the tv source and all information (watched etc) was automatically added.
Reply
#4
Star 
Yes you can have duplicates...

XBMC doesn't check that. XBMC has a local cached library. Clean-up checks against this local library and files that are actually in the path... it attempts to scrape if nothing is found in the local lib, and deletes the lib data if there is no corresponding video .ext

If you have different paths to the same files... you'll get dups.
Reply
#5
stekre Wrote:Hmm, this is weird. How does XBMC check if a video already is in the database?

XBMC uses a URL for the video. For a video on a network this would typically look like:

smb://server/share/somefolder/thevideo.mkv

If you get duplicates it usually means you've managed to get two different URLs that point to the same film. If you enable debug logging then play the two duplicates in turn, the debug log should show the URLs being used to open the video. This might help spot the problem. If you fell up to using a MySQL browser you could look at the database directly to try and spot the duplication.

JR
Reply
#6
Ok, thanks for the help. If I have understood you correctly it should be possible to have the video sources added on both xbmc clients without getting duplicates. I'll check the debug log and the database to find the problem.
Reply
#7
stekre Wrote:it should be possible to have the video sources added on both xbmc clients without getting duplicates.

Yes, if the source is exactly the same on both PCs. If the source is different, e.g. one uses the IP address and the other the host name, then both will go into the library because XBMC thinks they're different files.

JR
Reply
#8
I have the same issue.

I had buffering problems with SMB, so I configured FTP on my windows machine and changed to the new sources. Even deleted the old smb paths from the network locations, but am left with a library with duplicates.

If there is no way to get clean library to remove the duplicates, can anybody tell me how to do a complete rebuild of the library?
Reply
#9
I ended up removing the advancedsettings.xml, I then got an old local version of the db when I started xbmc, exported this, deleted the sql db and created it all over again and imported the data.

Seemed quite difficult to remove the duplicates. In my case they appeared because I had used ip instead of hostname once. Made a terrible mess when I started editing the setup.

I tried to truncate all tables, but there was some data that shouldn't be removed. Some error about version...

So if you got duplicates in the db I think it's easiest to just delete the sql db and import from scratch (or backup db).
Reply

Logout Mark Read Team Forum Stats Members Help
Duplicates after rescan; delete movie0