Duplicates that won't disappear after cleaning library

  Thread Rating:
  • 0 Votes - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Post Reply
JeDaj Offline
Junior Member
Posts: 20
Joined: Sep 2010
Reputation: 0
Post: #1
Hello,
I have a Synology NAS where recently, I've swapped my old 1TB drives to new and shiny 3TB. I had two locations for my anime series on two different volumes named Anime and Anime2. After swapping the drives, I got rid of the second path and put everything into volume4/Anime. I've also changed sources and deleted non existing ones. The problem is, that some shows have duplicates episodes in it. Every episode of a show is listed twice, but after checking file info, it looks like one is on a path volume4/Anime and the other on volume4/Anime2. As I don't have volume4/Anime2 anymore I did "clean library" but that didn't do anything. My duplicates are still present. The best part is that, I can play both files. This looks like XBMC mistakes Anime and Anime2 into the same source. I don't know how this is possible.

My setup:
all files on Synology NAS
library is kept on SQL database on the same NAS
I'm using XBMC on my PC and RaspberryPi

What can I do to get rid of those duplicates?
find quote
dgcruzing Offline
Senior Member
Posts: 143
Joined: Oct 2012
Reputation: 1
Post: #2
There's probable a few ways.. But the one I use is..
Use phpmyadmin and manually delete the duplicate entries in the MySQL video database.
This Fix's it quick smart..

You can sort the database with source then do a Wipe of all those entries referenced to the old source...
find quote
JeDaj Offline
Junior Member
Posts: 20
Joined: Sep 2010
Reputation: 0
Post: #3
Ok. I did like you said. I've located old paths in "path" table. After launching xbmc duplicates disappeared. Thanks. Should I worry about any other table where those old entries might be?
find quote
dgcruzing Offline
Senior Member
Posts: 143
Joined: Oct 2012
Reputation: 1
Post: #4
Just check your sources file if you have it on multiple devices..also I found that by turning of auto scan library on other devices saves me from having to do it again as that seems to be where I run into problems.
find quote
JeDaj Offline
Junior Member
Posts: 20
Joined: Sep 2010
Reputation: 0
Post: #5
I have the same sources on both devices. I have manually edited them and got rid of old paths. Auto scan is disabled all the time as Pi takes a lot of time to scan so I manually scan library on my PC. I have found some more entries in other tables and deleted them. So far it's ok. Thank you for your help!
find quote
DBMandrake Offline
Senior Member
Posts: 221
Joined: Feb 2013
Reputation: 5
Location: UK
Post: #6
I had a similar problem a couple of days ago (lastest Raspbmc) where I changed my SMB source from hostname to IP address by going into the source and editing the path, eg from:

smb://mac-mini/VIDEO1/Video/Movies

to

smb://192.168.0.6/VIDEO1/Video/Movies

It's the same server with the exact same files on it, just accessing it by IP address instead of hostname. After editing the source (still only one source present) and scanning the Library everything is duplicated, and there is no easy way to get rid of the duplicate entries that were part of the original source path. (Clean library doesn't remove them)

It seems to be a bug such that when a source is EDITED instead of DELETED, all of the library entries for the "OLD" source are orphaned and retained and at the same time the edited source is treated as a "NEW" source which will scan for new "unique" entries which are actually duplicates of the old one. Although I haven't tested it, I suspect that DELETING the old source then adding the modified path as a new source (instead of editing the existing source) would avoid this problem, and that's what I'll do next time.

In the end I just deleted the MyVideos75.db database file and ran a fresh library scan as I didn't have time to delve into what went wrong. I've run into this problem a couple of times before when I was first starting out with XBMC and didn't really understand how the Library worked, now I'm more familiar with XBMC its clear its a bug so hopefully it's fixed in Gotham! (Haven't had a chance to check)
(This post was last modified: 2014-02-27 12:21 by DBMandrake.)
find quote
JeDaj Offline
Junior Member
Posts: 20
Joined: Sep 2010
Reputation: 0
Post: #7
That makes perfect sense. Looks like that the way to go is to do everything from xbmc instead of doing it manually in XML files. If I ever swap more disks in my synology I will try and confirm that. Well it doesn't look like it would happen in the near future but I'll try and remember that. One never know when the space on the rest of the disks will finish Smile

Thanks for sharing your case.
(This post was last modified: 2014-02-27 16:10 by JeDaj.)
find quote
DBMandrake Offline
Senior Member
Posts: 221
Joined: Feb 2013
Reputation: 5
Location: UK
Post: #8
(2014-02-27 16:09)JeDaj Wrote:  That makes perfect sense. Looks like that the way to go is to do everything from xbmc instead of doing it manually in XML files. If I ever swap more disks in my synology I will try and confirm that. Well it doesn't look like it would happen in the near future but I'll try and remember that. One never know when the space on the rest of the disks will finish Smile

Thanks for sharing your case.

To be clear when I say I edited the source - I did so through the GUI not directly editing XML files, but I think the effect is probably the same - a "new" source is seen but without entries belonging to the "old" source being removed properly from the database. If you are manually editing XML files to edit sources its probably best to first delete the source using the GUI and say yes to removing files from the Library that belonged to that source. Then add the modified version of the source back into your XML file or through the GUI.

Either way it seems that only when a source is deleted (not edited) through the GUI is the database properly cleaned up to remove old entries.
(This post was last modified: 2014-02-27 17:44 by DBMandrake.)
find quote
Ned Scott Offline
Team-XBMC Wiki Guy
Posts: 18,221
Joined: Jan 2011
Reputation: 219
Location: Arizona, USA
Post: #9
When you "set content" on a source then that source path is added to the database, and the file source is not really looked at anymore. There are some triggers that will update the database path, such as deleting a source and saying "yes" to the dialog box that pops up, but it's very easy for orphaned sources to exist in the DB that don't show in the GUI. I hope one day that this can be changed, because it's a very clunky way to manage the database paths. There's a separation between file sources and library sources.

You can make easy links to the XBMC wiki using double brackets around words: [[debug log]] = debug log, [[Add-on:YouTube]] = Add-on:YouTube, [[Adding videos to the library]] = Adding videos to the library, [[userdata]] = userdata, etc
find quote
dgcruzing Offline
Senior Member
Posts: 143
Joined: Oct 2012
Reputation: 1
Post: #10
My duplicates seem to come about by that naming convention to..
IP address verses the NAS network name.
Thus the duplicates appear.
I haven't had the ATV1200 hooked up to the bedroom network as yet to test it since I have upgraded to the Gotham builds..but will have a play over the coming weeks and see what happens.
But as said...by turning off auto lib updates on the "Save Clients" seems to cut it down for me..(on 12.0 builds)..
find quote