Kodi Community Forum

Full Version: Tip - How to remove phantom sources that aren't in sources.xml
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
(I'm posting this in the OS independent forum because this is a database "fix" so it should work with any OS.)

When I deleted a TV show or movie from my library, it would reappear every time I updated my library. When I clicked "i" (info), it shows a path that shouldn't be listed as a source. When I looked at my sources.xml file, the source/path isn't listed. Deleting my library and starting over might have fixed it, but I didn't want to do that; my library is just way too complicated with way too many sources.

Anyway, if you have this problem, all you need to do is open your My Videos database file (in my case, on my windows machine, it is %APPDATA%/Kodi/userdata/Database/MyVideos93.db) find the "path" table and delete all of the paths that shouldn't be there. That's it.

For me, since I'm on a windows machine, this meant installing a program called "DB Browser for SQLite", clicking "open", navigating to the .db file above, selecting "Browse Data", Selecting "Path" at the "Table:" dropdown and then clicking the "path" header so that the paths would be listed alphabetically. Then I just highlighted them and click "delete record". I actually found quite a few redundant/bad source directories so now my library update takes about half the time.

Now, for some reason I got a missing file error when I went to run Kodi again so I just reinstalled it. I've only been using Kodi for about a week so that part was no biggie because reinstalling doesn't mess with your library.

I'm sure there's a better way to do this but since I have zero knowledge of how databases actually work this is how I did it. Maybe someone reading this who knows more could come up with a simple command line that'll do the same thing or maybe make an add-on that can browse/delete the sources directly. I know when searching for this problem I didn't find a solution other than "start over".

Hope this helps.
You can also simply re-add the "phantom source" and immediately delete it again, and when it asks to remove all of the paths with that source in the library, choose yes.
It's even in the wiki ;)

phantom sources (wiki)
Look at Ned and his proper sourcing of things!
I realise this is a really old post, but it seems the right place to ask... how do I remove (without having to actually edit the database) a phantom source when I can't re-add it in the GUI? i.e. the actual network location is now physically gone, server was removed, TV moved to new location, cannot re-add same network location, etc.

Edit: Apparently you can add missing network sources, even if they no longer exist. It just says "Can't connect, add anyway?". Then you can remove it again, making sure to select "Yes" at the "Do you want to permanently screw up your database and why on earth is this even an option that you're prompted for, or would you like to also remove this source from your database?" prompt.