• 1
  • 17
  • 18
  • 19(current)
  • 20
  • 21
  • 40
HOW-TO:Share libraries using MySQL: Wiki Edition
C:\Users\DG-Home\AppData\Roaming\Kodi\userdata is the correct location

special://xbmc/system/advancedsettings.xml is the "system" advancedsettings

special://profile/advancedsettings.xml is the userdata advancedsettings, the error indicates some sort of formatting error in the file, try opening and editing it with Notepad ++ paying particular attention to the opening and closing tags
If I have been of help, please add to my reputation as a way of saying thanks, it's free.
Reply
So I'm having an issue with my deployment of MySQL.

After getting a second Amazon Fire TV box, I felt that implementing MySQL for my Db was the next logical step, so that both devices can share the same libraries and watch statuses.

Before even unboxing the second device, I thought I'd get the original device configured to exactly how I wanted things to look and function. Let's call this device 'Main'.
On 'Main', I completely started over with my Kodi deployment. I uninstalled Kodi, then installed a fresh copy of Kodi 14.2, proceeded to installing my skins (eminence and Arctic:Zephyr), and configured everything to my liking, including adding the sources to my media files via SMB/Windows Network.
I then followed the MySQL wiki guide, using the option to start with fresh library scans instead of exporting and importing the current library. Once MySQL was installed according to the guide and the advancedsettings.xml file was loaded into Main's Kodi, my video and music libraries were scrapped, and all appeared good. Thinking everything was ok, I performed a Backup of Main's Kodi implementation.

Now came time to unbox, set up and configure device number two, which I'll call 'Bedroom'
Having already spent hours configuring, tinkering, then backing up Main, I took the backup of Main and 'restored' it to Bedroom. This included all configuration settings, and all files in userdata (sources.xml, passwords.xml, advancedsettings.xml, etc). Device Bedroom now seemed like an identical clone of device Main. I did notice that after restarting Bedroom for the first time, that the libraries went through the update process and seemed to be getting scrapped, which I didn't think was a big deal; I assumed that Bedroom was simply connecting to the MySQL Db.

After a couple of days of playing with my deployments, I believe I initially did something wrong, overlooked something, or missed some step(s).
After the deployment of device Bedroom (and the updating/scrapping that I mentioned above), it appears that my Movies, TV Shows, and Songs libraries doubled in count. For example, when I navigate to TV Shows, episodes are listed twice; one file instance displays the watched status, while the second file instance appears unwatched. For a TV Show that in reality has only 10 episodes, Kodi is displaying the show as containing 20 episodes.

Knowing that I could not be the only noob to have experienced this, I came to this thread and read through 18 pages of posts within this thread. Gathering information I thought would help my situation, I proceeded to take some actions. Knowing that I want device Main to be my primary device that will be used for scrapping and managing my libraries, I did not take any actions (yet) to device Main. On the secondary, client device, I did the following:
  • Navigated to my video and music sources, and deleted all sources. Now the sources.xml file on Main differs from that of Bedroom.
  • Within the Settings>Videos and Settings>Music, I turned off 'update at startup'
  • Cleaned the video and music libraries

Now device Bedroom does not seem to be in sync with device Main.

Sorry for such a long winded post. Does anyone have any recommendations on what can be done to get back in sync, and get my deployment to function as expected? If it means making any configuration/settings modifications, I'm all for it. If it calls for me to totally start over from scratch on device Bedroom, I'm open to that.

Are there any configuration files or Db files on device Bedroom that should be deleted, or modified to differ from device Main?

Any help and guidance will be greatly appreciated.
Reply
Go to the duplicate files in Kodi right click/contextmenu>information and check the path to the file, compare the path to the path for the duplicate, What is the difference between the two?
If I have been of help, please add to my reputation as a way of saying thanks, it's free.
Reply
Maybe on bedroom if you had removed the advancedsettings.xml file before starting Kodi and then started Kodi and removed the sources you would have been ok. You might have needed to clean the library on bedroom too.

What you did was created 2 sources AND one is the Mysql data and one is the bedroom data on the bedroom device. I made this mistake and ended up deleting the entire mysql data while on the bedroom device because advancedsettings.xml was still present on bedroom. You can just rename advancedsettings.xml to something else. I just change the extension from xml to bak. Kodi doesn't see it then.

Make sure you have port 3306 or what ever port you use open on your router too.
Reply
(2015-02-20, 17:49)flhthemi Wrote: Maybe on bedroom if you had removed the advancedsettings.xml file before starting Kodi and then started Kodi and removed the sources you would have been ok. You might have needed to clean the library on bedroom too.

What you did was created 2 sources AND one is the Mysql data and one is the bedroom data on the bedroom device. I made this mistake and ended up deleting the entire mysql data while on the bedroom device because advancedsettings.xml was still present on bedroom. You can just rename advancedsettings.xml to something else. I just change the extension from xml to bak. Kodi doesn't see it then.

Make sure you have port 3306 or what ever port you use open on your router too.

Thank you for the reply, but I'm not following what I should do next....

Are you recommending that I do something with the advancedsettings.xml file on device Bedroom? I thought that file was needed to point Kodi to use MySQL for the libraries Db and not use the local Db?
Reply
Post both paths and the contents of sources.xml (wiki) on the main and bedroom PCs
If I have been of help, please add to my reputation as a way of saying thanks, it's free.
Reply
(2015-02-20, 17:58)DruTheFu Wrote: Thank you for the reply, but I'm not following what I should do next....

Are you recommending that I do something with the advancedsettings.xml file on device Bedroom? I thought that file was needed to point Kodi to use MySQL for the libraries Db and not use the local Db?

Heres what *I* would do, might not be what some would say is correct or the right way but it works for me...


1) On bedroom remove (cut and paste to another folder) or rename advancedsettings.xml do not delete it. Just rename it or move it out of the folder it's in.
2) NOW start Kodi on bedroom
3) Check bedroom for sources. There should be no movies/video/music to play. If there are then you have file sources and they need to be removed from Kodi on bedroom.
a - It would probably be a good idea to clean the library (video and music) on bedroom once you have removed all the sources
4) Once file sources are determined to NOT be on bedroom exit Kodi
5) Cut and paste/rename advancedsettings.xml back to bedroom's appropriate folder BUT DO NOT Start Kodi
6) Check Main for a correct advancedsettings.xml
7) If it is correct start Kodi on Main
8) See if there are movies/video/music available for it to play
9) If there is media start Kodi on bedroom

You should now have access to the mysql info with no duplicates on bedroom

If you still don't then open the mysql cmd window, login to mysql and check to see if the MyMusic48 and MyVideos90 databases exist. (the command "display databases;" no quotes)
They should be there if you've done it all correctly. They get created as soon as you start Kodi on a machine that has media sources and has a proper install of MySql and proper advancedsettings.xml file in the proper place.
Reply
flhthemi: thanks for the recommended steps, I will try this later today and see how it goes. After deleting all video and music sources from within the Kodi interface on device Bedroom, would I also delete the sources.xml file within the userdata directory on device Bedroom, or leave that intact?

So pretty much, client device two (Bedroom) should not have any sources configured for libraries?

Adding on to this, what 'scraper' and 'update library' settings should be configured within Settings>Videos>Libraries and Settings>Music>Libraries on the second client device Bedroom? If myb Main device will be configured for scrapping and updating the library, what settings would I modify on client device Bedroom to avoid any duplication of effort or conflicts?

Thanks again
Reply
You shouldn't have to delete that, I've not had to. Pretty sure it'll get changed by removing the sources within Kodi.

Share the music from main to bedroom just make sure bedroom has no music sources. Thats how mine is working.

In the future, after its all working, don't use the entire "Main" Kodi folder as a back up for the bedroom or you'll get the sources file from it and might have dupes again. Like, today I just got another Zbox. I'm installing Kodi on it and will copy the Kodi folder from it to the new one. Then they'll be the same. No need to worry about anything as the 1st Zbox is NOT a server to the system. If it WAS the server, and if I copied Zbox 1s kodi folder to Zbox 2, I would NOT start Kodi on Zbox 2 with the advancedsettings.xml file until I started it WITHOUT it so as to make sure there will be no sources on Zbox 2. Follow that?
Reply
Why isn't there a video tutorial for this yet? Seems like a 15min video would save a bunch of people trouble and time...

On my host machine, my advanced settings are as followed:

Code:
<advancedsettings>
  <splash>false</splash>
  <imageres>720</imageres>
  <fanartres>1080</fanartres>
  <useddsfanart>true</useddsfanart>
    <videodatabase>
        <type>mysql</type>
        <host>192.168.1.3</host>
        <port>3306</port>
        <user>kodi</user>
        <pass>kodi</pass>
    </videodatabase>
    <video>
        <usetimeseeking>true</usetimeseeking>
        <timeseekforward>60</timeseekforward>
        <timeseekbackward>-10</timeseekbackward>
        <timeseekforwardbig>600</timeseekforwardbig>
        <timeseekbackwardbig>-180</timeseekbackwardbig>
    </video>
    <videolibrary>
        <recentlyaddeditems>50</recentlyaddeditems>
        <importwatchedstate>true</importwatchedstate>
        <importresumepoint>true</importresumepoint>
    </videolibrary>
    <network>
        <buffermode>0</buffermode>
        <cachemembuffersize>524288000</cachemembuffersize>
        <readbufferfactor>20</readbufferfactor>
        <curlclienttimeout>45</curlclienttimeout>
    </network>
    <gui>    
        <algorithmdirtyregions>3</algorithmdirtyregions>
        <nofliptimeout>0</nofliptimeout>
    </gui>
    <videoscanner>
        <ignoreerrors>true</ignoreerrors>
    </videoscanner>
</advancedsettings>

My sources:

Code:
<sources>
    <programs>
        <default pathversion="1"></default>
    </programs>
    <video>
        <default pathversion="1"></default>
        <source>
            <name>Movies</name>
            <path pathversion="1">smb://STREAM-PC/Kodi Add-On Library/Movies/</path>
            <allowsharing>true</allowsharing>
        </source>
        <source>
            <name>PlayOn</name>
            <path pathversion="1">upnp://f9124d2b-b362-4d3c-89c8-ed0c02b4b409/</path>
            <allowsharing>true</allowsharing>
        </source>
        <source>
            <name>1Channel TV</name>
            <path pathversion="1">smb://STREAM-PC/Kodi Add-On Library/1CTV/</path>
            <allowsharing>true</allowsharing>
        </source>
        <source>
            <name>Ongoing TV Shows</name>
            <path pathversion="1">smb://STREAM-PC/Kodi Add-On Library/Ongoing TV Shows/</path>
            <allowsharing>true</allowsharing>
        </source>
    </video>
    <music>
        <default pathversion="1"></default>
    </music>
    <pictures>
        <default pathversion="1"></default>
    </pictures>
    <files>
        <default pathversion="1"></default>
        <source>
            <name>Fusion</name>
            <path pathversion="1">http://fusion.tvaddons.ag/</path>
            <allowsharing>true</allowsharing>
        </source>
        <source>
            <name>Xunity</name>
            <path pathversion="1">http://xfinity.xunitytalk.com/</path>
            <allowsharing>true</allowsharing>
        </source>
        <source>
            <name>Repositories</name>
            <path pathversion="1">C:\Users\Stream\Videos\Kodi Add-On Library\Repositories\</path>
            <allowsharing>true</allowsharing>
        </source>
        <source>
            <name>SuperRepo</name>
            <path pathversion="1">http://srp.nu/</path>
            <allowsharing>true</allowsharing>
        </source>
        <source>
            <name>Emulators</name>
            <path pathversion="1">C:\Users\Stream\Videos\Kodi Add-On Library\Emulators\</path>
            <allowsharing>true</allowsharing>
        </source>
        <source>
            <name>Cinema Experience</name>
            <path pathversion="1">smb://STREAM-PC/Kodi Add-On Library/Cinema Experience/</path>
            <allowsharing>true</allowsharing>
        </source>
    </files>
</sources>

On the host machine, I can see all of my media in Kodi just fine. I copied my sources and advanced settings XML to a test PC (my gaming PC) that is also running Helix 14.1. The sources show up, but I can't scan them into the library. If I play a video on my test PC, mysql hovers around 20% CPU usage on my host PC. It's definitely working. I just don't know why I can't scan anything into the library. The pause/resume feature doesn't seem to be working either.

Could it be because Kodi on my host PC is the DSPlayer version? They're both 14.1 and have the same DBs, but the Git numbers are different.
Reply
I am trying to figure out how to get all the US channels. Every URL that I use just has a few US Channels that work and a bunch that doe not work. I am also trying to get a good url to make by channel guide work with logos. Can anyone help?
Reply
(2015-02-20, 23:28)flhthemi Wrote: You shouldn't have to delete that, I've not had to. Pretty sure it'll get changed by removing the sources within Kodi.

Share the music from main to bedroom just make sure bedroom has no music sources. Thats how mine is working.

In the future, after its all working, don't use the entire "Main" Kodi folder as a back up for the bedroom or you'll get the sources file from it and might have dupes again. Like, today I just got another Zbox. I'm installing Kodi on it and will copy the Kodi folder from it to the new one. Then they'll be the same. No need to worry about anything as the 1st Zbox is NOT a server to the system. If it WAS the server, and if I copied Zbox 1s kodi folder to Zbox 2, I would NOT start Kodi on Zbox 2 with the advancedsettings.xml file until I started it WITHOUT it so as to make sure there will be no sources on Zbox 2. Follow that?

So I've cleared all video and music sources from device Bedroom, and even went as far as deleting all the contents of the sources.xml file except "<sources></sources>" . I then cleaned the library, restarted Kodi, and cleaned the libraries again. BUT, I'm still seeing some movies and tv shows displaying and accessible. The only thing I can think of is that device Bedroom is still claiming libraries are present based on menu shortcut custom actions that point to an SMB drive (i.e. "ActivateWindow(Videos,smb://path,return)" )...but there are no 'sources' so to speak present.

Prior to re-adding the advancedsettings.xml file back to device Bedroom, I am clearing content and resetting content on all library sources on device Main, which is forcing a re-scrape of my media files . I'm hoping this will help do the trick.

What source related settings, scrapper related settings, and update related settings should be different from what is considered the Main/Server device (that performs the updates and scrapping to the MySQL Db) and the Client device(s)?
Reply
@DruTheFu: Nobody can say without seeing the urls of some of these "duplicates". Find a movie (or tv episode) for which you have multiple library entries, and post the *exact* urls of each movie/episode entry. If you've got Apple gear in your network, see this thread.

Also, post a debug log (wiki) from the bedroom device (it will include your advancedsettings.xml) and also the sources.xml you say you are using on both your boxes.

I run several clients with a central MySQL, and as long as your media library/filesystem is clean and not full of Apple generated garbage, you should not have duplicates when using the same advancedsettings.xml/sources.xml on all clients. Your problem is almost certainly down to something else in your network, or a misconfiguration. Show us your log/XML files, and examples of duplicates and it should lead to a speedier resolution to your problem.
Texture Cache Maintenance Utility: Preload your texture cache for optimal UI performance. Remotely manage media libraries. Purge unused artwork to free up space. Find missing media. Configurable QA check to highlight metadata issues. Aid in diagnosis of library and cache related problems.
Reply
(2015-02-20, 16:33)Dilligaf Wrote: C:\Users\DG-Home\AppData\Roaming\Kodi\userdata is the correct location

special://xbmc/system/advancedsettings.xml is the "system" advancedsettings

special://profile/advancedsettings.xml is the userdata advancedsettings, the error indicates some sort of formatting error in the file, try opening and editing it with Notepad ++ paying particular attention to the opening and closing tags
Thanks will look into it..
Yes always use notepad++ for edit config files..

What has got me stumped is the other 4 android machines are picking it up fine and I have just used one of them to populate the database on the synology.

Those machines are behaving as they should with watched flags working and correct reporting of movies and TV shows from the database..

Usually its the win HTPC that is the stable one..but for this upgrade it seems to be role reversal...

Will report back once I get time to play with it..
Reply
(2015-02-21, 00:28)RamboUnchained Wrote: Why isn't there a video tutorial for this yet? Seems like a 15min video would save a bunch of people trouble and time...

Wow.. while providing your setup file is a good thing.. shooting your fingers off with a statement like that is opening yourself for a flaming..
Youtube is your friend and in fact there is some great videos made for different NAS DB setups.. People just need to find them..

K..going back to Duplicates.. Had trouble with these before as well. and found the quickest way for me to deal with them was to use a DB editor to delete the offending entries out of the DB directly..
then with the Master/Slave principle in mind..
Main HTPC (Master)is setup as the scraper and only ever us it to do this job..
But over time even that has been taking over by third party programs.. Thus its set to only use local info.

Local info : My preferred is Media Center Master and Tiny Media Manager are both my Database\artwork managers for Movies and TVshows (Music is another story)
I find I have got more control over what is happening to what is being populated in to the DB.

Going in to the fresh setup I have just done..
I found that I had to do a quick refresh of the sources and all machines for them to show up thumbs and the correct numbers for everything.. but they are all working fine.. most are on 14.2 now (4x Android machines around the house)..
As to HTPC.. need to spend some time on it as per the posts just been made.. but I am sure it will come around and join the happy little party the others are having..
Reply
  • 1
  • 17
  • 18
  • 19(current)
  • 20
  • 21
  • 40

Logout Mark Read Team Forum Stats Members Help
HOW-TO:Share libraries using MySQL: Wiki Edition2