Jump to content

Kodi Plugin + MySQL?


totalhavoc
Go to solution Solved by mellomade,

Recommended Posts

totalhavoc

Years ago I stopped using MediaBrowser in favor of Kodi with a MySQL backend for all my clients databases. A few years later I went back to MediaBrowser. And, now I run Emby with Kodi. Right now each client syncs to their own local DB files. My questions is, can I go back to using a central MySQL server for the databases? That way when one client updates the database, all clients are up to date?

 

 

Link to comment
Share on other sites

  • Solution
mellomade

In a word - no.  But with Emby for Kodi there is no need to.  Sure each instance of Kodi will have its own database - but when used with the Fast Startup Sync plugin for Kodi your local databases will update quickly and efficiently - on the fly.  Server changes are updated within seconds.  

  • Like 2
Link to comment
Share on other sites

xnappo

Yep.  Emby is the central database, the Kodi DB is simply a local cache that gets synced with the database.

Link to comment
Share on other sites

totalhavoc

I was thinking more in the case of our house where someone can go months of not logging into one of the TV and then have to have it update. I have fast sync not update a system correctly when it has been months since the user has logged in on that TV. Then I have to do a repair before everything shows up.

Link to comment
Share on other sites

totalhavoc

No, don't run a repair. You just have to run a manual sync.

Manual syncs did not update them... I had to do a repair for all media from the last 3 months to show for that user

Link to comment
Share on other sites

Angelblue05

Hm, unexpected... If the checksum changed, it should refresh the entry... It does a manual compare between the emby database and kodi database.... Was there any errors in log?

 

You could always check out the backup option. I know it's not the same, but something to consider if you do have one device that is up to date...

https://github.com/MediaBrowser/plugin.video.emby/wiki/Create-and-restore-from-backup

Link to comment
Share on other sites

TopperBG

So we assume that Emby for Kodi didn't work with MySQL setup of Kodi?

Couse I spend last two nights  and manage to work with Kodi after removed MySQL setup from advancedsettings.xml

I don't mind that Emby can't save to MySQL but it even don't work at all! No movies or music in my library after manual refresh, reset etc. but I've seen progress notification and scrobling the movies....

Could I miss something ?

Link to comment
Share on other sites

Angelblue05

Hey there, sorry you are having trouble setting up.

 

Can you confirm you are seeing your content in the emby webclient? What type of libraries do you have set up? Did you install the add-on after your emby server was fully set up?

 

Can you try doing a reset by launching the emby add-on, then once Kodi restarts, please provide your Kodi log by following: https://emby.media/community/index.php?/topic/17599-how-to-report-a-problem/

Edited by Angelblue05
Link to comment
Share on other sites

TopperBG

1.Yes, I've setup Emby Server on my own Debian server. Can see web interface, can access files through it from my PC, can access it with File explorer at Samba shares

2.Done many times

 

If I turn off MySQL settings in Kodi - movies are visible in Library. If turn on MySQL, just see syncing and that's all.

 

I've got part of log file when sync library, will post it in few seconds.

 

Here is part of the log when I see movie and try to start it:

01:51:16 T:18446744072296123712  NOTICE: EMBY.kodimonitor -> Method: Playlist.OnClear Data: {"playlistid":1}
01:51:17 T:18446744072415746504  NOTICE: EMBY.default_movies -> Parameter string: ?dbid=5&mode=play&id=e45ca3810336b6e23fd076ce9e9b2b71&filename=wstbeyond.mkv
01:51:17 T:18446744072415746504  NOTICE: EMBY.artwork -> Using Image Cache Thread Count: 25
01:51:17 T:18446744072415746504  NOTICE: EMBY.playbackutils -> Play called.
01:51:17 T:18446744072415746504  NOTICE: EMBY.playutils -> Verifying path: /home/lib/Movies/Star.Trek.Beyond.2016.WEBRip.x264.AC3-WAR/wstbeyond.mkv
01:51:17 T:18446744072415746504  NOTICE: EMBY.playutils -> Can't verify path, assumed linux. Still try to direct play.
01:51:17 T:18446744072415746504  NOTICE: EMBY.playutils -> File is direct playing.
01:51:17 T:18446744072415746504  NOTICE: EMBY.playbackutils -> Setting up properties in playlist.
01:51:17 T:18446744072296123712  NOTICE: EMBY.kodimonitor -> Method: Playlist.OnRemove Data: {"playlistid":1,"position":1}
01:51:17 T:18446744072415746504  NOTICE: EMBY.playbackutils -> Processed as a playlist. First item is skipped.
01:51:17 T:18446744072287358896   ERROR: Playlist Player: skipping unplayable item: 0, path [plugin://plugin.video.emby.movies/?dbid=5&mode=play&id=e45ca3810336b6e23fd076ce9e9b2b71&filename=wstbeyond.mkv]
01:51:42 T:18446744072296123712  NOTICE: EMBY.kodimonitor -> Method: Playlist.OnClear Data: {"playlistid":1}
01:52:08 T:18446744072409236056  NOTICE: EMBY.default_movies -> Parameter string: ?dbid=4&mode=play&id=816cf322742f46e195cd2e8d997ab337&filename=Suicide.Squad.2016.HC.HDRip.XviD.AC3-EVO.avi
01:52:08 T:18446744072409236056  NOTICE: EMBY.artwork -> Using Image Cache Thread Count: 25
01:52:08 T:18446744072409236056  NOTICE: EMBY.playbackutils -> Play called.
01:52:08 T:18446744072409236056  NOTICE: EMBY.playutils -> Verifying path: /home/lib/Movies/Suicide.Squad.2016.HC.HDRip.XviD.AC3-EVO/Suicide.Squad.2016.HC.HDRip.XviD.AC3-EVO.avi
01:52:08 T:18446744072409236056  NOTICE: EMBY.playutils -> Can't verify path, assumed linux. Still try to direct play.
01:52:08 T:18446744072409236056  NOTICE: EMBY.playutils -> File is direct playing.
01:52:08 T:18446744072409236056  NOTICE: EMBY.playbackutils -> Play as a regular item.
01:52:08 T:18446744072287358896  NOTICE: DVDPlayer: Opening: /home/lib/Movies/Suicide.Squad.2016.HC.HDRip.XviD.AC3-EVO/Suicide.Squad.2016.HC.HDRip.XviD.AC3-EVO.avi
01:52:08 T:18446744072287358896 WARNING: CDVDMessageQueue(player)::Put MSGQ_NOT_INITIALIZED
01:52:08 T:18446744072384051440  NOTICE: Creating InputStream
01:52:08 T:18446744072384051440   ERROR: CDVDPlayer::OpenInputStream - error opening [/home/lib/Movies/Suicide.Squad.2016.HC.HDRip.XviD.AC3-EVO/Suicide.Squad.2016.HC.HDRip.XviD.AC3-EVO.avi]
01:52:08 T:18446744072384051440  NOTICE: CDVDPlayer::OnExit()
01:52:08 T:18446744072287358896   ERROR: Playlist Player: skipping unplayable item: 0, path [plugin://plugin.video.emby.movies/?dbid=4&mode=play&id=816cf322742f46e195cd2e8d997ab337&filename=Suicide.Squad.2016.HC.HDRip.XviD.AC3-EVO.avi]
01:52:09 T:18446744072287358896  NOTICE: CDVDPlayer::CloseFile()
01:52:09 T:18446744072287358896  NOTICE: DVDPlayer: waiting for threads to exit
01:52:09 T:18446744072287358896  NOTICE: DVDPlayer: finished waiting
01:52:09 T:18446744072287358896  NOTICE: CDVDPlayer::CloseFile()
01:52:09 T:18446744072287358896  NOTICE: DVDPlayer: waiting for threads to exit
01:52:09 T:18446744072287358896  NOTICE: DVDPlayer: finished waiting
01:52:09 T:18446744072296970464  NOTICE: Salts HD Lite: Service: Playback Stopped
01:52:09 T:18446744072297169168  NOTICE: Stream All The Sources: Service: Playback Stopped
01:52:09 T:18446744072296123712  NOTICE: EMBY.player -> Clear playlist properties.
01:52:09 T:18446744072296123712  NOTICE: EMBY.kodimonitor -> Method: Player.OnStop Data: {"end":false,"item":{"id":4,"type":"movie"}}

And here comes second problem (not concerning MySQL) - the move wouldn't start :/

Edited by TopperBG
  • Like 1
Link to comment
Share on other sites

Angelblue05

Your paths are incorrect. You'll need to set up the network equivalent in your Emby dashboard > library > select your individual library, then select the folder and enter the shared network path (if you are using smb, then you'd do something like this:

/home/lib/Movies/Star.Trek.Beyond.2016.WEBRip.x264.AC3-WAR/wstbeyond.mkv

58048fe6a2d54_pathsubs.jpg

 

 

A quicker way to get started, go to the add-on settings > playback tab > enable play from HTTP. This will bypass your path issues until you get a chance to apply path substitution in Emby for your libraries. Keep me posted :)

Edited by Angelblue05
  • Like 1
Link to comment
Share on other sites

TopperBG

Thank you, that substitution looks logical and I obviously missing it !!!

 

Yeah, I've read the Wiki but that "man in the middle" with Kodi + MySQL in facts exclude collaboration.

If we want to use Emby (offline in matter of internet streaming) and Kodi (native streams from i'net) it's not possible at my noob experience.

And Kodi+MySQL is a must have when we have more than one media box in use....

Too pity I've loved to have Emby in usage but must choose one or another variants. Both are mutually exclusive !

Edited by TopperBG
Link to comment
Share on other sites

Angelblue05

No, MySQL is not supported in any way. Is there any reason you can't move all of your content to Emby and just drop MySQL?

Link to comment
Share on other sites

Angelblue05

I haven't used MySQL in years, Is it possible to perhaps split your set up into two separate Kodi profile; one where MySQL is set up, and another where it isn't with your Emby content?

 

Edit: You don't need MySQL with Emby, because Emby holds everything and the add-on just syncs what is found in your Emby profile to Kodi. However, since MySQL basically disables the Kodi database which is what the add-on writes to, that's why you can't have both.

Edited by Angelblue05
Link to comment
Share on other sites

TopperBG

Not actually at your last statement.

Only one profile at all media boxes and Kodi instances. 

Yes, KODI support central database like MySQL but for databases which users want to - MyVideo or/and MyMusic:

http://kodi.wiki/view/advancedsettings.xml#musicdatabase.2Fvideodatabase

http://kodi.wiki/view/MySQL/Setting_up_Kodi

<advancedsettings>
  <videodatabase>
    <type>mysql</type>
    <host>***.***.***.***</host>
    <port>3306</port>
    <user>kodi</user>
    <pass>kodi</pass>
  </videodatabase> 
  <musicdatabase>
    <type>mysql</type>
    <host>***.***.***.***</host>
    <port>3306</port>
    <user>kodi</user>
    <pass>kodi</pass>
  </musicdatabase>
  <videolibrary>
    <importwatchedstate>true</importwatchedstate>
    <importresumepoint>true</importresumepoint>
  </videolibrary>
</advancedsettings>

That's looks pretty like my own setup!

 

But that not conflict with other local databases (.db files) from Kodi or addon or scripts:

 

 

  • Database - This is where all of the databases required for your Music and Video Libraries are located, containing any downloaded (scraped) music or video information.
    • MyMusic#.db - Database file containing Music information.
    • MyVideos#.db - Database file containing Movie, TV Show and Music Videos information.
    • ViewModes#.db - Database file containing information on all Kodi views (viewmode, sorting etc.).
    • Addons#.db - Database file containing information on all Kodi addons (skins, scraper, video-addons...).
    • Textures#.db - Database file containing information on all Kodi textures (thumbs, fanart, posters...).
    • TV#.db - Database file containing information on Live-TV channels.
    • EPG#.db - Database file containing information on EPG for Live-TV.
    • ADSP#.db - Database file containing information for Audio Digital Signal Processing add-ons.
Note: Where # is the number of current database version in use.

 

That way I'm working for all my home media boxes, computers etc. media devices. So I've thought that no be a problem make my own Emby instance to download HD movies and to keep my fat music collection.

The only cross point between two setups of Kody and Emby addon are Kodi Library and there seems to be a problem?

 

Again, as I'd said - could be I'm wrong, could be missing something in setup, couse there is no reason to interferent work of Emby addon with it's own database file(s) in .db and that way setup Kodi.

Or itis weakness of Kodi itself...

Edited by TopperBG
Link to comment
Share on other sites

TopperBG

No, MySQL is not supported in any way. Is there any reason you can't move all of your content to Emby and just drop MySQL?

No, that's not an option - no about MySQL, but Kodi's goal is to serve online streaming from Internet. If I'll migrate only to Emby, am I must download all the movies and music to my Emby server :D;)

And not talking only for local files, but anyone anywhere accessible through I'net. 

Link to comment
Share on other sites

Angelblue05

There is no way to get the addon to play nice with MySQL, because MySQL overwrites the database Kodi looks at. Kodi won't load from both the local database myvideosxx.db and the MySQL database. Hope this clarifies it.

 

You can use any addons in Kodi alongside Emby for Kodi, but you cannot use MySQL because of the way Kodi works. So your options are:

1- you create a second kodi profile where MySQL is not enabled, which will hold your Emby content.

2- You keep one Kodi profile, drop MySQL and sacrifice having central watched status for your Kodi addons (which anyway, most of them are illegal to use to begin with, and are not supported by Kodi)

3- you just don't use emby for kodi which will never work with MySQL setup. You can instead use DLNA or simply import your Emby content into Kodi the traditional way - by setting up sources.

 

 

Sent from my iPhone using Tapatalk

Edited by Angelblue05
  • Like 2
Link to comment
Share on other sites

cw-kid

If you set the fast sync plugin to say 30 days then after this time a manual sync will be done instead of the fast sync.

 

Hi

 
Looking in the Fast Sync plug-in settings on the server, I see there are new options which I have not seen before, I assume you are referring to these. 
 
The Retention Days is currently set to 0 
 
I also have issues sometimes with Kodi clients that have not been turned on for several weeks and sometimes I have to reset the local database to get it working again properly. 
 
So its recommended to change / increase the Retention Days value, when some Kodi machines that are not used that regular ? What does that actually mean / do ? 
 
Thanks
 
EDIT:
 
More talk about it here, I've set mine to 30 days see how that goes. 
Edited by cw-kid
Link to comment
Share on other sites

Angelblue05

I'll be marking this thread as answered. However, I'm having a hard time wrapping my head around the fact that the add-on cannot recover from being offline for a really long time... Next time, if someone can open a new thread and provide their Kodi log containing that first start up (prior to resetting or repairing), it would be great so it's something we can look into hopefully resolve for the future.

Link to comment
Share on other sites

Guest
This topic is now closed to further replies.
×
×
  • Create New...