Jump to content

Automatic homescreen shortcut creation?


KingJ

Recommended Posts

I have a number of media libraries in Emby which i'd like to display on Kodi's homescreen. Currently, in order to display these on the homescreen I need to edit the menu and add them each as their own shortcut, set widgets, submenu items etc. This is pretty repetitive and time-consuming, is there a way I can just tell it to automatically add all libraries to the homescreen and also add recently added/in progress/recommended etc submenus?

 

Thanks in advance!

Link to comment
Share on other sites

inzombyac

It's possible, but it's more work to do this than the effort to set it up manually.  If you feel comfortable diving into code, you can do this by modifying your skin if you are using a skin that uses both the script.skin.helper.service and script.skinshortcuts addons (Titan, Arctic Zephyr, Eunique).  However, this will be overwritten when the skin is updated so you have to repeat each time the skin is updated.  Ideally, this would need to be added to the skin or someone would need to create/update a plugin to do this to be skin independent.  Or you could fork the skin in GitHub and keep your own version.

 

In any event, if you want to script this here's what you need to do.  This process will create a main menu entry per item that you see from Addons > Video Addons > Emby.  You can't control the order but you can add everything there and then delete the items that you don't want.

 

Step 1: Enable smart shortcuts for Emby in the skin's startup file.  This file is called startup.xml and will be located in the skin folder under the 16x9 or 1080i subfolder.  You will need a line such as this if it does not exist to turn on the smart shortcuts for Emby

<onfocus condition="System.HasAddon(script.skin.helper.service) + System.HasAddon(plugin.video.emby)">Skin.SetBool(SmartShortcuts.emby)</onfocus>

Step 2: Provide default shortcuts:

 

Next you need to edit the default shortcut files.  These are stored in a shortcuts folder in the skin directory.  The main menu shortcuts are in the file mainmenu.DATA.xml.  If that file does not exist you can create it following the instructions here:

 

https://github.com/BigNoid/script.skinshortcuts/blob/master/resources/docs/Providing%20default%20shortcuts.md

 

You will need a shortcut entry with the following format:

<shortcut>
     <defaultID>info-window-home-property-emby-nodes-0-title</defaultID>
     <label>$INFO[Window(Home).Property(emby.nodes.0.title)]</label>
     <label2>Emby Node 0</label2>
     <icon>special://home/addons/plugin.video.emby/icon.png</icon>
     <action>$INFO[Window(Home).Property(emby.nodes.0.path)]</action>
</shortcut>

Repeat this replacing "0" with 1,2,3...  for up to home many of the emby paths you want to display.

 

Step 3: Sub menus

 

For the sub menus part you need to create file per shortcut that you added above.  These files will be named info-window-home-property-emby-nodes-0-title.DATA. info-window-home-property-emby-nodes-1-title.DATA, etc.  There are options for recent, unwatched, inprogress, recentepisodes, nextepisodes, and inprogressepisodes.  Fro the sub menus that you want, you add the following in the sub menu files:

<shortcuts>
	<shortcut>
		<defaultID>info-window-home-property-emby-nodes-0-nextepisodes-title</defaultID>
		<label>$INFO[Window(Home).Property(emby.nodes.0.nextepisodes.title)]</label>
		<label2>Next Episodes</label2>
		<icon>special://home/addons/plugin.video.emby/icon.png</icon>
		<thumb>$INFO[Window(Home).Property(emby.nodes.0.nextepisodes.image)]</thumb>
		<action>$INFO[Window(Home).Property(emby.nodes.0.nextepisodes.path)]</action>
		<visible>!IsEmpty(Window(Home).Property(emby.nodes.0.nextepisodes.path))</visible>
	</shortcut>
...
</shortcuts>

Repeat the <shortcut> node replacing "nextepisodes" with recent, unwatched, etc.   for the entries that you want.  The episode specific items will only show up if that node is the tvshow type.  See https://github.com/marcelveldt/script.skin.helper.service#smart-shortcuts-for-emby-addon-pluginvideoemby for details for what you can do with the submenus.

 

Now the items that you see in the Emby video addon will be automatically added.  If your skin has support for home screen widgets and you want to have these generated automatically, there is more work you must do.  See below.

 

Widgets for the shortcuts:

 

If you want to include default widgets, this is a bit more complex.  You need to eidt the skin's overrides.xml in the shortcuts folder to set the default widgets.  See here for more: https://github.com/BigNoid/script.skinshortcuts/blob/master/resources/docs/advanced/Managing%20widgets.md

 

If you followed the template above,  you could add the following to use a widget of the recent items of that node:

<widgetdefaultnode defaultID="info-window-home-property-emby-nodes-0-title" group="mainmenu" label="$INFO[Window(Home).Property(emby.nodes.0.title)]" type="$INFO[Window(Home).Property(emby.nodes.0.type)]" path="$INFO[Window(Home).Property(emby.nodes.0.recent.content)]" target="video">$INFO[Window(Home).Property(emby.nodes.0.title)]</widgetdefaultnode>

Again repeat for each main menu shortcut you created above.

  • Like 1
Link to comment
Share on other sites

CBers

I have a number of media libraries in Emby which i'd like to display on Kodi's homescreen. Currently, in order to display these on the homescreen I need to edit the menu and add them each as their own shortcut, set widgets, submenu items etc. This is pretty repetitive and time-consuming, is there a way I can just tell it to automatically add all libraries to the homescreen and also add recently added/in progress/recommended etc submenus?

 

Thanks in advance!

 

Is this a similar question ??

 

http://emby.media/community/index.php?/topic/31732-how-to-let-kodi-display-your-library-same-as-web-client/

Link to comment
Share on other sites

marcelveldt

Why not use the smart shortycuts feature itself ? It will do all this work for you, just add the smart shortcut and ALL is setup, including submenus, widgets etc.

Link to comment
Share on other sites

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