I think background with what I'm thinking here may help explain, so forgive the story...I have a home setup where I have one main Kodi media centre in the loungeroom with most of my TV shows/movies in the local library.
I also have a Kodi box in the bedroom that I have added the loungeroom library to as UPNP sources - which works great.
In the loungeroom I have TMDB Helper setup so that it plays from local sources first (as is the default), then Netflix, then whatever other add-ons I have players for in TMDB Helper.
This is obviously perfect in the loungeroom but in the bedroom as nothing is in the "local library" but all on the loungeroom UPNP server, nothing plays from my server (i.e. it all tries to stream from Netflix or other addons).
As the UPNP server has full titles etc, is it possible to have TMDB Helper play from there prior to scraping Netflix or whatever default player you have setup? This is one of the benefits of having UPNP support in Kodi and I'm sure plenty of users with multiple devices have it setup in the same way.
That may be a candidate for a shared SQL server 馃
Works well ATM, as the Kodi library is on the device that mostly plays it.
It's only when I'm watching in the bedroom that I agree the server through UPNP - which I'm sure others do, otherwise why have the option there.
It's great for sharing local library with other devices on the LAN, just doesn't work with themoviedb helper
@abbaskip
You could make a UPnP player file. I've tested the below and it works well for me using a UPnP source.
These instructions assume your UPnP share is setup like this: https://kodi.wiki/view/HOW-TO:Share_libraries_using_UPnP
On the bedroom machine, create a text file called upnp.json and put it in the TMDbHelper player dir
kodi\userdata\addon_data\plugin.video.themoviedb.helper\players\
In the file put:
{
"name": "UPnP Network",
"plugin": "xbmc.core",
"priority": 500,
"play_movie": [
"upnp://",
{"label": "Kodi \\(Aspire-V5\\)"},
{"label": "Video Library"},
{"label": "Movies"},
{"label": "Titles"},
{"title": "{title}", "year": "{year}"}
],
"play_episode": [
"upnp://",
{"label": "Kodi \\(Aspire-V5\\)"},
{"label": "Video Library"},
{"label": "TV shows"},
{"label": "Titles"},
{"label": "{showname}"},
{"label": ".* {season}"},
{"season": "{season}", "episode": "{episode}"}
]
}
Replace the "Kodi \\(Aspire-V5\\)" parts with the name of your Kodi UPnP source device. I'm testing with my old Aspire laptop as the source, so my device name is Kodi (Aspire-V5). Because the matching uses regex, you need to escape any special characters like brackets with a double backslash.
NOTE: This is the UPnP device name NOT the name you gave the source in Kodi. Using the client machine, you can find the device name of the source machine by going to
Videos > Files > Add videos... > Browse > UPnP devices > and noting the name.
Save the file and now you should have an option in your players to select Play with UPnP Network.
Any chance this could be added as a built in player - with the device name in the settings? It would save me adding an extra player (with fallback) to each machine.
You could try using $INFO[System.FriendlyName] in the first label step of your player. From the docs, it appears it will already format it as "Kodi (%hostname%)":
> Returns the Kodi instance name. It will auto append (%hostname%) in case the device name was not changed. eg. "Kodi (htpc)"
Wouldn't this essentially just make it a local player?
$INFO[System.FriendlyName] would point it at the local instance?
Ah, my bad! I don't know what I was thinking, but you're totally right 馃槄
@abbaskip - ^^^ That should work on any machine as long as the Kodi UPnP device name is prefixed with Kodi (which is the default). Probably will run into problems if you've got multiple Kodi UPnP devices all sharing media, but a complex decentralised setup like that would require its own custom player files to manage properly anyway. I'm assuming that the normal use case is to have one centralised Kodi device that has all the media which is then shared via UPnP to the other Kodi machines on the network.
Can you test latest master and confirm that it works for you?
@abbaskip - ^^^ That should work on any machine as long as the Kodi UPnP device name is prefixed with
Kodi(which is the default). Probably will run into problems if you've got multiple Kodi UPnP devices all sharing media, but a complex decentralised setup like that would require its own custom player files to manage properly anyway. I'm assuming that the normal use case is to have one centralised Kodi device that has all the media which is then shared via UPnP to the other Kodi machines on the network.Can you test latest master and confirm that it works for you?
This works perfectly, thanks! You're correct that most people will only have one instance of Kodi acting as a UPnP server with local files, so the wildcard should work fine most of the time. Would be interesting to see what would happen if there were two UPnP servers, whether Kodi would find the file if it was only on one...
Now I just need to modify and setup fallback etc.
This works perfectly, thanks!
Excellent! Thanks for testing.
Would be interesting to see what would happen if there were two UPnP servers, whether Kodi would find the file if it was only on one...
If there are two UPnP servers it will only look on the first one -- as soon as a player step finds a match it will open that folder and move onto the next step (or play and exit if it's a playable file), so the name will match for the first server and it will open that one and then move onto the next step.
Most helpful comment
Any chance this could be added as a built in player - with the device name in the settings? It would save me adding an extra player (with fallback) to each machine.