Jump to content

Need Help Creating a Plugin


Recommended Posts

thejacer87
Posted

the docs/wiki seem to be non-existant. can someone help me out with some info. I want to convert this plex plugin to emby, but have no idea where to start. Thanks

Posted

then you'll probably want to look at one of the existing channel plugins as an example.

thejacer87
Posted

thanks luke,

serious question: how do you get anything done? it seems like everytime i post an issue you reply in 5 minutes

Posted

that should be fine.

Posted

The best place for discussion is right here in the Emby Community where others can participate and search information. Visual Studio Community is free now by the way.

thejacer87
Posted (edited)

The best place for discussion is right here in the Emby Community where others can participate and search information. Visual Studio Community is free now by the way.

 

on linux? i know visual studio code is free, but that doesnt seem to be the same thing. i assume the plugins need to be compiled in visual studio. so the only option i have i think is mono develop, which i had trouble getting configured properly, but was able to contribute to Radarr. So ya, if anyone could help me get it setup in mono that'd be great. :)

 

 

edit: the wiki also says to download emby server core in the PM Console... is that something different than the my actual server? would i be able to just test the plugin on my working server?

Edited by thejacer87
Posted

Correct you can use your working installed server.

thejacer87
Posted

k well, if anyone can chime in with a linux dev environment lemme know. i will look into it tonight/tomorrow

thejacer87
Posted (edited)

 ok so i seem to have been able to get it started...

 

i was able to do most of the steps in the wiki. I was able to create the PCL, install the nuget package, and created the plugin classes. I am able to build it with no errors.

However, I can't see how to generate the guid in Assembly.cs. Also it doesn't look like md has post build events. So I will just have to copy them over myself manually. 2 problems:

  • I don't know what/which file(s) were made in the build process.
  • And I don't know where to copy it to. My emby server is on a different computer than my dev environment. Shouldn't be an issue, but I still don't know where to put it. - also, i am running emby-server on debian. so i dunno if that changes the location of the plugins 

post-159320-0-16078500-1491028128_thumb.png

Edited by thejacer87
thejacer87
Posted

Correct you can use your working installed server.

 

so it looks like the only thing on the server for the plugins are .dll files. 

 

thejacer87:/var/lib/emby-server/plugins$ ls
AutoBoxSets.dll  configurations  Emby.Kodi.SyncQueue.dll  MBBackup.dll

 but when i build the project in md, I can't see any dll files generated. 

 

Any ideas?

  • Like 1
Posted (edited)

You need to put the plugin dll in the folder called "plugins"

 

It is in the server root. I dunno where that is on Linux.

 

There are two classes that are important when making plugins.

 

The "plugin" class

And

The "PluginConfiguration" class

 

Do you have those files generated in your dll?

Edited by chef
thejacer87
Posted (edited)

You need to put the plugin dll in the folder called "plugins"

 

It is in the server root. I dunno where that is on Linux.

 

There are two classes that are important when making plugins.

 

The "plugin" class

And

The "PluginConfiguration" class

 

Do you have those files generated in your dll?

 

 

that was the problem, i didn't know where the dll is. I've literally never made a c# project b4. I went into every folder in the project and finally found the dll in bin folder. 

 

i've moved it to /var/lib/emby-server/plugins, which is where the other 2 dll of the plugins i have installed. should that be where i put my plugin?

 

i do have both of those classes made like the wiki says. I just tried restarting the server with my plugin and didn't see anything in the plugins section of the server

Edited by thejacer87
  • Like 1
Posted (edited)

The dll will build itself in "bin/debug/{pluginName}.dll

 

Yes! Place your plugin dll in that folder :)

 

 

 

Remember that you should increase the version number of your plugin each time you build it, otherwise the server will not load the newest version.

 

Easiest way to do this is to find the file called "AssembyInfo" in your Solution Explorer.

 

Change the line:

[assembly: AssemblyVersion("1.0.0.0")]

 

To:

 

[assembly: AssemblyVersion("1.0.*)]

 

 

This will auto update the version number.

 

 

Are you using Visual Studio?

Edited by chef
thejacer87
Posted

Are you using Visual Studio?

no, as i mentioned in an earlier post, i'm using linux, therefore monodevelop (md) IDE.

 

it seems like it should build everything ok, i was able build/develop a different project a month or so ago. md had the option for a PCL project and was able to get nuget project easily. So i think itll work fine for what im doing.

 

i did have the 1.0* like you mentioned in the assembly.cs. but i can't figure out how to generate the guid in md. can i just make that up for now? i think (hope) thats the only issue right now

  • Like 1
Posted

no, as i mentioned in an earlier post, i'm using linux, therefore monodevelop (md) IDE.

 

it seems like it should build everything ok, i was able build/develop a different project a month or so ago. md had the option for a PCL project and was able to get nuget project easily. So i think itll work fine for what im doing.

 

i did have the 1.0* like you mentioned in the assembly.cs. but i can't figure out how to generate the guid in md. can i just make that up for now? i think (hope) thats the only issue right now

Yes, the GUID is important for when you add web page configuration to your project. It is used to update the plugin configuration.

 

Good luck! I'm interested in how you get along! Building plugins in Mono sounds cool!

thejacer87
Posted

Yes, the GUID is important for when you add web page configuration to your project. It is used to update the plugin configuration.

 

Good luck! I'm interested in how you get along! Building plugins in Mono sounds cool!

 

k so for the guid, can i just make it up though? or does VS do something fancy behind the scenes with it?

Posted (edited)

k so for the guid, can i just make it up though? or does VS do something fancy behind the scenes with it?

Yes, I believe you can create your own.

 

As long as the GUID from your assembly matches the one In your JavaScript config HTML page it should work okay.

Edited by chef
  • Like 1
thejacer87
Posted

awesome thanks... ill be working on it tonight. so expect some more questions!!!

  • Like 1
thejacer87
Posted

hey! it worked!

 

58e06efaecf34_Screenshotfrom201704012023

 

now to start programming!

  • Like 1
Posted

hey! it worked!

 

58e06efaecf34_Screenshotfrom201704012023

 

now to start programming!

 

Well done!

thejacer87
Posted

so i'm just trying to get the plugin setup with a config page. i put the plugin on github: https://github.com/thejacer87/Emby_LazyMan if anyone wants to take a look. i am just trying to copy the iptv plugin. i feel like i've got everything lined up right, but the plugin configuration page doesn't load.

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