Jump to content

New Plugin - Custom Scripting | Emby ScripterX


Anthony Musgrove

Recommended Posts

Anthony Musgrove

Hey mate, we can pick a different colour from the theme if you want for the buttons :) which would be better?

Link to comment
Share on other sites

Anthony Musgrove

Im thinking maybe using the prominent theme colour for a button outline rther then the face of the whole button?

Link to comment
Share on other sites

Anthony Musgrove

Does this look better mate?  theme button face colour with theme primary colour outline on the buttons?

 

5eaa71a5cd170_newtheme.png

  • Like 1
Link to comment
Share on other sites

Anthony Musgrove

Version 2.2.2.0 up on the catalog - it now supports re-ordering the actions list, and it will remember your choices!

 

 

Just have to fix up import reference, and it will work.  

Edited by Anthony.Musgrove
Link to comment
Share on other sites

maegibbons

Hi Anthony

 

I like the new version with the drag to re-order - very cool!!!

 

However to drag from bottom to top requires a:

 

Drag to top of VISIBLE page

 

Scroll Page

 

Drag to top of VISIBLE page

 

Scroll Page

 

Rinse repeat until top approach.

 

Can you add 5eaaf1696cf7a_topbottom.jpg Top and Bottom buttons to the options to send it to the top and bottom?

 

Krs

 

Mark

  • Like 1
Link to comment
Share on other sites

PenkethBoy

i have moved a couple of around but on a page refresh/or return to plugin page it goes back to original order

 

and sometimes i get all the events with (1) or more at the top

 

its a little weird for me at the moment with 2.2.2

Link to comment
Share on other sites

PenkethBoy

if i reboot my emby server and go straight to the plugin page i get

 

5eaaf6fa4b119_Annotation20200430170309.j

 

so sorted by script count - great - i can also reorder then

 

navigate away to another page then come back and i get

 

5eaaf74beea94_Annotation20200430170315.j

and unsorted page - and i cant reorder - stays this way till i reboot the emby server again

  • Like 1
Link to comment
Share on other sites

PenkethBoy

if i navigate away from the dashboard to a library page and then come back - i get image one again

 

so something is being cleared when go to say a movie screen and come back

  • Like 1
Link to comment
Share on other sites

Anthony Musgrove

Hey mate, can you please update to 2.2.3 up on catalog..   The draggable / sortable classes are now working, so even if you reopen the config it will work every time.  I'm just working on persistence now (remembering the options)

 

:) 

  • Like 1
Link to comment
Share on other sites

Anthony Musgrove

Alrighty!  v2.2.4 is up in the Catalog.  Actions Interface Event orders are now fully customisable.  You can drag them in different orders.  Your sorting order will be remembered locally in your browser.  Possibly in near future I can integrate the order sorting information into the plugin's XML config as a per-user order.   

 

Also fixed the issue where the list would revert back to the old order, and not allow you to re-order again properly.  Again, this is due to kind assistance from @@Luke in regard to utilising external javascript libraries.

 

:) :)  

  • Like 1
Link to comment
Share on other sites

PenkethBoy

So if i understand correctly - a browser cache clear out would reset my order?

 

will have a play in a bit :)

  • Like 1
Link to comment
Share on other sites

Anthony Musgrove

So if i understand correctly - a browser cache clear out would reset my order?

 

will have a play in a bit :)

 

Yep mate, it will at this point in time.. thats one big reason why I want to integrate the store and load methods of the sortable storage to Api config calls and save all the config in the plugin xml file as well :)   This shouldn't be a massive task but I need to test it progressively, just pushing up my latest build 2.2.5, just cleaned up a bit of aesthetics on the Actions interface :)

Link to comment
Share on other sites

Anthony Musgrove

Hi Anthony

 

I like the new version with the drag to re-order - very cool!!!

 

However to drag from bottom to top requires a:

 

Drag to top of VISIBLE page

 

Scroll Page

 

Drag to top of VISIBLE page

 

Scroll Page

 

Rinse repeat until top approach.

 

Can you add 5eaaf1696cf7a_topbottom.jpg Top and Bottom buttons to the options to send it to the top and bottom?

 

Krs

 

Mark

 

Thank you mate this is an awesome idea.. Leave it with me :)

Link to comment
Share on other sites

ginjaninja

some painful lessons learnt with powershell

 

1. [on windows at least] you have to reboot after powershell install if you want to set interpretter to pwsh.exe [without path] - even though pwsh is in the path variable, emby doesnt 'see' it until reboot [or perhaps service restart would suffice]

2. functions have to be defined before they are called. possibly obvious to everyone but me..took me ages to work out.

Link to comment
Share on other sites

maegibbons

some painful lessons learnt with powershell

 

1. [on windows at least] you have to reboot after powershell install if you want to set interpretter to pwsh.exe [without path] - even though pwsh is in the path variable, emby doesnt 'see' it until reboot [or perhaps service restart would suffice]

2. functions have to be defined before they are called. possibly obvious to everyone but me..took me ages to work out.

Yes

 

Point 1 had me going to for about 24 hours!

 

Works but cannot be called from either another program or another script!!

 

Krs

 

Mark

 

A 'like' is always appreciated!

Link to comment
Share on other sites

PenkethBoy

some painful lessons learnt with powershell

 

2. functions have to be defined before they are called. possibly obvious to everyone but me..took me ages to work out.

Yes - always define you functions at the top of your script - so they are read first on script run by the interpreter before they are called

Link to comment
Share on other sites

ginjaninja

Considering the case of using onMediaItemAdded to notify your users that content has been added to the server.

{imo one of the common uses for the event}

I have written a script for a forum member who wishes to post a notification to a Facebook group to let his users know about new content.

it does an api lookup on the ID to get further information not provided by scripterX

 

observations and suggestions

 

I added a new series of 2 seasons and 10 episodes per season

An event was fired for each of 1 series, 2 seasons, 20 episodes

 

it would be great if there was an option to slow down the event firing and aggregate changes into more meaningful parcels once a steady library state is achieved.

ie report on the top level change

In the case above - Fire once against series

3rd season with 1st three episodes added - Fire Once Against Season

3 episodes added - Fire 3 times for each episode

Multiple tracks on same album - Fire once against album.

 

getting multiple fired powershell scripts to aggregate this information after the event is a tall order for my programming ability :-)

alternatively if this is too much to ask, maybe scripter X can pass a single collection of adds once a steady state is achieved and the script has to take responsibility for aggregating.

 

 

I think the events fired before the items were fully fetched, (i am worried about IMDBID), does Emby report on fetching status for an ID? if so it might be better to wait until fully fetched before fireing, otherwise an arbitrary pause in the script could handle this (less elegantly).

 

edit -  it looks like the IMDB fetching agent does not kick in whilst the ScripterX events / fired scripts (with their wait state) are being processed. (or at least in my testing re-adding that same series showed no fetching from external providers until all 23 events had fired (with their included 60 second wait). In the short term it might be helpful if there was an option to delay scripterX from firing the script once the event is detected. edit - even .indexnumber for an episode isnt returned by api whilst the script is processing.

 

thanks for considering

Edited by ginjaninja
Link to comment
Share on other sites

PenkethBoy

This is even worse with itemupdated especially if its being recorded - get numerous events as it progresses - then when it gets its metadata etc etc - one i have avoided so far

 

The issue Anthony may have is that these events are the events Emby works with and produces normally as things change

 

As we get an event from the plugin when one of these monitored events fires off - this means the scripts have to deal with multiple similar events in a short time - not got an easy answer for this yet but thinking/working on some ideas 

 

The problem for Anthony, as i currently see it, is that how does he "know" what's about to happen and also then decide what's a quiet period, how to group events (i.e. how are they related), know that the providerid look up was for the events just before - becomes a nightmare very quickly for everybody

 

For me the events above of 1 per series, 2 per seasons and 20 for episodes is correct as thats whats been added - if i choose to report all of them - i would want that to be my choice

 

Just had a thought do all the episodes get added in order - i suspect not as they will be in the order emby found them - not checked but something else to verify! :)

 

This is really only specific for itemupdated for me as the other events (that i am working through) can be dealt with by a script - i.e. for itemsadded the script can ignore some events by their type - e.g. ignore songs or only report on season added, keep a count of episodes added and only report the total (say (simplistically) - keep a running total in a separate file as each event will trigger a separate PS process) - although knowing which was the last episode to be added - hmmm

 

Its not easy and will be a challenge for all to get a grip on how best to deal with it

 

Anyway my current thoughts

Link to comment
Share on other sites

PenkethBoy

Small Issue

EventType: ItemRemoved Name: Episode 2 Emby ID: 83433 Emby Item Type: Episode Emby Library: Recorded Shows
EventType: ItemUpdated Name: Episode 2 Emby ID: 83451 Emby Item Type: Episode Emby Library: Recorded Shows Update Reason: None, MetadataImport

EventType: ItemUpdated Name: Extra-22 Bullets (2010) - Interview with Jean Reno Emby ID: 42306 Emby Item Type: Video Emby Library: %item.library.name% Update Reason: None, ImageUpdate
EventType: ItemUpdated Name: Extra-22 Bullets (2010) - The Making of Emby ID: 42307 Emby Item Type: Video Emby Library: %item.library.name% Update Reason: None, ImageUpdate
EventType: ItemUpdated Name: 22 Bullets 2010 - Trailer HD Emby ID: 42453 Emby Item Type: Trailer Emby Library: %item.library.name% Update Reason: None, ImageUpdate

EventType: ItemRemoved Name: Extra-22 Bullets (2010) - Interview with Jean Reno Emby ID: 83459 Emby Item Type: Video Emby Library: Movies
EventType: ItemRemoved Name: Extra-22 Bullets (2010) - The Making of Emby ID: 83460 Emby Item Type: Video Emby Library: Movies
EventType: ItemRemoved Name: 22 Bullets 2010 - Trailer HD Emby ID: 83461 Emby Item Type: Trailer Emby Library: Movies

When Extras/Trailers/"Specials" are updated the library name is not returned - but when they are removed they do have the library name?

 

With normal items its fine - see top two above

Anthony

 

ItemAdded is not fired for Trailers - seeing this with Series Trailers

Also the itemadded does not fire for the Series Trailer folder

 

Specials are ok with Series as seen as a Season 0

 

When an item is Updated - Trailers are seen - but dont show the library name 

 

Thanks - using 2.2.5

 

5eac454e5e0a6_Annotation20200501164928.j

ScripterX.log

 

Log show events as Altered Carbon was added to my test server

 

Trailer in Trailer folder is called "ALTERED CARBON Trailer 2018 Netflix" so you can see it in the log

 

Edited by PenkethBoy
Link to comment
Share on other sites

PenkethBoy

In two minds about this but.... :)

 

When adding/removing an external subtitles file - no event is fired for itemadded/itemremoved - this maybe an emby thing not sure

 

itemupdated does fire for both removal and addition - but the reason "None, MetadataImport" is not meaningful - but again an emby thing i suspect

 

So i guess what i am asking is - does emby report on subs being added/removed or not?

 

If not then thats fine can't have everything - just wanted to flag to know one way or the other

 

Ta

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