Jump to content

PsuedoTV Live with Emby Server


flexage
 Share

Go to solution Solved by Lunatixz,

Recommended Posts

flexage

I was wondering if anybody had managed to successfully use the PsuedoTV Live Kodi addon, when using the Emby Kodi addon?

 

PTVL on Kodi Forums: http://forum.kodi.tv/showthread.php?tid=169032

 

I managed to get the PsuedoTV Live addon installed in Kodi, and configured some channels based around my local library content.

 

All works well except for one small, albeit devastating problem:

 

The duration of items in my guide is incorrect. For every 1 minute of runtime that a media item has, PsuedoTV Live is plotting 1 hour on the guide.

For example:
> A 21 min episode of 8 Simple Rules is showing as lasting 21 hours in the PTVL guide
> A 45 min episode of Breaking Bad is showing as lasting 45 hours in the PTVL guide
> A 120 min movie is showing as lasting 120 hours in the PTVL guide

 

Now PsuedoTV Live has a fairly large userbase, it's thread on the Kodi forums has over 10,000 posts. And a lot of people say that it works properly for them, and the items in their guide, although none of them mention that they're using Emby Server as their library backend.

 

Could the Emby for Kodi addon be doing something quirky when returning media files (and their header information: ie media duration) that PTVL doesn't expect? And has anyone else actually been able to get PTVL working with Emby?

 

 

Link to comment
Share on other sites

flexage

Whoops! I've accidentally posted this in the developer area... Could a mod please move it into the normal Kodi support area?

Link to comment
Share on other sites

Angelblue05

@@flexage

 

Which version of Kodi and Emby for Kodi are you using?

It will mostly depend on where PseudoTV looks for it's duration information in the Kodi database... I am not familiar with it, but it might be a question worth asking to the PseudoTV devs.

Edited by Angelblue05
Link to comment
Share on other sites

flexage

@@Angelblue05

 

I'm using the latest stable version of each.

 

I'm just installing Kodi, the Emby addon, and PsuedoTV Live on my workstation to see if the problem remains.

 

If so, I was going to pick through the PTVL scripts and see if I could whip up a patch to get it working.

 

It's been a while since I did any Python though, and I'm unfamiliar with the Kodi Addon API, but a little bit of duration manipulation doesn't seem like it would be too hard (famous last words)

Link to comment
Share on other sites

flexage

OK, I managed to make a fix, it wasn't too hard.

 

It was to do with the filename starting with the plugin prefix, the PTVL devs have put a clause in the code which attempts to convert the duration provided by plugins into seconds (multiply by 60) when the kodi version is 14 or greater.

 

In the case of the emby plugin, we do not this conversion to take place.

 

I'll post the fix below in case anyone else wants to use PseudoTV Live and is running into the same problem.

 

I'm posting instructions when running Kodi on windows, I'm not sure about the file paths on Mac or Linux (Ubuntu, Raspberry Pi's, Openelec, etc...)

First find the ChannelList.py file inside the PseudoTV Live Kodi addon:

%AppData%/Kodi/addons/script.pseudotv.live/resources/lib/ChannelList.py

Change Line 5037 from:

dur = self.durationInSeconds(dur)

to:

dur = dur


If you've done it right, the little block of code it lives in should look like:

    if file.startswith('plugin'):
        if dur == 0:
            dur = 3600
        else:
            # try and correct minutes to seconds
            dur = dur

 

When the plugin is updated, this file will be overwritten, so you will have to apply the fix again.

 

It might be worth contacting the PseudoTV Live developers and letting them know about this issue, I'm sure they could attempt to check if the plugin is Emby before falling back to multiplying the duration by 60.

Edited by flexage
  • Like 1
Link to comment
Share on other sites

flexage

@@Angelblue05

 

Nice work, thank you for making the PR and adding the code to check the plugin path, I wouldn't have known the correct path syntax to make that change.

 

Hopefully, Luna (the current PTVL dev) will appreciate that we did some groundwork on this one, and have no problem pulling in your change  ;)

 

Thanks again dude

  • Like 1
Link to comment
Share on other sites

  • Solution
Lunatixz

Ok, I did a pull request to fix this permanently. Now we wait.

 

https://github.com/PseudoTV/PseudoTV_Live/pull/9

Thanks for the request, but it won't be necessary that line of code was a workaround for a bug with Json (at some point it stopped reporting runtime in seconds and was returning minutes). Looks like it was cleared up... So I'll remove the conversion which should fix things.

  • Like 3
Link to comment
Share on other sites

Angelblue05

Thanks for the request, but it won't be necessary that line of code was a workaround for a bug with Json (at some point it stopped reporting runtime in seconds and was returning minutes). Looks like it was cleared up... So I'll remove the conversion which should fix things.

 

Awesome, thanks for the quick reply @@Lunatixz! :) 

Link to comment
Share on other sites

Guest
This topic is now closed to further replies.
 Share

×
×
  • Create New...