Linux Duplicate media entries in XBMC
#16
(2014-03-28, 20:55)Novin Wrote: I too, have issue with duplicate entries. I have a lot of them. Even after cleaning library. Running XBMC Gotham Beta 2.

One example, an episode of South Park. In table episode, I have two entries for the same episode.

Code:
INSERT INTO `episode` (`idEpisode`, `idFile`, `c00`, `c01`, `c02`, `c03`, `c04`, `c05`, `c06`, `c07`, `c08`, `c09`, `c10`, `c11`, `c12`, `c13`, `c14`, `c15`, `c16`, `c17`, `c18`, `c19`, `c20`, `c21`, `c22`, `c23`, `idShow`) VALUES
(442, 2179, 'HUMANCENTiPAD', 'Kyle is intimately involved in the development of a revolutionary new product that is about to be launched by Apple. Meanwhile, Cartman doesn''t even have a regular iPad and blames his mother.', '', '7.800000', 'Trey Parker', '2011-04-27', '<thumb>http://thetvdb.com/banners/episodes/75897/3178461.jpg</thumb>', '', NULL, '1800', 'Trey Parker', '', '15', '1', '', '-1', '-1', '-1', 'rar://%2fmedia%2fmistik%5fshared%2fSeries%2fSouth%5fPark%2fs15%2fSouth%2ePark%2eS15E01%2eHumancentiPad%2eUNCENSORED%2eHDRiP%2eXviD%2dT00NG0D%2ft00ng0d%2dsouth%2epark%2e1501%2euc%2exvid%2epart01%2erar/South.Park.S15E01.HumancentiPad.UNCENSORED.HDRiP.XviD-T00NG0D.avi', '1169', NULL, NULL, NULL, NULL, 3),
(604, 4093, 'HUMANCENTiPAD', 'Kyle is intimately involved in the development of a revolutionary new product that is about to be launched by Apple. Meanwhile, Cartman doesn''t even have a regular iPad and blames his mother.', '', '7.900000', 'Trey Parker', '2011-04-27', '<thumb>http://thetvdb.com/banners/episodes/75897/3178461.jpg</thumb>', '', NULL, '1800', 'Trey Parker', '', '15', '1', '', '-1', '-1', '-1', '/media/mistik_shared/Series/South_Park/s15/South.Park.S15E01.HumancentiPad.UNCENSORED.HDRiP.XviD-T00NG0D/', '2040', '3178461', NULL, NULL, NULL, 3);

The entry with idEpisode 604 just point to the directory, not a file?

Created a bug report about this, http://trac.xbmc.org/ticket/15108
Reply
#17
From Novin's bug report:

Quote:Got a tip in a forum thread, set scraper to none and then back to tmdb / tvdb. This fixed this issue for me (along with several broken images).

This also worked for me. Existing duplicate library entries were removed.

It remains to be seen whether or not adding new media files will result in additional media library duplicates.
Reply
#18
Something further troubles me: Why doesn't the ordinary "Clean Library" process fix this? Isn't that what it's for; to make sure that the Media Library has a one-to-one correspondence with the actual media?
Reply
#19
I think that clean library just checks for valid paths so as long as there is an actual file at the location its good. I don't think it looks for duplicates.
If I have been of help, please add to my reputation as a way of saying thanks, it's free.
Reply
#20
As I feared, the problem persists. Although the method described in Post #17 temporarily removes duplicate items from the library, as soon as you add more media files you start getting more duplicates.

Not every new file creates a duplicate library entry, just some. I have yet to figure out what the duplicate entries have in common.

I added the following files this past week:

Code:
-rw-r--r--@  1 mnewman  staff  170132465 Apr 10 00:49 The.Colbert.Report.2014.04.08.Jane.Goodall.HDTV.x264-2HD.mp4
-rw-r--r--@  1 mnewman  staff  152081721 Apr 11 04:52 The.Colbert.Report.2014.04.09.Sheryl.Sandberg.HDTV.x264-SWOLLED.mp4
-rw-r--r--@  1 mnewman  staff  186324253 Apr 12 07:11 The.Colbert.Report.2014.04.10.Sting.HDTV.x264-BATV.[VTV].mp4

The second file listed has two entries in the library, the other two have one each.

Weird.
Reply
#21
Recently, while adding one more xbmc client (this time a Windows 7 x64 PC with v12.3) to my home media center I've got all my SMB episodes duplicated in mysql database, even though I have checked previously (before library update in this new machine or any other machine) that all correlated userdata files (sources.xml, mediasources.xml, passwords.xml and advancedsettings.xml) were identical in all my xbmc clients. I don't know what happened, but every entry (episode) for every tvshow was really duplicated (every column had identical data).

So in order to eliminate all duplicated episodes from the database and to assure that no other duplicates enters in the future I have used the following simple SQL query:

ALTER IGNORE TABLE `episode ` ADD UNIQUE INDEX (`idFile`, `idShow`, `c12`, `c13`);

The above command translates to: allow only one (unique) file (idFile) for the same: show, season (c12), episode (c13).

HTH.
Reply
#22
I had a similar problem, and here is what I found.
Say I had an episode of FrasierS1E05(season1,Episode5)

Using Handbrake to resize the file, I ended up with something like FrasierS1E05-10.

When I added this to XMBC, it added the same file as Episode 5 and Episode 10. So check your file name.
Reply
#23
I've had this problem for some time now. Except it appears only the music database is affected. I think I may have caused this.

I'm running the latest Gotham trunk release (13.2beta1) compiled from Git sources, running on Debian testing.

Several months ago I noticed repeat occurances of the artist Älgarnas Trädgård, an artist that doesn't physically exist anymore on the server. In trying to remove the duplicates I accidentally deleted some rows in the database. I think I read subsequently that this was not good - I made the problem worse Sad (I used sqlitebrowser to modify).

How should I proceed here?

Do I simply delete MyMusic46.db from the userdate/Database folder? Then rescan.
Would any other datebase need to be removed?
This will not be a quick process, since I have around 35000 tracks (mp3 and flac). That's unimportant. Getting the database into a consistent state is, clearly.

Thanks in advance, for any advice you can give.
Kodi x64 build (18.1 Git:20190224-nogitfound)
Arch Linux, KDE Plasma, kernel: Linux x86 64-bit version 4.19.27-1-lts
 
Reply
#24
Yeah, I can confirm that after several years untouched, my library is screwed up. Some shows was added as another show (like, in "Fringe" i'm seeing "House" episodes - btw, they were in "House" too)
After a LOT of work, I was able to reduce the problem: now it's showing a lot of duplicated entries. Definitely something with Gotham.

I have 2 video servers and 3 clients. I've shared the sources.xml and I'm using MySQL. Added all the network shares so everybody can access everything. All the shares are working, but if I add something as "Movie" or "TV Shows", the library is all wrong with duplicated entries.

Everything was working before Gotham.

Hoping this bug ticket is fixed in the next release (beta/rc/stable), and not only in XBMC 14..
Reply
#25
hi all,

I had this issue also. I am stream from OSX drives. I removed the sources and add AFT drive Vs Samba. My original lib was samba so it sees the new path AFP://1.1.1.1/video as a different one to the SMB://1.1.1.1/video as a different path.

Once I set the paths back to smb://xxxxxxxxxx it removed the duplicates


Hope this helps

EJ
Reply
#26
After getting my library finally whipped into shape I am coming across this same problem.

Here's what I DO know:
Library and database were wiped for a complete fresh start in Kodi, Kodi Roaming, and MySQL
All sources point to smb path on network. Not even host looks for files locally
All .nfo files erased and rescraped to be sure nothing accidentally pointed to a local location
After initial local scrape all media shows up and working 100%
Upon scanning new media after initial scan some shows that have nothing new added start to add files for their local path.
I.E.
SMB://1.1.1.1/TV/Archer (2009)/Season 01/1X01 - Pilot.avi
E:/TV/Archer (2009)/Season 01/1X01 - Pilot.avi

Nowhere in Kodi do I ask anything to look in the "E" drive, yet still it just does it anyways and adds "duplicates".
Cleaning won't work because both paths are correct. It just drives me crazy I can't find where it's even being told where to look.

The only "positive" is that all local networked machines have the media drives mapped to them as the exact same drive letter.
E: is mapped the same on all machines in local network, so the "duplicate" files work just the same as their original networked counterparts.

I can usually avoid the problem by scanning folders for new content as oppose to updating the library, but when you forget.......
Reply
#27
Any chance you are using automation software to tell Kodi to scan somewhere ?
Reply
#28
I'm using MediaBrowser to scrape, then it creates the .nfo files.
like in Kodi, Mediabrowser is also looking over network substitution paths.
I.E. E:\TV = Smb:\\1.1.1.1\TV
But I'm sure me using a 3rd party scraping service my problem has potential for any problem to occur Tongue
Reply
#29
The easiest way I have found to fix this is the following:

1. Remove your media folders from within XBMC
2. Rename your media folder(s) on your network drive
3. Clean the video library from within XBMC
4. When prompted to remove media in the paths, click Yes
5. Rename your media folder(s) on your network drive back to what you had them as (optional)
6. Setup your media folders in XBMC again

This fixed the issue for me without getting into the database and making changes.
Reply
#30
bgeneto, you sir are an absolute STAR!!!
This has been driving me mad for ages, your command cleared this up perfectly.
Why doesn't Kodi do this by default??
Reply

Logout Mark Read Team Forum Stats Members Help
Duplicate media entries in XBMC 0