Jump to content

Demand loading


Damstas

Recommended Posts

emveepee

I would have gladly provided the change (most of it is in my post above) if it meant streamlining NEWA's web service

 

The line https://github.com/MediaBrowser/Emby.Plugins/blob/master/MediaBrowser.Plugins.NextPvr/Responses/ListingsResponse.cs#L54

 

ImageUrl = string.IsNullOrEmpty(epg.FanArt) ? null : (_baseUrl + "/" + epg.FanArt),

 

changes to

 

ImageUrl = string.IsNullOrEmpty(epg.FanArt) ? null : (_baseUrl + "/service?method=channel.show.artwork&event_id=" + Id),

 

Also hasImage will either need to be set to true or Emby rethink this to have some internal table check when art returns 404

 

Martin

Edited by emveepee
Link to comment
Share on other sites

Sure, if you want to make the change, or give Sven help making the change, I guess we can leave the EPG data as it was.

Link to comment
Share on other sites

emveepee

I just added it above, you can check it if you'd like, I'm not sure if you require a sid on this call or not, if so &sid=MB3 can be added.

 

Martin

Link to comment
Share on other sites

Does Emby have a sid for communicating with the backend? If so, it'd be best to include the real sid (since outside-of-lan access will require it etc).

Link to comment
Share on other sites

emveepee

It does in the main class https://github.com/MediaBrowser/Emby.Plugins/blob/master/MediaBrowser.Plugins.NextPvr/LiveTvService.cs#L37 but since emby is a back-end server anyway I don't think it should ever be run on a different subnet. It could be passed down via the Guide class I guess.

 

Martin

Edited by emveepee
Link to comment
Share on other sites

If you can't supply a real sid, then I guess that'd be ok. If you can though, then you should use the real sid.

Edited by sub3
Link to comment
Share on other sites

What's then the difference with the normal epg image and the demand loading.

From the moment when we update the epg and a picture is available. It should be availble for emby. No?

Link to comment
Share on other sites

emveepee

OndDemand loading allows emby to potentially get images for many of the shows in the guide, not just recordings. It all depends on the quality of the guide data naming for your shows and movies, and it is always better with American network shows and movies. The big downside is if emby calls them for each show there might be a 500ms or more penalty fetching the cover. If the grid has many items, this time can add up.

 

 

The challenge for emby is your hasImage is boolean and doesn't have the state for unknown. Once they are pulled they are cached in NextPVR but only if they exist.

 

 

If you turn off metadata downloading in NextPVR then on-demand works pretty much the same way as UJB's method only returning images from the NextPVR cache. I think UJB gets filename.jpg, I am not sure if sub does. The big problem there is the cache doesn't be filed for recording using NextPVR's built in fetch and your hasImage issue continues.

 

 

Martin

Edited by emveepee
Link to comment
Share on other sites

OndDemand loading allows emby to potentially get images for many of the shows in the guide, not just recordings. It all depends on the quality of the guide data naming for your shows and movies, and it is always better with American network shows and movies. The big downside is if emby calls them for each show there might be a 500ms or more penalty fetching the cover. If the grid has many items, this time can add up.

 

 

The challenge for emby is your hasImage is boolean and doesn't have the state for unknown. Once they are pulled they are cached in NextPVR but only if they exist.

 

 

If you turn off metadata downloading in NextPVR then on-demand works pretty much the same way as UJB's method only returning images from the NextPVR cache. I think UJB gets filename.jpg, I am not sure if sub does. The big problem there is the cache doesn't be filed for recording using NextPVR's built in fetch and your hasImage issue continues.

 

 

Martin

 

The guide updates is a scheduled task. So you don't see that delay.

Link to comment
Share on other sites

emveepee

As a scheduled task it only returns the url, will emby also make the call to fetch each url? I don't know how many epg entries you have but I have 55k and less than half will have images, most will have images that I never will see.

 

If you are planning that, wouldn't it make sense for you to call your emby class TvdbSeriesProvider and TvdbSeriesImageProvider

 

Martin

Edited by emveepee
Link to comment
Share on other sites

What's then the difference with the normal epg image and the demand loading.

From the moment when we update the epg and a picture is available. It should be availble for emby. No?

Currently you're only getting artwork in Emby for your EPG entries if NextPVR already has in it's cache. That artwork will only be in it's cache if NextPVR has recorded it, or if the user has viewed the details of a show in the NextPVR tv guide.

 

By adding the demand loading discussed above, if Emby askes for the artwork, and it's not already in the cache, NextPVR go out and look for the artwork and download it to it's cache, and returns a copy to Emby.

 

NextPVR can't just include a URL to the artwork (somewhere out in the internet) when you ask for the EPG, since it usually doesn't have this information. It doesn't know where that artwork is or even if any artwork exists for the show. It has to actively go out and query for that artwork. This is an relatively expensive activity, so NextPVR only does it when it needs to. ie, if you've got 60 thousand listings, but you're only going to view the details of a couple of dozen shows, then it's only going download the artwork for that couple dozen shows. With any luck, Emby is a friendly citizen, and also only access the artwork of those shows it's activity doing stuff with (not just trying to download artwork for 60 thousand listings).

 

Hopefully that makes sense?

Link to comment
Share on other sites

Great. That should be fine then.

 

When you later call that url, you'll either get the artwork instantly (if already in the cache), or it'll take a little longer as it attempts to dynamically find the artwork from the internet (and will cache, giving quicker access next time around).

Edited by sub3
Link to comment
Share on other sites

UncleJohnsBand

I am working on updating the NEWA JSON inerface to work as follows....

 

There is a new art API that returns the image

 

the fanart atribute on the epgeventobject will always be populated

 

the url for the fanart API will not pass any paramters into the call....which the defaults should deliver the desired functionality....

 

Howerver...there are two optional paramters that it can take in allowing retrieval of different artwork formats if desired and to override onDemand processing (i.e. only cached images).

 

The two optional query strings:
 
accessType=OnDemand or Cached - default with no querystring = onDemand   (ondemand returns cached if it exists...otherwise it goes and gets it)
 
artType=banner, episode, fan, landscape, logo, poster, season  - default with no querystring = poster (like it is today)

if there is no art found they a 404 not found is returned.

 

Let me know your thoughts....

Edited by UncleJohnsBand
Link to comment
Share on other sites

I think it would be great to get landscape image from Schedules Direct (and possibly fanart.tv aswell) demand loaded in to Emby just like the built in EmbyTV does with HDHomerun tuners. Posters would be only for movies. The issue right now is that the aspect ratio is 4:3.

Check this thread out: http://forums.nextpvr.com/showthread.php?57496-Landscape-art-from-Schedules-Direct

Edited by Damstas
Link to comment
Share on other sites

UncleJohnsBand

I belive with the upcomming release sub is going to also be looking at fanart.tv for art.  To do what you are asking you would modify the fanart url that is returned to includ ?artType=landscape at the end... if the image exists it is loaded from cache if not it will go out and attempt to download it.

 

So the fanart url is just the base url that gets either the requested episode art (if it exists) or falls back to poster art.  To get anything else just update the querystring at the end.

Link to comment
Share on other sites

Yeah, I suggested the fanart.tv addition :) The goal would be to have landscape from SD and fanart.tv, but NPVR only gets 4:3 aspect ratio and it should be wider.

rkulagow said this:

There shouldn't be anything that prevents use of any of the "assets/"

URIs that you see in the JSON image response, so I don't know if
that's a technical limitation on the NextPVR side. "

Edited by Damstas
Link to comment
Share on other sites

@@UncleJohnsBand Could you make Emby itself the priority for demand loading and for example if the movie can't be matched or doesn't have an artwork it will demand load that from Schedules Direct (NPVR). So first Emby's built in demand load and after it has finished this one you have built? :)

If the SD one from NPVR will be demand loaded first it will look funny if there would have been official artwork from TMDB, which Emby could have found.

I believe Emby is going to add TVDB lookout with episode images later, so it would be same with that too.

Please see this pic. https://flic.kr/p/zWgsuE

Edited by Damstas
Link to comment
Share on other sites

@@UncleJohnsBand Could you make Emby itself the priority for demand loading and for example if the movie can't be matched or doesn't have an artwork it will demand load that from Schedules Direct (NPVR). So first Emby's built in demand load and after it has finished this one you have built?

That would be up to the Emby guys if they wanted to implement something like this. All we can effect is what image it loads from NextPVR.  

Link to comment
Share on other sites

That would be up to the Emby guys if they wanted to implement something like this. All we can effect is what image it loads from NextPVR.  

Ok. One option could be to add an toggle to NPVR to allow it to load TVDB movie artwork first, before SD, or other way around.

Edited by Damstas
Link to comment
Share on other sites

  • 4 weeks later...

Hi @@Sven.

 

The demand load feature for artwork is now in the NPVR API. Could you add these features to the NPVR plugin aswell? Also: please use posters with movie, so that when user changes for example to landscape with demand load, it won't download landscape images for movies.

http://localhost:886...ice_for_events 

 

I'm also wondering whether the big fan art, which NPVR now downloads could be used in Emby DVR section in similar way Emby treats library items?

Here is a pic of what I mean:

https://flic.kr/p/C1dDBg

Edited by Damstas
Link to comment
Share on other sites

UncleJohnsBand

Hi @@Sven.

 

The demand load feature for artwork is now in the NPVR API. Could you add these features to the NPVR plugin aswell? Also: please use posters with movie, so that when user changes for example to landscape with demand load, it won't download landscape images for movies.

http://localhost:886...ice_for_events 

 

I'm also wondering whether the big fan art, which NPVR now downloads could be used in Emby DVR section in similar way Emby treats library items?

Here is a pic of what I mean:

https://flic.kr/p/C1dDBg

 

The url for API doc seems to not work correctly.... just go to the root of the API doc: http://localhost:8866/api/ then go to the UtilService and you will see the art/event API info.

 

The fanArt URL in the epgEventJSONObject is now pointing to the API.  It is defaulted to poster (no query string) but if you modify the url by adding the query sting value for the target art it will return it so long as the requested type is found.

Link to comment
Share on other sites

arrbee99

That's a bit of a pity, was getting some art to appear in the LiveTV section via NPVR a few days ago, but its disappeared again. Such is life.

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...