Jump to content

Emby, Kodi, profiles and thumbnail space/duplication issues


xe`

Recommended Posts

New user here in the process of moving from Kodi/MariaDB to Kodi/Emby.

 

As I understand it the correct way to handle Emby multiuser within Kodi is to create a Kodi profile per user and manually install and configure each profile. Please someone correct me if I am wrong as this doesn't seem to be formally documented anywhere (recommend it is).

 

Assuming I am correct then I have an issue with the volume of duplicate thumbnail artwork created both per Kodi instance and also system wide.

 

For examples sake lets take my network with 4 users and 5 Kodi devices. My art cache is 6GB which means each Kodi device has 24GB of thumbnails and system wide there are (4 users * 5 devices * 6 GB = 120GB + the 6GB Emby master copy). Thats 120GB of duplicate thumbnails system wide and double the eMMC space I have per device.

 

I have spent some time with Kodi and path substitution along with native fs mounts to see if I can get around this the "official" way.

 

tl;dr Kodi profiles are fragile and anything other than stock profiles just break.

 

NFS path subs are the most reliable of the lot where placing a profile on a NAS and using Kodi substitution only breaks sometimes whereas cifs breaks all/most times. I have tried every variation I can think of an have enlisted others to try different approaches too. It is just not a viable solution.

 

So that leaves me no where. Multi user relies on Kodi profiles which are needlessly wasteful and inherently klunky ... more like many-single-user that real multi-user.

 

Any ideas would be appreciated as I really dont want to have to start rolling my own offline filesystem level dedupe just to cater for this.

 

Appreciated

Link to comment
Share on other sites

Thanks, I will try this over the next couple of days using a LibreELEC virtual install on VMware. I had immediately discounted this approach as shared fanart support was officially dropped around K15 or K16 (I forget) but at this point I will happily take "unsupported but working and stable" over "cant use Emby".

Link to comment
Share on other sites

I have had some success, enough I think for this technique to be viable for a production system with the caveat that it relies on using a feature that is officially unsupported in Kodi (shared fanart) and as such expect any Kodi support requests to have a less than positive reply.

I am using LibreELEC but the technique should apply equally well to any platform by simply changing the local substitution path.

 

The goal is to give access to Emby profiles via Kodi using the Emby addon whilst maintaining a single shared local art thumbnail cache primarily to save space on device with low disk space e.g. AMLogic etc

Whilst every attempt I made to start from a currently live system failed YMMV but I would recommend starting fresh. I should also warn that you should try to be as pedantic with the order as possible because the Kodi profile implementation is quite fragile and does not like deviation from standard.

 

So here we go....

 

  • Reset the Kodi device to factory defaults and reboot.
  • SSH/CIFS into the box
  • Create a folder called Thumbnails outside of the Kodi settings path. For LibreELEC I chose "/storage/Thumbnails"
  • Create a txt file called advancedsettings.xml in the Kodi userdata folder. For LibreELEC this is "/storage/.kodi/userdata/advancedsettings.xml "
  • Copy the following into this new file:
<advancedsettings>
    <pathsubstitution>
      <substitute>
        <from>special://masterprofile/Thumbnails/</from>
        <to>/storage/Thumbnails/</to>
      </substitute>
      <substitute>
        <from>special://profile/Thumbnails/</from>
        <to>/storage/Thumbnails/</to>
      </substitute> 
    </pathsubstitution>
</advancedsettings>
  • Restart Kodi by either rebooting or on LibreELEC "systemctl restart kodi" from the SSH console
  • Delete the default masterprofile Thumbnails directory as it is a good way to easily check that somethign has gone wrong it is is recreated.  . For LibreELEC this is "/storage/.kodi/userdata/Thumbnails"
  • At this point we have set the default Kodi profile "Masterprofile" and all other future profiles to use the new shared thumbnail folder "<to>/storage/Thumbnails/</to>"

 

  • I chose not to use Embycon as i prefer the fuller more integrated experience of the Kodi Sync Add-On
  • BEFORE adding any profiles follow the instructions here https://github.com/MediaBrowser/plugin.video.emby/wiki/Emby-Repository to install the Kodi Sync Add-On and the Emby server side addon.
  • When installed it will prompt you to choose the Emby server and users. Cancel out of this as we do no want to link the "masterprofile" generic Kodi user to a specific Emby user.
  • Note: cancelling may lockup Kodi and you may need to restart it. Dont know why, possibly a bug.
  • Now navigate to the Kodi settings and add a profile accepting all the defaults. I recommend making your Kodi users names the same as your Emby usernames for continuity.
  • Switch to this new profile using either context menu in the profiles setting or the log out option under the power menu
  • Navigate to addon and then video addon. You will see the Emby addon available but disabled. Enable it and when prompted choose the correct Emby user.
  • Move out of the settings dialogue to see the progress of the Emby sync.
  • Now wait. Dont do anything. Resist the urge to press buttons until this is complete or you will likely have to start again as it locks up readily. This takes a while, several hours for me.
  • When complete you will need to log out of the profile and back in to see any content in Kodi (suggest this could be considered a bug)

 

Repeat the process with your other users.

 

Note: It may be possible to use rsync to later sync this setup to other devices of near identical architecture. Will post back if I achieve this.

 

Enhancement:

 

It is proving possible to host this Thumbnails folder on a remote share under certain conditions.

 

YMMV, some observations:

 

  • Dont use cifs/windows fileshare. For me it was completely unreliable or not working at all
  • It only worked for me with nfs
  • It only worked for me using native path sub and not systemd nfs units
  • In LibreELEC i needed to enable the "wait for network" option as it boots so fast
  • Dont try and get brave and path sub more of the profiles. Something in there makes it unreliable. (TBC if i can track down what)
  • As with all things "Kodi profiles" the order you do things and the pace you do them at seems to matter. Be systematic and take your time.

 

The process is simple. Once you have completed the procedure above to create a separate local Thumbnails folder.

 

  • Install rsync. In LibreELEC this is under network tools.
  • Sync your Thumbnails to the remote share e.g.
rsync --dry-run -Pav -e "ssh -p 22 " /storage/Thumbnails/ serverusername@SERVERIP:/mnt/cache/.kodi-emby/Thumbnails/

This is not an rsync tutorial so I highly recommend a "measure twice cut once" attitude along with handfuls of google. You may even be able to copy and paste using other tools but this is the way that worked for me.

 

  • Once synced change permissions on the remote server to what is appropriate (since for me everything was root as that is the model LibreELEC users)
  • Alter the advancedsettings.xml you created earlier to look like
<advancedsettings>
    <pathsubstitution>
      <substitute>
        <from>special://masterprofile/Thumbnails/</from>
        <to>nfs://SERVERIP/mnt/cache/.kodi-emby/Thumbnails/</to>
      </substitute>
      <substitute>
        <from>special://profile/Thumbnails/</from>
        <to>nfs://SERVERIP/mnt/cache/.kodi-emby/Thumbnails/</to>
      </substitute> 
    </pathsubstitution>
</advancedsettings>

As a tip you can use the Kodi add source dialogue and its native nfs browser to locate your nfs thumbnails fodler and then examine the new sources.xml entry for a good idea of what your nfs statement should be.

  • Restart Kodi by either rebooting or on LibreELEC "systemctl restart kodi" from the SSH console

 

.... and enjoy

Edited by xe`
Link to comment
Share on other sites

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