Req expand xbmc.player class with getSelectedFile(...)
#1
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...
Add-on : Bluray iso utils Rewrite of BR_iso_enhancements
Add-on : BR_iso_Enhancements Give theatrical & directors cut from the same bluray iso each their own library entry, use bluray iso's of tv shows as if they are already ripped.
Reply
#2
Reads like a bad case of Kodi blackbox obfuscation. I dont know much about playlist but you could probably roll your own import to kodi player - playlist and modify the paths in the playlist as you like.
Reply
#3
(2016-03-07, 18:47)Torben Wrote: Reads like a bad case of Kodi blackbox obfuscation.

English isn't my first language, so I'll try to explain this in another way...

This request has nothing to do with any sort of obfuscation (look at the source (v0.0.4), it has plenty of comments (see sig)). It's all about extending Kodi with functionality that Kodi does not have at the moment (would love to see this in core Kodi, so I don't have to write the addon).

- a bluray iso contains a theatrical cut and an directors cut. Is it possible to have those 2 version in the Kodi libray (linking the files in the iso/not ripping the iso)?
- is it possible to use bluray iso's of TV shows and link these episodes to the files in the iso (linking the files in the iso/not ripping the iso)?
- is it possible to use external subtitles files with tv-episodes/movies that are located in a bluray iso?

As far as I know, the answer is no, at the moment it is not possible.

(2016-03-07, 18:47)Torben Wrote: I dont know much about playlist but you could probably roll your own import to kodi player - playlist and modify the paths in the playlist as you like.

I'm talking about a bluray playlist, this has nothing to do with a Kodi playlist.




So, I need to know the filename of the .strm file that Kodi is playing, not the filename contained in the .strm file, that kodi is playing (is returned with player.getPlayingFile()).

In other words:
"Z:\file.strm" contains "X:\movie.mov"
player.getPlayingFile() returns "X:\movie.mov"
I need "Z:\file.strm"

Is this somehow possibleHuh
Thanks
Add-on : Bluray iso utils Rewrite of BR_iso_enhancements
Add-on : BR_iso_Enhancements Give theatrical & directors cut from the same bluray iso each their own library entry, use bluray iso's of tv shows as if they are already ripped.
Reply
#4
Somewhere along the route from listing the file for the user to click on and on to the point where Kodi decides what ti actually play, the information you need have to be present?

What I would do, is to fill the listitem with the information you need and call bacl to a function that in turn passes the platlist-file to Kodi.

I dont know if that could work, or if I get the issue completely?

Btw. My talk about obfuscation was aimed at Kodi... as the information you want has to be oresent somewhere right?
Reply
#5
(2016-05-08, 14:18)Torben Wrote: Somewhere along the route from listing the file for the user to click on and on to the point where Kodi decides what ti actually play, the information you need have to be present?
What I would do, is to fill the listitem with the information you need and call bacl to a function that in turn passes the platlist-file to Kodi.
I dont know if that could work, or if I get the issue completely?

I looked at xbmcgui.ListItem, but I don't think this would help. As far as I can see, I would need to populate the listitem myself. This is not what I need, I need a hook that signals the user is now starting to look at a video .strm file. Also, I'm not writing a skin, but a service addon. It needs to work with all skins.

ATM I do the following:
I override the xbmc.player class and use the onPlayBackStarted event to see that the user started playback of a file.
I check if it is a video file
if so I check if it is a bluray iso file with "playlist" in the filename.
if yes, then I start the correct bluray playlist

Problem is the filename, getPlayingFile returns the filename inside the .strm file (the actual video file the player is playing), not the .strm file itself.


(2016-05-08, 14:18)Torben Wrote: Btw. My talk about obfuscation was aimed at Kodi... as the information you want has to be oresent somewhere right?

Yes, Kodi has to know the .strm filename so it can open it and look inside to play the referenced file. It's just that this information (as far as I know) is not available to the addon...
Hence this feature request...

I hope someone will add an extra property (StrmFileName) / method (getSelectedFile) to xbmc.player and put the .strm filename into this.
Add-on : Bluray iso utils Rewrite of BR_iso_enhancements
Add-on : BR_iso_Enhancements Give theatrical & directors cut from the same bluray iso each their own library entry, use bluray iso's of tv shows as if they are already ripped.
Reply

Logout Mark Read Team Forum Stats Members Help
expand xbmc.player class with getSelectedFile(...)0