Jump to content
emveepee

New plugin for NextPVR

Recommended Posts

Luke

Ok I started test this and was able to run both dll's together until I tried to update the setting with the "original" version,  it errors out with

System.InvalidOperationException: System.InvalidOperationException: There was an error generating the XML document. ---> System.InvalidCastException: [A]MediaBrowser.Plugins.NextPvr.Configuration.PluginConfiguration cannot be cast to [B]MediaBrowser.Plugins.NextPvr.Configuration.PluginConfiguration. Type A originates from 'MediaBrowser.Plugins.NextPvr, Version=3.3.1.0, Culture=neutral, PublicKeyToken=null' in the context 'Default' in a byte array. Type B originates from 'MediaBrowser.Plugins.NextPvr, Version=3.3.3.0, Culture=neutral, PublicKeyToken=null' in the context 'Default' in a byte array.
	   at Microsoft.Xml.Serialization.GeneratedAssembly.XmlSerializationWriterPluginConfiguration.Write4_PluginConfiguration(Object o)

Do I have to change the package name or assemby name too?

 

Ok I tried those and no luck.  Does the namespace also have to change?

 

Edit I am thinking it does because of linking

 

public IEnumerable GetPages() to Configuration.configPage.html

 

 

Martin

 

I wouldn't have expected this to matter, but you could try a different namespace. What do you mean by linking? Are you saying one plugin is adding the other as a reference? That won't be possible.

Share this post


Link to post
Share on other sites
Luke

We will see what Luke says, but it think it's deprecated. At least in the context of the recording channel, especially when your recording changes are some kind of event driven.

 

Prior to 4.1 we used to only refresh recordings on demand, but if you try to do this in the UI and it's too slow, users complain. And if the back-end is unreachable, it can stall the Emby UI. So I just ripped it out in favor of a periodic background refresh.

 

That means it will refresh repeatedly all day long whether there are changes or not, but this can be controlled inside the plugin. I gave all of the plugins a straight 15 minute interval, as well as added sample code to trigger a refresh when changes are made.

Share this post


Link to post
Share on other sites
Luke

I wonder if it relate to these unused event handlers

 

        public event EventHandler DataSourceChanged;

 

        public event EventHandler RecordingStatusChanged;

 

Martin

 

DataSourceChanged will refresh the channels and programs. RecordingStatusChanged is no longer used because recordings are now just piggybacking into the channels framework, which allows media to be pulled in from arbitrary remote sources.

Share this post


Link to post
Share on other sites
emveepee

I wouldn't have expected this to matter, but you could try a different namespace. What do you mean by linking? Are you saying one plugin is adding the other as a reference? That won't be possible.

In the quoted error you can see both versions of the plugin are refrerence in the error.   Changing the namespace solved my issues.

 

Martin

Share this post


Link to post
Share on other sites
emveepee

Prior to 4.1 we used to only refresh recordings on demand, but if you try to do this in the UI and it's too slow, users complain. And if the back-end is unreachable, it can stall the Emby UI. So I just ripped it out in favor of a periodic background refresh.

 

That means it will refresh repeatedly all day long whether there are changes or not, but this can be controlled inside the plugin. I gave all of the plugins a straight 15 minute interval, as well as added sample code to trigger a refresh when changes are made.

 

Ok I will see how my change works out in reality.  It is triggered by a backend notification so that unreachable issue hopefully won't be too bad.  I'd like to figure out how to avoid this update during video playback.

 

Caching the allRecordings return makes all the difference for me for speed.  It might have been a bug in the v4 plugin but it was called for each series and each Is.. items so I went from 32 calls to the backend to 1 and my update is a few seconds from 45 seconds in v4.

 

Martin

Share this post


Link to post
Share on other sites
emveepee

DataSourceChanged will refresh the channels and programs. RecordingStatusChanged is no longer used because recordings are now just piggybacking into the channels framework, which allows media to be pulled in from arbitrary remote sources.

Ok so that red recording indicator is just a bug related to plugins?

 

Martin

Share this post


Link to post
Share on other sites
pünktchen

Caching the allRecordings return makes all the difference for me for speed. It might have been a bug in the v4 plugin but it was called for each series and each Is.. items so I went from 32 calls to the backend to 1 and my update is a few seconds from 45 seconds in v4.

No bug in the version 4 plugin. It's a bad server design for channel items.

 

Something similar happens with unnecessary timer calls in the "On Now" live tv screen.

Share this post


Link to post
Share on other sites
pünktchen

Ok so that red recording indicator is just a bug related to plugins?

 

Martin

You can call it a bug or just missing love for the live tv plugins. The plugins don't generate much money.

Also the indication for currently running recordings under schedules and in the dashboard is brocken since Emby v4 for the plugins. It was also shortly brocken for Emby's core live tv, but this got a fix of course.

Share this post


Link to post
Share on other sites
emveepee

Ok I will call it an issue and report it on github.  It is similar to the list of upcoming scheduled recording not having an info on what the the recording is other than the name you have to open the item to see the series episode info.

 

Martin

Share this post


Link to post
Share on other sites
Luke

Happy to help resolve them. Thanks.

Share this post


Link to post
Share on other sites
emveepee

Is there anyway to throw an exception that will tell Emby to disable the NextPVR plugin if it is connected to the wrong version?  Also can I send a notification somehow that isn't just to the log?  I tried to figout out how to return a LiveTvServiceStatusInfo Task I couldn't see that.

 

Martin

Edited by emveepee

Share this post


Link to post
Share on other sites
Luke

Yea just have all of the public facing methods throw an exception. The core will catch and handle them.

Share this post


Link to post
Share on other sites
emveepee

Definitely I kept with the style of the existing plugin and the exception is logged, but I was hoping for a better user experience if I could write to the dashboard or something.  Also when Emby loops back on the timer it will just silently fail even with valid user authentication with there is a plugin backend mismatch.  If reporting exceptions would be difficult to implement in the future It would be nice to signal an alert that a new or different version of a plugin is available.  

 

I know I could have the plugin version aware but every call to the backend has changed and every json response uses mostly different field names and types and for the limited number of users it wasn't worth it.   After the beta period the only significant reason to stick with NextPVR v4 I see at this time is the analog tuner support.

 

Another thing that will probably help is updating the catalog with the information of the backend required.  Is this something I can do through github?

 

Finally unrelated to the distribution are non-movie recording images supposed to be poster or landscape? 

 

Martin

Edited by emveepee

Share this post


Link to post
Share on other sites
Luke

The catalog can be updated on our admin site. I can take care of the existing plugin to indicate v4 only. When the v5 plugin is ready we'll give you access and you can manage that listing.

 

Ideally non movie recording images would be landscape.

Share this post


Link to post
Share on other sites
emveepee

The catalog can be updated on our admin site. I can take care of the existing plugin to indicate v4 only. When the v5 plugin is ready we'll give you access and you can manage that listing.

 

Ideally non movie recording images would be landscape.

Thanks a lot that sounds like a plan.

 

Landscape does look better on recording lists, but not as nice on the details popup, so I didn't know which to choose.

 

Martin

Share this post


Link to post
Share on other sites
emveepee

NextPVR currently does not support episode art.  I pass the same URL for the image landscape art for the recording but it seems the hash used to create the cached metadata doesn't care and Emby downloads the same image again.  Can this be avoided?

 

Martin

Share this post


Link to post
Share on other sites
Luke

Currently no, but I can try to look at that soon.

Share this post


Link to post
Share on other sites
emveepee

Thanks I will be glad to test the change.

 

Martin

Share this post


Link to post
Share on other sites
emveepee

Is there a way to get a unique guid or other identifier for an Emby server instance?

 

Martin

Share this post


Link to post
Share on other sites
Luke

Is there a way to get a unique guid or other identifier for an Emby server instance?

 

Martin

 

Yes. Add MediaBrowser.Common.IApplicationHost to the constructor of your ILiveTVService, then you can use appHost.SystemId.

Share this post


Link to post
Share on other sites
emveepee

Thanks Luke that works.

 

 

Martin

Share this post


Link to post
Share on other sites
emveepee

Regarding the refresh guide I am having a nightmare dealing with the slow deletes from database of all thousands of metadata files the don't exist.   When I delete the type 27 records from the mediaitems table and delete the metadata livetv folder my refresh guide is 3 to 4 minutes.  Letting Emby manage this takes one hour. 

 

Is there some way this can be optimized?  If not I would be happy to have a go at a standalone utility to do this quicker.  Is the folder in livetv just the value from the GUI field or does it come from somewhere else.

 

 

Martin

Share this post


Link to post
Share on other sites
Luke

It currently deletes them all one at a time. I'm going to be looking at handling that in bulk soon. Thanks.

Share this post


Link to post
Share on other sites
emveepee

Ok thanks it looks like cleaning up "real" metadata for NextPVR is pretty easy

 

select userDataKey,images,* from mediaitems
where type =27 and images like '%%Metadata%'
and parentid in
(select id from mediaitems where type = 28 and ProviderIds like '%NextPVR%')

 

will find the ones to purge and then everything can be bulked.

 

If you get dragged down I will work something out.

 

Martin

Edited by emveepee

Share this post


Link to post
Share on other sites
Luke

This should be considerably faster for the next release. thanks.

Share this post


Link to post
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...