Jump to content

Looking for a code review


Recommended Posts

HawkXP71
Posted

I have a plugin in mind, but in order to learn how to develop it, I have been essentially re-creating an existing plugin.

Essentially I am re-creating the statistics plugin, and rather than storing everything in a XML configuration file, I am using an sqlite db

I am having some weird failures.  

If anyone is up for a code review, it would be most appreciated.

TIA
Scott

 

Posted

Where is the code?

  • Like 1
Posted
7 hours ago, HawkXP71 said:

I have a plugin in mind, but in order to learn how to develop it, I have been essentially re-creating an existing plugin.

Essentially I am re-creating the statistics plugin, and rather than storing everything in a XML configuration file, I am using an sqlite db

I am having some weird failures.  

That's not a surprise. Plugins need to be self-contained. They cannot have any references of their own, because it's solely the plugin dll's code which is loaded into the Emby Server process, so whatever SQLite libraries you have (presumably) added to your plugin as nuget packages won't be looaded. Emby Server uses SQLite itself, but through customized libraries. Some of your code's references may get redirected to Emby's customized implementation which have different behavior than the ones you are probably developing against.

This would exactly create something like "weird failures".

HawkXP71
Posted
10 hours ago, softworkz said:

That's not a surprise. Plugins need to be self-contained. They cannot have any references of their own, because it's solely the plugin dll's code which is loaded into the Emby Server process, so whatever SQLite libraries you have (presumably) added to your plugin as nuget packages won't be looaded. Emby Server uses SQLite itself, but through customized libraries. Some of your code's references may get redirected to Emby's customized implementation which have different behavior than the ones you are probably developing against.

This would exactly create something like "weird failures".

Unfortunately that makes sense :(

Is there an exposed ISQLManager ???? Im using the same SQL interface used in the playback_reporting plugin

Posted
6 minutes ago, HawkXP71 said:

Unfortunately that makes sense :(

Is there an exposed ISQLManager ???? Im using the same SQL interface used in the playback_reporting plugin

I didn't mean to say it can't be done, that was just the most likely explanation.

If the playback reporting plugin can do it, you should be able to do that as well. 

From a quick look:

  • Downgrade System.Memory to 4.6.0
  • Remove Emby.ApiClient package
    (not needed, might contain conflicting types)

Then start by trying to do the same what the playback_reporting plugin does

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