Guest - Testers are needed for the reworked CDateTime core component. See... https://forum.kodi.tv/showthread.php?tid=378981 (September 29) x
  • 1
  • 22
  • 23
  • 24
  • 25
  • 26(current)
[MYSQL] HOW-TO: 5 User XBMC
(2022-08-10, 15:46)TakedaT Wrote: The one issue so far that has been a bit of a pain, was that other users who share the database could hose the library if their pi was to lose a mount and attempt cleanup (they selected the default 'delete' option when the prompt showed).

Not sure if this has been mentioned in the previous posts, but the way I got around this was to create a read-only mysql user for those users' pis, and grant only SELECT access to all tables in their db, except granting ALL access to both the bookmark and files tables.  Been using this for a few weeks now without issues for the most part.  They can still have their own watched status and get regular updates when i update from my end.  One small issue is if a read-only user attempts to refresh certain items, OSMC will die with a sadface, but thats minimal and I just tell them to stop trying to update.

Has anyone else been plagued with other users hosing their library like this?  If so, just wondering how they approached preventing it.
With my children growing and experimenting, this has become an issue for me as well.  I'm about to try the same setup, so hopefully it works.  Will confirm once done!
Reply
(2023-08-12, 11:57)Supay Wrote:
(2022-08-10, 15:46)TakedaT Wrote: The one issue so far that has been a bit of a pain, was that other users who share the database could hose the library if their pi was to lose a mount and attempt cleanup (they selected the default 'delete' option when the prompt showed).

Not sure if this has been mentioned in the previous posts, but the way I got around this was to create a read-only mysql user for those users' pis, and grant only SELECT access to all tables in their db, except granting ALL access to both the bookmark and files tables.  Been using this for a few weeks now without issues for the most part.  They can still have their own watched status and get regular updates when i update from my end.  One small issue is if a read-only user attempts to refresh certain items, OSMC will die with a sadface, but thats minimal and I just tell them to stop trying to update.

Has anyone else been plagued with other users hosing their library like this?  If so, just wondering how they approached preventing it.
With my children growing and experimenting, this has become an issue for me as well.  I'm about to try the same setup, so hopefully it works.  Will confirm once done!

@TakedaT - Been tinkering all day.  It kind of works, but not fully.  I setup everything as usual, and then added separate users to the mariadb database.  Then granted them each permissions to the tables in their databases, as you stated in your post.  I'll add the lines I used below.
Quote:GRANT SELECT ON Kodi_U03_Video_121.* TO 'KODI_U03'@'%';
GRANT ALL ON Kodi_U03_Video_121.bookmark TO 'KODI_U03'@'%';
GRANT ALL ON Kodi_U03_Video_121.files TO 'KODI_U03'@'%';

And this is what I see for permissions in the database:
Quote:+---------------------------------------------------------------------------------------------------------+
| Grants for KODI_U03@%                                                                                   |
+---------------------------------------------------------------------------------------------------------+
| GRANT USAGE ON *.* TO `KODI_U03`@`%` IDENTIFIED BY PASSWORD 'REDACTED' |
| GRANT SELECT ON `Kodi_U03_Video_121`.* TO `KODI_U03`@`%`                                                |
| GRANT ALL PRIVILEGES ON `Kodi_U03_Video_121`.`files` TO `KODI_U03`@`%`                                  |
| GRANT ALL PRIVILEGES ON `Kodi_U03_Video_121`.`bookmark` TO `KODI_U03`@`%`                               |
+---------------------------------------------------------------------------------------------------------+

So, this works in that each user is able to have their own working watch statuses but they cannot remove or alter files in the library whatsoever, which is perfect and exactly what I wanted.

I've long used Trakt for keeping a separate watch history copy for each user in case the DB ever goes wrong during an upgrade or I break it.  Trakt worked perfectly for my main account under U01, where I have full permissions to the database, and all of my watch statuses came across from Trakt and updated into the new database.  However, for the other users with the exact same Trakt setup other than their own account linked, it doesn't update the Kodi database for them.  It runs and identifies that there are entries on Kodi that need to be updated from Trakt, and it spends ages processing this all as expected, however at the end not a single status has been updated from Trakt to Kodi.  Yet if I select one of the same movies or episodes that I know should have been updated and manually do it, it records the watch history as expected.

I have run a debug and checked the logs, and I can see a massive amount of failures when it is trying to execute the updates to the user database.  Common repeat is below:
Quote:error <general>: SQL: [Kodi_U03_Video_121] Undefined MySQL error: Code (1142)
Checking online it seems this may be a permissions issue.  I assume Trakt is trying to update the tables in a way that isn't permitted following the restricting of these users, but I don't understand why or how to fix it.

Are you or anyone else able to please advise as to why I can manually update watch statuses either by watching content or through the context menu, but Trakt fails?
Reply
My very hacky temporary solution has been to grant all on the user's database, run Trakt to update the Kodi database, then return it to the original state of just having select.  Means that Trakt won't be able to update Kodi again, but from this point I only really need it uploading to Trakt rather than down to Kodi.
Reply
Hope you're well. Can you please update this for Omega Beta 1?
Reply
Doesn't work for latest kodi.
Reply
(2023-01-16, 15:35)BigMong Wrote: Sorry @chimpsinties been busy with RL and forgot about this, I only had a look into the Adult/Kids thing that once, I will need to check over the code and do some test

@bart330 I will have a look into any changes that are needed. Hopefully, If have some time this weekend. it looks like it has only been out for less than a week as well.

Just wondering if anyone has this working for v20 / Nexus.
Reply
(2023-10-27, 04:07)vin1233321 Wrote: Hope you're well. Can you please update this for Omega Beta 1?

Hi, did you or someone else managed to make it work for Omega ?
The migration won't work, so I assume a new script is needed.

Thanks all for the work.
Reply
I have stopped trying to get this to work with every release and moved over to using JellyFin for Kodi, and running a JellyFin Server.
It's working almost the same, but I no longer have the time to keep doing the MySQL way.
Reply
(2024-04-16, 03:49)BigMong Wrote: I have stopped trying to get this to work with every release and moved over to using JellyFin for Kodi, and running a JellyFin Server.
It's working almost the same, but I no longer have the time to keep doing the MySQL way.

Do you have a good way of migrating the watched status data into JellyFin?

/ETA: I used Trakt addon (with a hotfix so it doesn't get throttled by the Trakt API) in Kodi to get it out, and the Trakt addon in Jellyfin to get it in there. Worked great, and will make upgrades or even version mismatches of Kodi a lot smoother.
Reply
(2024-07-14, 06:05)Enigma256 Wrote:
(2024-04-16, 03:49)BigMong Wrote: (removed)
Do you have a good way of migrating the watched status data into JellyFin?
I'm a long-term MySQL user.

I have just started messing around with Jellyfin so that I can share info easily over distance and a few trusted users.

a) I have always exported my info to my NAS.  This means that every media file has the artwork and nfo for it out there.

b) I found that Jellyfin recognizes bot the artwork and watched state from the NFO.  So, INTO the Jellyfin client is easy.  (have not tried Jellyfin for Kodi)


The question really is:  if I watch something via Jellyfin, how will that event be communicated into Kodi and that NFO?

And then really, would I want it to?  If my niece watched something remotely, do I really want that to change MY wached status?


This is really what made MySQL a godsend...  but the expectation is shifting to "anything anywhere anytime FOR ME" (being individual end-user aware) ...  and Kodi, as a client, is just not keeping up.
Reply
(2024-07-30, 17:06)zebraitis Wrote: The question really is:  if I watch something via Jellyfin, how will that event be communicated into Kodi and that NFO?

And then really, would I want it to?  If my niece watched something remotely, do I really want that to change MY wached status?


This is really what made MySQL a godsend...  but the expectation is shifting to "anything anywhere anytime FOR ME" (being individual end-user aware) ...  and Kodi, as a client, is just not keeping up.

I've been using this for a bit now, it really works well. It syncs between all different Kodis we have in the house, and if we watch something on the Jellyfin webinterface, it also syncs. We have multiple users, both on Jellyfin and on Kodi, and we matched them up. So if my wife watches something on Kodi or Jellyfin it updates on all her profiles, but not on mine.
This might just be specific to my server, but Jellyfin updates a lot faster on Kodi than MySQL did. When we finish an episode it immediately refreshes the view within a few seconds, with MySQL it could take a minute or two.

And on Kodi everything still looks the same, it's just the backend stuff that is being handled by Jellyfin instead of MySQL
Reply
(2024-04-16, 03:49)BigMong Wrote: I have stopped trying to get this to work with every release and moved over to using JellyFin for Kodi, and running a JellyFin Server.
It's working almost the same, but I no longer have the time to keep doing the MySQL way.

Thank you for all the work you've done on this over the years, it has really been appreciated.

Are you using Jellyfin to integrate in with Kodi or the JellyCon add-on to access it through Kodi?  And have you tried them both and, if so, how did you find each compared please?
Reply
  • 1
  • 22
  • 23
  • 24
  • 25
  • 26(current)

Logout Mark Read Team Forum Stats Members Help
[MYSQL] HOW-TO: 5 User XBMC5