Jump to content


Photo

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

automation custom scripts delete movie

  • Please log in to reply
39 replies to this topic

#1 booch OFFLINE  

booch

    Advanced Member

  • Members
  • 41 posts
  • Local time: 12:06 AM
  • LocationOdessa, Ukraine

Posted 16 May 2016 - 04:41 AM

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, 16 May 2016 - 08:20 AM.

  • ginjaninja and Zodler like this

#2 Vidman OFFLINE  

Vidman

    Advanced Member

  • Alpha Testers
  • 2701 posts
  • Local time: 06:06 AM

Posted 16 May 2016 - 05:54 AM

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, 16 May 2016 - 05:54 AM.


#3 booch OFFLINE  

booch

    Advanced Member

  • Members
  • 41 posts
  • Local time: 12:06 AM
  • LocationOdessa, Ukraine

Posted 16 May 2016 - 05:59 AM

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, 16 May 2016 - 06:00 AM.


#4 Vidman OFFLINE  

Vidman

    Advanced Member

  • Alpha Testers
  • 2701 posts
  • Local time: 06:06 AM

Posted 16 May 2016 - 06:14 AM

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

Edited by Vidman, 16 May 2016 - 06:14 AM.


#5 booch OFFLINE  

booch

    Advanced Member

  • Members
  • 41 posts
  • Local time: 12:06 AM
  • LocationOdessa, Ukraine

Posted 16 May 2016 - 06:20 AM

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, 16 May 2016 - 08:25 AM.

  • chef and cayars like this

#6 Vidman OFFLINE  

Vidman

    Advanced Member

  • Alpha Testers
  • 2701 posts
  • Local time: 06:06 AM

Posted 16 May 2016 - 06:22 AM

And as i said. ..i realise that
Kidding ;)

Edited by Vidman, 16 May 2016 - 06:22 AM.


#7 booch OFFLINE  

booch

    Advanced Member

  • Members
  • 41 posts
  • Local time: 12:06 AM
  • LocationOdessa, Ukraine

Posted 16 May 2016 - 06:30 AM

deleted..


Edited by booch, 16 May 2016 - 08:22 AM.


#8 chef OFFLINE  

chef

    Advanced Member

  • Developers
  • 4738 posts
  • Local time: 06:06 PM
  • LocationPeterborough, Canada

Posted 16 May 2016 - 07:28 AM

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

#9 booch OFFLINE  

booch

    Advanced Member

  • Members
  • 41 posts
  • Local time: 12:06 AM
  • LocationOdessa, Ukraine

Posted 16 May 2016 - 08:21 AM

@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



#10 chef OFFLINE  

chef

    Advanced Member

  • Developers
  • 4738 posts
  • Local time: 06:06 PM
  • LocationPeterborough, Canada

Posted 16 May 2016 - 11:16 AM

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 :)
  • booch likes this

#11 booch OFFLINE  

booch

    Advanced Member

  • Members
  • 41 posts
  • Local time: 12:06 AM
  • LocationOdessa, Ukraine

Posted 16 May 2016 - 11:21 AM

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

Thank you very much! 



#12 ebr OFFLINE  

ebr

    Chief Bottle Washer

  • Administrators
  • 52103 posts
  • Local time: 06:06 PM

Posted 17 May 2016 - 11:31 AM

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



#13 booch OFFLINE  

booch

    Advanced Member

  • Members
  • 41 posts
  • Local time: 12:06 AM
  • LocationOdessa, Ukraine

Posted 17 May 2016 - 03:45 PM

Do you mean that implementation itself would decrease performance or are you talking about scripts ?
Anyway looking forward for this feature :)

#14 chef OFFLINE  

chef

    Advanced Member

  • Developers
  • 4738 posts
  • Local time: 06:06 PM
  • LocationPeterborough, Canada

Posted 18 May 2016 - 08:44 PM

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

I haven't forgotten.

#15 booch OFFLINE  

booch

    Advanced Member

  • Members
  • 41 posts
  • Local time: 12:06 AM
  • LocationOdessa, Ukraine

Posted 19 May 2016 - 04:13 AM

@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 :)


  • chef likes this

#16 booch OFFLINE  

booch

    Advanced Member

  • Members
  • 41 posts
  • Local time: 12:06 AM
  • LocationOdessa, Ukraine

Posted 01 June 2016 - 05:29 AM

@chef

Do you have any progress on my request?

Thanks



#17 shred00 OFFLINE  

shred00

    Advanced Member

  • Members
  • 123 posts
  • Local time: 06:06 PM

Posted 16 November 2018 - 02:57 PM

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.



#18 Luke OFFLINE  

Luke

    System Architect

  • Administrators
  • 157215 posts
  • Local time: 06:06 PM

Posted 16 November 2018 - 03:11 PM

This could be done via community plugin if someone would like to create one.

#19 Zodler OFFLINE  

Zodler

    Advanced Member

  • Members
  • 152 posts
  • Local time: 12:06 AM

Posted 02 February 2019 - 07:05 AM

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, 02 February 2019 - 07:08 AM.


#20 cayars OFFLINE  

cayars

    Advanced Member

  • Alpha Testers
  • 3417 posts
  • Local time: 06:06 PM

Posted 04 February 2019 - 07:37 AM

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.







Also tagged with one or more of these keywords: automation, custom scripts, delete movie

0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users