Kodi Community Forum

Full Version: Duplicate media entries in XBMC
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Pages: 1 2 3
Every time I add new media to XBMC two entries for each video file appearing my media library. I've researched the problem on this forum and on Google and the common cones seems to be that this error is occurring because there's two references to the each file but both coming from different media sources. One being a network location and one being a local drive location.

I've been through my Media Libray and every instance always points to the same location. Always to a network location on my local Media drive so he above problem doesn't really seem to apply.

My setup is XBMC Eden running on Ubuntu 12.04 i686 on an Acer Revo r3600.

I have XBMC setup so that the Media Library goes to a local copy of MySQL which is then shared with another copy of XBMC on a computer in a different room. This also means that all of the sources in my sources.xml file refer to an SMB location. This is so that every computer that has access to XBMC and the MySQL media library can access the files over the network.

Anyone got any ideas where the duplicate entry for every media file is coming from or how to get rid of it?
I don't know for sure, but have you tried cleaning your library? It may be that old references are hanging around.
Looks in your database itself. There'll be at least 2 paths referenced for the same files (i.e. check idFile for duplicate movies, follow those to the file table, then follow that to the path table.
(2012-08-13, 03:06)jmarshall Wrote: [ -> ]Looks in your database itself. There'll be at least 2 paths referenced for the same files (i.e. check idFile for duplicate movies, follow those to the file table, then follow that to the path table.

Thanks jmarshall. I've managed to track down the duplicate entry using the method you suggested. It turns out that there's two media in the database both using SMB but one that contains the Username and Password in the SMB path and one that doesn't. Hence the duplicate entry problem.

I've checked in the sources.xml and mediasources.xml and there's only the reference to the SMB path that contains the Username and Password in it.

I would have thought because there's no source reference to the SMB path without the login details then when running Settings>Video>Clean Up Library would have removed the duplicate entries?

Is there any other files I need to check where the duplicate SMB path without the login details maybe. Or is there an MysSQL query that can be run to remove all the entries that refer to the SMB path that contains no login details?

If you have a passwords.xml file it uses path substitution to add a password to your sources, check and see if you have it on one machine and not the others.

Mike
(2012-08-14, 23:28)Dilligaf Wrote: [ -> ]If you have a passwords.xml file it uses path substitution to add a password to your sources, check and see if you have it on one machine and not the others.

Mike

Hi Mike

I've got a passwords.xml file on the same machine where the MySQL database server resides. It has both the SMB path saying it should be substituded with the SMB path that has the login details in it. Should I just remove this file?
Yes, remove the password file, if you ned user and pass to access your shares add them to sources.xml. See the wiki for the format. If you do edit sources.xml make sure to copy it to ALL clients to avoid duplicates. Or you could copy passwords.xml to ALL clients effectively having he same affect
(2012-08-15, 19:33)Dilligaf Wrote: [ -> ]Yes, remove the password file, if you ned user and pass to access your shares add them to sources.xml. See the wiki for the format. If you do edit sources.xml make sure to copy it to ALL clients to avoid duplicates. Or you could copy passwords.xml to ALL clients effectively having he same affect

So I've removed the passwords.xml file and made sure that the sources.xml file is identical across all machines.

I've now run the Clean Up Library function in Settings but it doesn't seem to have removed any of the duplicate entries unfortunately. However some new media that I've placed on the machine --once it had been scraped is only showing up as one single video. This seems to be the correct behaviour for any new items added to the media library. Its just now about getting the old duplicate entries removed?
Hi there.
So I had the same problem as juliushibert.
For some reason, (me), the path to my network drive had been added twice, and so EVERYTHING was duplicated in XBMC.

Solution; First I did what jmarshall sugested.
(2012-08-13, 03:06)jmarshall Wrote: [ -> ]Looks in your database itself. There'll be at least 2 paths referenced for the same files (i.e. check idFile for duplicate movies, follow those to the file table, then follow that to the path table.

Edit: I then exported my video library. Looked in the xml file, and found the duplicate entries for the remote path. Deleted them, saved, and imported the library.


Found the duplicate rows in 'path' tabel of XBMC DB
e.g. SELECT * FROM 'path' WHERE strPath LIKE "%yadayada%";
and then simply delete the one without user:[email protected]HOST. Afterwards go to XBMC and clean the library.
Apparently this wonderful piece of software will then "repair" the DB(i.e. delete the corrosponding entries in tables "movies" & "file").

I realise this is not a very elegant solution. In fact it is extremly crude. But it did work for me Smile

Peace
Quote:Found the duplicate rows in 'path' tabel of XBMC DB
e.g. SELECT * FROM 'path' WHERE strPath LIKE "%yadayada%";
and then simply delete the one without user:[email protected]HOST. Afterwards go to XBMC and clean the library.
Apparently this wonderful piece of software will then "repair" the DB(i.e. delete the corrosponding entries in tables "movies" & "file").

I realise this is not a very elegant solution. In fact it is extremly crude. But it did work for me Smile

It feels like taking an axe to a wood carving course but it worked like a charm on my database.

FYI: I switched from smb to nfs shares and for some reason XBMC kept indexing old smb folders resulting in loads of duplicate entries; its odd how the cleanup seems to miss those things...

i tried a lot of these solution none of them worked for me so i tried to fix it my way and i found a easy way to fix this problem.

1 - close XBMC
2 - goto c:\users\*username*\AppData\Roaming\XBMC\userdata\Database
3 - delete the MyVideos** file

4 - start XBMC (You will see all movies in Libary are gone)
5 - goto Video and add all the sources where your movies are in your network again like starting from scratch..
6 - Update Libary

and my problem was solved.

Hope this will help some of you as well !!

One tip backup the old MyVideos** file in case you get problems doing it this way, As soon as you restore the old file your old libary (with duplicates) is back
Unfortunately, this fix didn't work for me, or rather.. worked TOO well.

For some reason, the MyVideos?? database also contains information about sources - as soon as I scrubbed this database, my sources still existed under "Videos" but details of *what* they contained was missing. I had to edit the sources and flick them over to TV/Movies/Music videos again.

I've also noticed that when editing a source, just something simple as renaming the path or the display name causes the scraper information to be lost.. is this right? It's as if it can't remember what media content or scraper it was previously using and needs to start all over again.
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?
Another example, even more strange since all three entries point to the same directory.

Code:
INSERT INTO `movie` (`idMovie`, `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`, `idSet`) VALUES
(228, 228, 'Bröllopsfotografen', 'Robin är bröllopsfotografen från hålan i Värmland som får uppdraget att plåta ett överklassbröllop i Djursholm. Han förälskar sig i brudens syster och försöker göra om sig för att passa in i den fina världen. Det går väl så där?', '', '', '', '7.000000', '', '2009', '<thumb preview="http://images.themoviedb.org/posters/120296/Brollopsfotografen_mid.jpg">http://images.themoviedb.org/posters/120296/Brollopsfotografen.jpg</thumb>', '', '', '6480', '', '0', 'Comedy', 'Ulf Malmros', '', '', 'BOB Film Sweden AB', '', '<fanart><thumb preview="http://images.themoviedb.org/backdrops/102474/Brollopsfotografen1_poster.jpg">http://images.themoviedb.org/backdrops/102474/Brollopsfotografen1.jpg</thumb><thumb preview="http://images.themoviedb.org/backdrops/102477/Brollopsfotografen2_poster.jpg">http://images.themoviedb.org/backdrops/102477/Brollopsfotografen2.jpg</thumb><thumb preview="http://images.themoviedb.org/backdrops/102483/Brollopsfotografen3_poster.jpg">http://images.themoviedb.org/backdrops/102483/Brollopsfotografen3.jpg</thumb></fanart>', '', '/media/mistik_shared/HD/Brollopsfotografen.2009.SWEDiSH.REPACK.720p.BluRay.x264-BRiS/', '400', NULL),
(229, 229, 'Bröllopsfotografen', 'Robin är bröllopsfotografen från hålan i Värmland som får uppdraget att plåta ett överklassbröllop i Djursholm. Han förälskar sig i brudens syster och försöker göra om sig för att passa in i den fina världen. Det går väl så där?', '', '', '', '7.000000', '', '2009', '<thumb preview="http://images.themoviedb.org/posters/120296/Brollopsfotografen_mid.jpg">http://images.themoviedb.org/posters/120296/Brollopsfotografen.jpg</thumb>', '', '', '6480', '', '0', 'Comedy', 'Ulf Malmros', '', '', 'BOB Film Sweden AB', '', '<fanart><thumb preview="http://images.themoviedb.org/backdrops/102474/Brollopsfotografen1_poster.jpg">http://images.themoviedb.org/backdrops/102474/Brollopsfotografen1.jpg</thumb><thumb preview="http://images.themoviedb.org/backdrops/102477/Brollopsfotografen2_poster.jpg">http://images.themoviedb.org/backdrops/102477/Brollopsfotografen2.jpg</thumb><thumb preview="http://images.themoviedb.org/backdrops/102483/Brollopsfotografen3_poster.jpg">http://images.themoviedb.org/backdrops/102483/Brollopsfotografen3.jpg</thumb></fanart>', '', '/media/mistik_shared/HD/Brollopsfotografen.2009.SWEDiSH.REPACK.720p.BluRay.x264-BRiS/', '400', NULL),
(502, 3838, 'Bröllopsfotografen', 'Robin är bröllopsfotografen från hålan i Värmland som får uppdraget att plåta ett överklassbröllop i Djursholm. Han förälskar sig i brudens syster och försöker göra om sig för att passa in i den fina världen. Det går väl så där?', '', '', '3', '6.800000', 'Ulf Malmros', '2009', '<thumb aspect="poster" preview="http://cf2.imgobject.com/t/p/w500/hWtFglZsQ5qdMhNlMXUlFm3DVqm.jpg">http://cf2.imgobject.com/t/p/original/hWtFglZsQ5qdMhNlMXUlFm3DVqm.jpg</thumb>', 'tt1359421', '', '6480', '', '0', 'Comedy', 'Ulf Malmros', 'Bröllopsfotografen', '', '', 'plugin://plugin.video.youtube/?action=play_video&videoid=chq7BgjTvEo', '<fanart><thumb preview="http://cf2.imgobject.com/t/p/w780/dfktYwqXnJiFTENnpSUhwo9K58a.jpg">http://cf2.imgobject.com/t/p/original/dfktYwqXnJiFTENnpSUhwo9K58a.jpg</thumb><thumb preview="http://cf2.imgobject.com/t/p/w780/rLDigRrgERZvLuOXDIqevWRWXS5.jpg">http://cf2.imgobject.com/t/p/original/rLDigRrgERZvLuOXDIqevWRWXS5.jpg</thumb><thumb preview="http://cf2.imgobject.com/t/p/w780/N4SrRNjAMYIeLDP4syrUOzkRYy.jpg">http://cf2.imgobject.com/t/p/original/N4SrRNjAMYIeLDP4syrUOzkRYy.jpg</thumb></fanart>', 'Sweden', '/media/mistik_shared/HD/Brollopsfotografen.2009.SWEDiSH.REPACK.720p.BluRay.x264-BRiS/', '400', NULL);[/code]

Edit: One of these was becuase the movie was also unpacked. So both rar and mkv.
I also have begun to see duplicate entries. I'm using a shared library and running 12.3 on a Mac, under Raspbmc and Crystalbuntu. The duplicates only began to show up within the last month or so. Not every media file is duplicated; only a few TV shows.

I have not made any changes in the last few years to the media source files or to the sources data on any of the XBMC installations.

For example, The Daily Show with Pele exists as only one media file, but two identical library entries:

Code:
<filenameandpath>nfs://192.168.0.75:2049/Volumes/Media/TV/The Daily Show with Jon Stewart/The.Daily.Show.2014.04.03.Pele.HDTV.x264-BATV.mp4</filenameandpath>

<filenameandpath>nfs://192.168.0.75:2049/Volumes/Media/TV/The Daily Show with Jon Stewart/The.Daily.Show.2014.04.03.Pele.HDTV.x264-BATV.mp4</filenameandpath>

Note that the file paths are identical.

Here's what the source directory looks like:

Code:
Bleach:The Daily Show with Jon Stewart mnewman$ ls -lea
total 617592
drwxrwxrwx   6 mnewman  staff        204 Apr  9 15:50 .
drwxrwxrwx  58 mnewman  staff       1972 Apr  4 07:32 ..
[email protected]  1 mnewman  staff       6148 Dec 13  2012 .DS_Store
[email protected]  1 mnewman  staff  166749479 Apr  4 23:02 The.Daily.Show.2014.04.03.Pele.HDTV.x264-BATV.mp4
[email protected]  1 mnewman  staff  149440162 Apr  8 23:56 The.Daily.Show.2014.04.07.Matt.Taibbi.HDTV.x264-CROOKS.mp4
-rwxrwxrwx   1 mnewman  staff         46 Aug 31  2010 tvshow.nfo

Note that there is only one Daily Show with Pele.

Cleaning the library does not fix this.
Pages: 1 2 3