FAQ  •  Register  •  Login

post-update hooks

<<

Elwell

Streaming enthusiast

Posts: 20

Joined: Thu May 27, 2010 5:55 pm

Post Thu Jan 26, 2012 9:44 am

post-update hooks

Hi,

At the moment I grep the logfile to see what's been added (to stick on a web page of 'most recent additions'

I'd like for a script to be called automatically if the LibraryUpdatesChecker finds something new -- is this possible?

(FYI I have the following trivial script:

  Code:
#!/bin/sh
SERVIIO_LOG=/home/andrew/serviio/log/serviio.log
grep ' Added file ' $SERVIIO_LOG | sed -e 's/,.*Thread\]//'  -e 's/ to Library$//'


which produces something like

2012-01-26 09:01:51 Added file 'Vampire_Diaries_S02E22.avi' (title: As I Lay Dying)
2012-01-26 10:04:22 Added file 'Doctor_Who_S04E06.avi' (title: The Doctor's Daughter)

.. which although not pretty is good enough :-)
<<

Cerberus

User avatar

DLNA master

Posts: 4114

Joined: Sun Jan 02, 2011 5:20 pm

Location: Reading, UK

Post Thu Jan 26, 2012 12:12 pm

Re: post-update hooks

Phil Bennett
Beta Tester Group
Wiki | FAQ

Samsung LE40C750 LCD | Samsung BD-C5900 | Sony PS3 | Windows 7 |
HowTo: Provide supported formats of a device HowTo: Record a new ticket on Bitbucket
HowTo: Provide details of a video file that doesn't play HowTo: Turn on detailed logging
<<

will

DLNA master

Posts: 2138

Joined: Mon Aug 30, 2010 11:18 am

Location: UK

Post Thu Jan 26, 2012 12:26 pm

Re: post-update hooks

Although there is an API that allows you to check to see if new files have been added in the last update, you still have to go and parse the log anyway to find out the actual files. (Yes it exposes the last file, but you would probably miss a few if lots of files were added at once).

I have a near identical command setup as an alias so I can type 'sn' and get a list of all the new files.

I guess the OP (myself and others) would like is something serviio driven, e.g. an optional bin/post-update.sh script that is called by serviio when ever it finds new files, rather than user driven where you keep querying serviio.
Will

ServiiDroid (Android Console) Developer: Download | Home | Support
ServiiGo (Android 3G/4G/WiFi Playback App) Developer: Download | Home | Support
<<

moltra

DLNA master

Posts: 1871

Joined: Thu Mar 24, 2011 11:00 pm

Location: Ohio USA

Post Thu Jan 26, 2012 12:35 pm

Re: post-update hooks

will wrote:Although there is an API that allows you to check to see if new files have been added in the last update, you still have to go and parse the log anyway to find out the actual files. (Yes it exposes the last file, but you would probably miss a few if lots of files were added at once).

I have a near identical command setup as an alias so I can type 'sn' and get a list of all the new files.

I guess the OP (myself and others) would like is something serviio driven, e.g. an optional bin/post-update.sh script that is called by serviio when ever it finds new files, rather than user driven where you keep querying serviio.



Can you add something like this to the android app?
Mark
Beta Tester Group
http://www.serviidb.com Online media resource repository

Netgear EVA2000 | Samsung BD-D5300 | XBOX 360 | Windows 7 | Mint Debian 12 | Raxz Maxx
HowTo: Provide supported formats of a device HowTo: Record a new ticket on Bitbucket
HowTo: Provide details of a video file that doesn't play HowTo: Turn on detailed logging
<<

will

DLNA master

Posts: 2138

Joined: Mon Aug 30, 2010 11:18 am

Location: UK

Post Thu Jan 26, 2012 1:12 pm

Re: post-update hooks

moltra wrote:Can you add something like this to the android app?


What part of it?
Will

ServiiDroid (Android Console) Developer: Download | Home | Support
ServiiGo (Android 3G/4G/WiFi Playback App) Developer: Download | Home | Support
<<

moltra

DLNA master

Posts: 1871

Joined: Thu Mar 24, 2011 11:00 pm

Location: Ohio USA

Post Thu Jan 26, 2012 1:36 pm

Re: post-update hooks

Seeing what has been files have been added / changed or maybe even a link to the serviio.log file.
Mark
Beta Tester Group
http://www.serviidb.com Online media resource repository

Netgear EVA2000 | Samsung BD-D5300 | XBOX 360 | Windows 7 | Mint Debian 12 | Raxz Maxx
HowTo: Provide supported formats of a device HowTo: Record a new ticket on Bitbucket
HowTo: Provide details of a video file that doesn't play HowTo: Turn on detailed logging
<<

will

DLNA master

Posts: 2138

Joined: Mon Aug 30, 2010 11:18 am

Location: UK

Post Thu Jan 26, 2012 1:44 pm

Re: post-update hooks

moltra wrote:Seeing what has been files have been added / changed or maybe even a link to the serviio.log file.


Four options order by my likelihood of doing them

1) Show the last added file on the status view, thats easy and I don't know why I didn't in the first place. I'll add that to the next release.

2) Wait for ZIP to allow 'browsing' the repository over the REST API so that I can show the 'Last added' category in the app. My prefered method.

3) When connected over wifi perform a UPnP browse through the app as if it was a renderer and show the files available in the 'Last added' category. This should work but I don't know how much time it would take and I don't have time at the moment.

4) Do something with the serviio.log file - this requires either zip expose it, or that the user expose it. I guess something along the lines of how the restful webui works might work. Or a standalone server, ie the user tells the app that they have apache running with SERVERIP/serviio/serviio.log available for access.
Last edited by will on Thu Jan 26, 2012 1:48 pm, edited 1 time in total.
Will

ServiiDroid (Android Console) Developer: Download | Home | Support
ServiiGo (Android 3G/4G/WiFi Playback App) Developer: Download | Home | Support
<<

moltra

DLNA master

Posts: 1871

Joined: Thu Mar 24, 2011 11:00 pm

Location: Ohio USA

Post Thu Jan 26, 2012 1:47 pm

Re: post-update hooks

The order you are looking at them looks good to me. I know I will add a movie and then watch the log for it to be added. I would love to be able to check via your app.
Mark
Beta Tester Group
http://www.serviidb.com Online media resource repository

Netgear EVA2000 | Samsung BD-D5300 | XBOX 360 | Windows 7 | Mint Debian 12 | Raxz Maxx
HowTo: Provide supported formats of a device HowTo: Record a new ticket on Bitbucket
HowTo: Provide details of a video file that doesn't play HowTo: Turn on detailed logging
<<

will

DLNA master

Posts: 2138

Joined: Mon Aug 30, 2010 11:18 am

Location: UK

Post Thu Jan 26, 2012 1:52 pm

Re: post-update hooks

I'm moving this to the android app thread to keep this just related to serviio post-update hooks.

@moltra I've added an extra idea, let me know if this is something you would want.
Will

ServiiDroid (Android Console) Developer: Download | Home | Support
ServiiGo (Android 3G/4G/WiFi Playback App) Developer: Download | Home | Support
<<

Elwell

Streaming enthusiast

Posts: 20

Joined: Thu May 27, 2010 5:55 pm

Post Fri Jan 27, 2012 1:14 pm

Re: post-update hooks

will wrote:I guess the OP (myself and others) would like is something serviio driven, e.g. an optional bin/post-update.sh script that is called by serviio when ever it finds new files, rather than user driven where you keep querying serviio.



Spot on!

I can then hook it into the general messaging plaform for IRC/Jabber/MQTT etc

Return to Feature requests

Who is online

Users browsing this forum: No registered users and 29 guests

Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group.
Designed by ST Software for PTF.