Jump to content

Allow to execute custom scripts on Emby events (e.g. on movie delete action)


booch

Recommended Posts

booch

Would be nice to have possibility to allow run custom scripts (e.g. Python, Bash) on some Emby events. At least for movie delete event from Movie details screen

 

For instance:

Add "Run script on movie delete action" field somewhere in administration page (empty by default). If path to script is defined then it will be executed with path to the deleted movie (or movie name) as first argument as soon as movie gets deleted from movie details screen.

 

Why I need this:

I have my own script with Prowl notifications.

I would like to run this script (and notify me) when somebody delete movie 

Also it can be logging script or whatever.

 

If it is possible to implement with a plugin - it would be nice as well

Edited by booch
  • Like 2
Link to comment
Share on other sites

Vidman

You would have a better chance of this being implemented if you can come up with a use case that does not facilitate in the use of pirated content

Edited by Vidman
Link to comment
Share on other sites

booch

You would have a better chance of this being implemented if you can come up with a use case that does not facilitate in the use of pirated content

No problem

 

I have my own script with Prowl notifications.

For instance run this script (and notify me) when somebody delete movie 

 

Also it can be logging script or whatever. I can easily invent lots of useful legal use cases.. 

 

BTW. Torrents are not necessary related to the pirated content only  ;)

Edited by booch
Link to comment
Share on other sites

Vidman

I know that, but your use case directly infers that it is for pirated content. ..am i wrong?

;)

Edited by Vidman
Link to comment
Share on other sites

booch

I know that, but your use case directly infers that it is for pirated content. ..am i wrong?

;)

 
You are completely wrong! I hate pirates. My brother is a sailor man and he hates them too! :)
Edited by booch
  • Like 2
Link to comment
Share on other sites

chef

@@booch

 

If you change you original post, and not mention anything that goes against Embys terms and conditions. There maybe ways to run scripts and executables when certain events happen in the server by writing a plugin..

Link to comment
Share on other sites

booch

@@booch

 

If you change you original post, and not mention anything that goes against Embys terms and conditions. There maybe ways to run scripts and executables when certain events happen in the server by writing a plugin..

done

Link to comment
Share on other sites

chef

So the plugin can use SessionManager to trigger events based on sessions (example: when a user logs in/out of a session, when playbacks stops etc.)

 

LibraryManager class also has events in it, and I am pretty sure changes to Libraray (ie. Removal of Libraray items) are there.

 

I will have to check to make sure, and I will get back to you :)

  • Like 1
Link to comment
Share on other sites

booch

I will have to check to make sure, and I will get back to you :)

Thank you very much! 

Link to comment
Share on other sites

This would be possible with a plug-in as there are many events that could be subscribed to.

 

However, I'm sure this will be the first plug-in we ask you to remove when performance problems are reported ;).

Link to comment
Share on other sites

booch

Do you mean that implementation itself would decrease performance or are you talking about scripts ?

Anyway looking forward for this feature :)

Link to comment
Share on other sites

chef

Sorry, I have the delete functions hooked up, but haven't written any interface. I have gotten busy at work.

 

I haven't forgotten.

Link to comment
Share on other sites

booch

@@chef

Thank you for your time!

Actually it is not necessary to create any UI, if it requires a lot of your time then just kind of configuration file where I can put path to the script would be enough for me :)

  • Like 1
Link to comment
Share on other sites

  • 2 weeks later...
  • 2 years later...
shred00

Did this every go anywhere?  I too would like to execute a custom action (that I will write as a script of some sort) trigger on a media item delete.

Link to comment
Share on other sites

  • 2 months later...

I would like to also add that this will be a very useful feature. Is this currently possible with a plugin or something?

 

I want to add a script where a deleted item is replaced by a zero size file with extension seen.

 

example

 

s01e01 episode1.mkv     100MB

s01e02 episode2.mkv     100MB

 

after you watch episode 1 and delete through server, I want to have

 

s01e01 episode1.seen    0MB

s01e02 episode2.mkv     100MB

Edited by Zodler
Link to comment
Share on other sites

I could see this being useful as asked by the OP but run the script FIRST before taking the action.

 

So for example Emby would call a listed script and it would run, then the action such as DELETE is done.

 

In this way you can setup a simple script to archive the file before Emby actually deleted it.

 

This type of EVENT SCRIPT would be useful for any action that could be destructively done by a user.

Link to comment
Share on other sites

You lead Devs are tricky... tricky. Plugin Architecture has changed again.

 

No more showing <script> tags in html to call the corresponding js files. instead, you are using "__plugin/" in a data-controller attribute. I think.... I hope....

Link to comment
Share on other sites

Okay, got the UI working... Finally... Geesh... Next is to wire up the backend.

 

I hope process.start works in .netcore...

Link to comment
Share on other sites

Just downloaded and added this plugin. Before I can write scripts, this only works for 4 events, right? Playback Started, Stopped, Session Started, Updated?

 

In that case, it is not useful for me. Can you add something for deletion?

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