2016-03-05, 12:55
Hi,
Short description: Expand xbmc.player class with a way so an addon can know which file (used in the library) the user wants to play (wants to play, not is playing).
Long description:
I want to (re-)write an addon that needs to know what file the user wants to play. The user wants to play a playlist from a bluray iso file, and the addon would redirect Kodi to the correct playlist. An iso can contain many playlists, each playlist would have it's own ".strm" file (to get scraped in the library)
What the addon would/should do:
1) Work in homes with 1 HTPC, and with 10 HTPC's
2) Work under all OS's (1 HTPC runs on windows, another on linux, another on android... in the same home)
3) If available, would use external subtitles for the stream currently playing
4) Possiblity to use "watched" states (in the library) on the watched movies/tv shows
5) Automatic scraping of tv shows iso's so that the addon would automatically create a s02e06.strm file, with inside the link to playlist 00374 on tvshow.S02D02.iso (first I want the first 4 items working)
I tested the following (under windows):
Bluray iso file :"D:\_Te_Parren\_BR\Broken (2012)\Broken (2012).BluRay.iso"
Playlist to play: 00006
Location of "test.strm" file: "D:\_Te_Parren\_BR\test.strm"
I can play playlist 00006 in the iso file by putting this in the test.strm file:
bluray://udf%3A%2F%2FZ%253A%255C_Te_Parren%255C_BR%255CBroken%2520(2012)%255CBroken%2520(2012).BluRay.iso%2F/BDMV/PLAYLIST/00006.mpls
This works but I need to put the full path inside in the test.strm file, this has following disadvantages:
A) 2 or more (windows) HTPC's need the same mount point (path to the iso)
B) not cross platform compatable. The iso on the NAS is for a windows HTPC located at "D:\...), for a linux HTPC at "/mnt/..."
C) xbmc.player.getPlayingFile returns the "bluray://udf...) file, not the test.strm file; the watched state of the "bluray://udf..." file is/can be adjusted, but what .strm did start this playlist. Not possible to adjust watched state of the .strm file in the Kodi library...
I tried to use a relative path in the test.strm file, this would solve A & B, but not C (better something than nothing), so the test.strm file got this (".\Broken (2012)\Broken (2012).BluRay.iso") as contents:
bluray://udf%3A%2F%2F.%255CBroken%2520(2012)%255CBroken%2520(2012).BluRay.iso%2F/BDMV/PLAYLIST/00006.mpls
But I get "file not found". A relative path appears to not work (Kodi probably doesn't 'cd' in the dir that contains test.strm)
I tried using xbmc.player.getPlayingFile by overriding the init of my player class and calling it here, but I got an exception (not playing file).
My old addon works, but is not user friendly, this would be much more user friendly.
Is there a way to know what .strm file the user wants to play/ is playing at the moment??
If not, I would like to ask a feature request. Either:
- implement a xbmc.player.getSelectedFile method (or xbmc.player.getOriginalFile method, name isn't important for me), that would return the original ".strm" file, not the "bluray://udf..." file.
- some other way that would allow me to accomplish the same...
At the moment I'm stuck because I don't know how to get the .strm filename...
Please comment...
Short description: Expand xbmc.player class with a way so an addon can know which file (used in the library) the user wants to play (wants to play, not is playing).
Long description:
I want to (re-)write an addon that needs to know what file the user wants to play. The user wants to play a playlist from a bluray iso file, and the addon would redirect Kodi to the correct playlist. An iso can contain many playlists, each playlist would have it's own ".strm" file (to get scraped in the library)
What the addon would/should do:
1) Work in homes with 1 HTPC, and with 10 HTPC's
2) Work under all OS's (1 HTPC runs on windows, another on linux, another on android... in the same home)
3) If available, would use external subtitles for the stream currently playing
4) Possiblity to use "watched" states (in the library) on the watched movies/tv shows
5) Automatic scraping of tv shows iso's so that the addon would automatically create a s02e06.strm file, with inside the link to playlist 00374 on tvshow.S02D02.iso (first I want the first 4 items working)
I tested the following (under windows):
Bluray iso file :"D:\_Te_Parren\_BR\Broken (2012)\Broken (2012).BluRay.iso"
Playlist to play: 00006
Location of "test.strm" file: "D:\_Te_Parren\_BR\test.strm"
I can play playlist 00006 in the iso file by putting this in the test.strm file:
bluray://udf%3A%2F%2FZ%253A%255C_Te_Parren%255C_BR%255CBroken%2520(2012)%255CBroken%2520(2012).BluRay.iso%2F/BDMV/PLAYLIST/00006.mpls
This works but I need to put the full path inside in the test.strm file, this has following disadvantages:
A) 2 or more (windows) HTPC's need the same mount point (path to the iso)
B) not cross platform compatable. The iso on the NAS is for a windows HTPC located at "D:\...), for a linux HTPC at "/mnt/..."
C) xbmc.player.getPlayingFile returns the "bluray://udf...) file, not the test.strm file; the watched state of the "bluray://udf..." file is/can be adjusted, but what .strm did start this playlist. Not possible to adjust watched state of the .strm file in the Kodi library...
I tried to use a relative path in the test.strm file, this would solve A & B, but not C (better something than nothing), so the test.strm file got this (".\Broken (2012)\Broken (2012).BluRay.iso") as contents:
bluray://udf%3A%2F%2F.%255CBroken%2520(2012)%255CBroken%2520(2012).BluRay.iso%2F/BDMV/PLAYLIST/00006.mpls
But I get "file not found". A relative path appears to not work (Kodi probably doesn't 'cd' in the dir that contains test.strm)
I tried using xbmc.player.getPlayingFile by overriding the init of my player class and calling it here, but I got an exception (not playing file).
My old addon works, but is not user friendly, this would be much more user friendly.
Is there a way to know what .strm file the user wants to play/ is playing at the moment??
If not, I would like to ask a feature request. Either:
- implement a xbmc.player.getSelectedFile method (or xbmc.player.getOriginalFile method, name isn't important for me), that would return the original ".strm" file, not the "bluray://udf..." file.
- some other way that would allow me to accomplish the same...
At the moment I'm stuck because I don't know how to get the .strm filename...
Please comment...