Jump to content

Plugin Registration Status on Front End


roaku

Recommended Posts

Does the Emby API or Javascript provide a way to get the registration status of a Plugin in the context of its Configuration page?

I'd like to add a hideable message to unregistered users describing the extra functionality that registering will provide.

Link to comment
Share on other sites

mickle026

You could do that live by connecting to your webserver periodically or on plugin load or even every page load and checking your reg key, like Emby does to check it has a premiere license?

ie save the reg key in your config file, then as the plugin loads, something simple like check it exists on your own webserver.  If it doesn't drop back to limited version.  That could be just a file or a db entry with your own api string..

ie If I had a reg key 1234567890, and that file didnt exist on my webserver https://www.myserver.com/checkreg?key=1234567890 , (bury the actual url with your php), then im not registered ...

You could also generate a unique machine id quite easily.  I actually do this one by detecting the OS, the machine name , the mac and then create a hash from it so that I can tell if the plugin is on my test server, then I dont need to fill in configs for that machine - lol :), but it gives a pretty unique finger print of that machine, you can do any hardware really, linux doesnt return values for some things though.

thats as simple as this

string MachineName = Environment.MachineName;
string MachineUserName = Environment.UserName;
string MachineOSVersion = Environment.OSVersion.ToString();
string MachineOSDesription = RuntimeInformation.OSDescription;

var macAddr =
                (
                    from nic in NetworkInterface.GetAllNetworkInterfaces()
                    where nic.OperationalStatus == OperationalStatus.Up
                    select nic.GetPhysicalAddress().ToString()
                ).FirstOrDefault();

Then create a md5 from however you use the info.  xor, and , concanate, whatever you want really.

 

Once some sortof  key is generated you can actually control how many machines have use of the license, rather than using an email address and it getting shared about.

I know this isnt quite what you have asked, but it would achieve the same goal. 

 

Not sure emby does any keeping of registered or unregistered on the local db.  I cannot say it doesn't but I wouldn't think it would.

Link to comment
Share on other sites

mickle026

I just read that you would like this in the catalog, and contating a reg server might violate the terms of allowing that ...

Link to comment
Share on other sites

mickle026

Ive posted that but raedons plugins are in the catalog and he must contact external domains to dowload themes and theme tunes..... so it probably just has to be reviewed that thats all it does.

Edited by mickle026
Link to comment
Share on other sites

Ya, I'm just talking about Emby's registration system.

And it's just for showing some text or not, so I can save a flag that the user has dismissed the message or something if there's no way to get the registration status on the front end.

It's not worth more effort than that.

Edited by roaku
Link to comment
Share on other sites

mickle026

so your not going to make it a purchase option for extended features?


What do you actually mean then by registration system?  What info do you need to get?  whether emby is premiere or not, or your plugin is registered ?

I think you can check hardware acceleration to tell if emby is premiere, as it would return a bool as  true ie premiere required if it wasnt registered. 

Same with LiveTV fuctions probably. public bool IsPremiere { get; set; } , MediaBrowser.Controller.LiveTv

im not 100% on this. 

 

Edited by mickle026
Link to comment
Share on other sites

Your configuration page should have access to this.  CoverArt does a similar thing now.  Been a while but I believe the key is to publish your own API in your plug-in that you can call from the config page.

  • Thanks 1
Link to comment
Share on other sites

4 minutes ago, ebr said:

Your configuration page should have access to this.  CoverArt does a similar thing now.  Been a while but I believe the key is to publish your own API in your plug-in that you can call from the config page.

Ah okay thanks.

 

Link to comment
Share on other sites

You could probably also simplify it by just including the information in the config returned by getPluginConfiguration...

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