Database Editing
#1
Exclamation 
Hi Guys,

I've been through the forums and to the best of my knowledge i cannot see any definate answers to this.

I currently use AEON in showcase mode for file listing (so i get the fan art etc)

I do this because i am not happy with the multiple genre's entered in the DB for my movies.. I don't like the fact there are soo many genres and my movies will show up in multiple depending on the scraper used.

My question is, what's the best way for me to edit the XBMC DB to reduce this to 1 Genre per movie? I've read all about NFO files etc and i really don't want to go down that route. I don't like the mess it creates in my media folders.

I really do want to use the library so i can make use of all it's features.. but this one little niggle is putting me off!

I've managed to view the DB contents in SQLite but can't see how to actually edit the entries.. Can i export the contents to Excel for example and then import it back in?
Reply
#2
you edit the contents using .. drum roll... sql queries....
Reply
#3
ok.. maybe i worded my question badly.. I'm asking if there is an application i can use to do this without using SQL queries.. a windows version of something similar to PHPMyAdmin for MySQL databases..
Reply
#4
You could always use XBMC's export video library function then its very easy to do what you want in any text editor as its just an xml, then just remove your MyVideos34.db and import your edited videodb.xml Shocked
Reply
#5
What X said, or maybe try looking here for an app to manage/edit a sqlite database
Reply
#6
I'm using the SQLite Database Browser to manually edit the db files if I need to. Works without any issues - just make sure you don't use XBMC and the application at the same time because they block each others access to the database. Any always create a backup before working on your Database Wink
Reply
#7
Perfect guys, thanks very much.
Reply
#8
I thought it would be helpful to point you guys to SQL Administrator:

http://sqliteadmin.orbmu2k.de/

So far this is the easiest way to update the XBMC database (helped lots when I had to migrate all my media to a new server, which is always a headache and usually takes forever with SQL queries)

Make sure you backup your database before you try to do this, so if you screw something up you can go back and do it again.

Anyway, simply open your database with SQL Administrator, select the table you want to edit (in my case that was "Path") then go to "Data" and export as CSV which you can open with your favorite spreadsheet editor. From there you can add whatever info you need to add or a simple find/replace like in my case, since I just needed to update the paths to the new server.

After you're done just save your changes and let's go back to SQL Administrator. On the left pane double click on the index for the table you're working on (again in my case it was "ix_path") and uncheck the "Unique" box. Click on "Edit" and now go to "Data", "Import Data", "Open File" and select the CSV file you just worked on. Now enter the separator character (the program has ";" by default but you need to replace it with a comma "," Press ok, then "yes"

Now click on "Target Table" and select your table, check the "clear table before import" box if you want to replace contents, or if you're adding info to the table, just leave it unchecked. Now, you should have two columns with "Source Fields" and "Target Fields" match the field names on both columns, click on "Import data" and wait until it finishes. The contents of the database will be saved automatically and you're done!

Hope this helps Smile
Reply
#9
This is specifically desgined for XBMC, I take no responsibility of the results though.
http://forum.xbmc.org/showthread.php?tid...t=xbmc+nfo
Always read the XBMC online-manual, FAQ and search the forum before posting.
Do not e-mail XBMC-Team members directly asking for support. Read/follow the forum rules.
For troubleshooting and bug reporting please make sure you read this first.
Reply
#10
(2009-09-23, 03:42)ccMatrix Wrote: I'm using the SQLite Database Browser to manually edit the db files if I need to. Works without any issues - just make sure you don't use XBMC and the application at the same time because they block each others access to the database. Any always create a backup before working on your Database Wink
I transferred the library MyVideo93.db from my Windows build to my RPi3 running openelec = Linux. However it doesn't work due to the path information of the files. In Windows the path starts with 'Z:\mymovies' and I'd need to change that to 'smb://192.168.1.103:445/mymovies'. I tried that with SQLiteExplorer but I haven't got the faintest idea on how to achieve that. No idea which command to use or even where to put it, neither in how to save the modified database afterwards.

Any detailed step-by-step help would be very much appreciated.
Reply
#11
@derwildemann

Editing the database is not for the feint hearted. If you don't know what you are doing, (and you obviously don't) then do not touch it. Of course you can do whatever you want on your own equipment, but you will find you will get little support here if you mess it up.

What is the reason for transferring the database file between machines?

You would be better off just using the Import Export function. Your case scenario is exactly what it is used for. See the link in my signature. Use the Separate Files method.
My Signature
Links to : Official:Forum rules (wiki) | Official:Forum rules/Banned add-ons (wiki) | Debug Log (wiki)
Links to : HOW-TO:Create Music Library (wiki) | HOW-TO:Create_Video_Library (wiki)  ||  Artwork (wiki) | Basic controls (wiki) | Import-export library (wiki) | Movie sets (wiki) | Movie universe (wiki) | NFO files (wiki) | Quick start guide (wiki)
Reply

Logout Mark Read Team Forum Stats Members Help
Database Editing0