Jump to content

NotificationTypeInfo


mutu310

Recommended Posts

mutu310

I noticed that the Variables property in NotificationTypeInfo has changed from List<string> to string[] in the latest NuGet and this is going to break my code and I'd have to branch once again if you release this in a new version. Was this change really that necessary?

Edited by mutu310
Link to comment
Share on other sites

mutu310

I noticed that the Variables property in NotificationTypeInfo has changed from List<string> to string[] in the latest NuGet and this is going to break my code and I'd have to branch once again if you release this in a new version. Was this change really that necessary?

 

In fact, this change has broken notifications in BlurN in the current Emby Server beta build.

Edited by mutu310
Link to comment
Share on other sites

mutu310

It just got worse.

 

It broke between 3.2.27.0 and the beta (3.2.27.3 to 3.2.28.1) because List<string> got changed to string[]

 

And I made the code work with both List<string> and string[] but it still needed to be branched and compiled under different NuGet package versions. And so I did, and it was working in 3.2.27.0 and 3.2.28.1 beta. Then 3.2.28.0 stable came out, and suddenly the notifications it's outputting are blank. The latest beta 3.2.28.2 is still working, it's the stable which is broken. Here's my code: https://github.com/MarkCiliaVincenti/MediaBrowser.Channels.BlurN/blob/master/MediaBrowser.Channels.BlurN/Helpers/BlurNNotificationType.cs

 

I'm starting to get discouraged from developing further for Emby since it seems every version that comes out I have to make workarounds for the lack of backward compatibility with the NuGet packages and branch off different versions, and it's getting tedious. I already have a branch for 3.2.26.0, a branch for 3.2.27.0 and a branch for 3.2.28.0 (which works for beta but not for stable). @@ebr and @@Luke please take notice and advice accordingly.

Edited by mutu310
Link to comment
Share on other sites

Apologies. the nuget package is a little ahead of the stable server and we don't have separate nuget branches for the two, so i realize it can be confusing. breaking changes are not the norm but will happen every once in a while, particularly now while everything is being re-evaluated as we move to .net core.

Link to comment
Share on other sites

mutu310

Apologies. the nuget package is a little ahead of the stable server and we don't have separate nuget branches for the two, so i realize it can be confusing. breaking changes are not the norm but will happen every once in a while, particularly now while everything is being re-evaluated as we move to .net core.

 

Thanks for the apology but my problems/questions are still not answered. I understand things can get messy with .NET Core (wasn't aware of the change), but what is the way forward with this issue please?

Link to comment
Share on other sites

Outsider looking in. Maybe returning IEnumerable (for the interface) would be better?

 

For methods yes, and we generally already do that, but not for object properties.

Link to comment
Share on other sites

mutu310

In lieu of nuget packages for stable what you could do is grab stable from here: https://github.com/MediaBrowser/Emby/releases/tag/3.2.28.0

 

Then temporarily have your plugin reference the assemblies from that install and push out a plugin update against that.

 

OK:

 

Step 1) I downloaded the source code from that link.

Step 2) Loaded the project in Visual Studio 2017 and rebuilt the MediaBrowser.Controller project

Step 3) Created a new branch from the BlurN master branch

Step 4) Removed the NuGet packages from BlurN

Step 5) Added references to MediaBrowser.Common.dll, MediaBrowser.Controller.dll and MediaBrowser.Model.dll found in the bin\Debug folder of the MediaBrowser.Controller project

Step 6) Rebuilt my solution and saved the DLL file to the plugin

Step 7) Started up Emby 3.2.28.0 stable

Step 8) Watched in horror as the problem is reproducible

Step 9) Came here to rant.

 

I invite you to check what you did in version control because something got broken while releasing the new stable. The notifications are coming in empty.

 

599c60369e547_frustration.png

 

It was working in 3.2.26.0.

It was working in 3.2.27.0.

It was not working in 3.2.27.3 BETA all the way to 3.2.28.1, but that was because List<string> was changed to string[], and after I made my code work with both versions it was working.

Then 3.2.28.0 stable came out and notifications are not working

In the meantime 3.2.28.2 beta is still working.

Link to comment
Share on other sites

rhodges

Edit: I take back my edit. I am updated with the latest NuGet and do indeed run into a similar interface issue:

2017-08-22 13:04:18.674 Error App: Error creating HomeApi.Emby.Plugin.Api.EpisodeController
	*** Error Report ***
	Version: 3.2.28.0
	Command line: C:\Users\Administrator\AppData\Roaming\Emby-Server\System\MediaBrowser.ServerApplication.exe
	Operating system: Microsoft Windows NT 6.2.9200.0
	64-Bit OS: True
	64-Bit Process: True
	Processor count: 8
	Program data path: C:\Users\Administrator\AppData\Roaming\Emby-Server
	Application directory: C:\Users\Administrator\AppData\Roaming\Emby-Server\System
	SimpleInjector.ActivationException: No registration for type EpisodeController could be found and an implicit registration could not be made. Method not found: 'MediaBrowser.Model.Globalization.CultureDto[] MediaBrowser.Model.Globalization.ILocalizationManager.GetCultures()'. ---> System.MissingMethodException: Method not found: 'MediaBrowser.Model.Globalization.CultureDto[] MediaBrowser.Model.Globalization.ILocalizationManager.GetCultures()'.
	   at HomeApi.Emby.Plugin.Api.BaseController..ctor(ILogger logger, ILibraryManager libraryManager, IUserManager userManager, IUserDataManager userDataManager, ILocalizationManager localizationManager)
	   at HomeApi.Emby.Plugin.Api.EpisodeController..ctor(ILogger logger, ILibraryManager libraryManager, IUserManager userManager, IUserDataManager userDataManager, ILocalizationManager localizationManager)
	   at lambda_method(Closure )
	   at SimpleInjector.InstanceProducer.BuildAndReplaceInstanceCreatorAndCreateFirstInstance()
	   at SimpleInjector.InstanceProducer.GetInstance()
	   --- End of inner exception stack trace ---
	   at SimpleInjector.InstanceProducer.GetInstance()
	   at SimpleInjector.Container.GetInstanceForRootType(Type serviceType)
	   at SimpleInjector.Container.GetInstance(Type serviceType)
	   at Emby.Server.Implementations.ApplicationHost.CreateInstanceSafe(Type type)
	SimpleInjector.ActivationException
	   at SimpleInjector.InstanceProducer.GetInstance()
	   at SimpleInjector.Container.GetInstanceForRootType(Type serviceType)
	   at SimpleInjector.Container.GetInstance(Type serviceType)
	   at Emby.Server.Implementations.ApplicationHost.CreateInstanceSafe(Type type)
	InnerException: System.MissingMethodException
	System.MissingMethodException: Method not found: 'MediaBrowser.Model.Globalization.CultureDto[] MediaBrowser.Model.Globalization.ILocalizationManager.GetCultures()'.
	   at HomeApi.Emby.Plugin.Api.BaseController..ctor(ILogger logger, ILibraryManager libraryManager, IUserManager userManager, IUserDataManager userDataManager, ILocalizationManager localizationManager)
	   at HomeApi.Emby.Plugin.Api.EpisodeController..ctor(ILogger logger, ILibraryManager libraryManager, IUserManager userManager, IUserDataManager userDataManager, ILocalizationManager localizationManager)
	   at lambda_method(Closure )
	   at SimpleInjector.InstanceProducer.BuildAndReplaceInstanceCreatorAndCreateFirstInstance()
	   at SimpleInjector.InstanceProducer.GetInstance()
	   at HomeApi.Emby.Plugin.Api.BaseController..ctor(ILogger logger, ILibraryManager libraryManager, IUserManager userManager, IUserDataManager userDataManager, ILocalizationManager localizationManager)
	   at HomeApi.Emby.Plugin.Api.EpisodeController..ctor(ILogger logger, ILibraryManager libraryManager, IUserManager userManager, IUserDataManager userDataManager, ILocalizationManager localizationManager)
	   at lambda_method(Closure )
	   at SimpleInjector.InstanceProducer.BuildAndReplaceInstanceCreatorAndCreateFirstInstance()
	   at SimpleInjector.InstanceProducer.GetInstance()
Edited by rhodges
Link to comment
Share on other sites

rhodges

@@mutu310 You don't need to download the source or anything. Just installed 3.2.28.0 stable and then reference the dlls out of the install directory. I just did that and got my personal plugin back up and running.

Link to comment
Share on other sites

mutu310

@@mutu310 You don't need to download the source or anything. Just installed 3.2.28.0 stable and then reference the dlls out of the install directory. I just did that and got my personal plugin back up and running.

Are you using a new notificationtypeinfo though? Can you link me to your code please? I posted a link to mine earlier in this thread.
Link to comment
Share on other sites

rhodges

Are you using a new notificationtypeinfo though? Can you link me to your code please? I posted a link to mine earlier in this thread.

No, not using that, sorry. I just had some other interface issues that I could not resolve (and not build) until I removed the nuget packages and just linked directly to the installed binaries.

Link to comment
Share on other sites

mutu310

No, not using that, sorry. I just had some other interface issues that I could not resolve (and not build) until I removed the nuget packages and just linked directly to the installed binaries.

Then your issue is completely different to mine. Mine isn't even crashing, just sending empty notifications.
Link to comment
Share on other sites

mutu310

No, not using that, sorry. I just had some other interface issues that I could not resolve (and not build) until I removed the nuget packages and just linked directly to the installed binaries.

Then your issue is completely different to mine. Mine isn't even crashing, just sending empty notifications.
Link to comment
Share on other sites

mutu310

This is still unresolved and now I have a new bug report with the latest stable. This moving of goalposts with every release is driving me mad. Can't you please come up with a better plan to try and keep things as backwards compatible as possible? At least mark methods as obsolete or something and phase them out slowly?

Link to comment
Share on other sites

In a strongly typed language it is not always that easy. I apologize for the recent frequency of changes, it is simply due to working towards achieving triple compatibility with the .net framework, mono, and the new .net core. Luckily at this point most of the heavy lifting is done.

Link to comment
Share on other sites

mutu310

In a strongly typed language it is not always that easy. I apologize for the recent frequency of changes, it is simply due to working towards achieving triple compatibility with the .net framework, mono, and the new .net core. Luckily at this point most of the heavy lifting is done.

Is there a way I can get the pre-.NET Core version working though?
Link to comment
Share on other sites

Yes, instructions are in the topic about updated plugin docs. The nuget package for .net core is a beta nuget package so you can use the non-beta nuget package for the stable server.

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...