FAQ  •  Register  •  Login

Using CURL to force library refresh

<<

J038lack

Serviio newbie

Posts: 12

Joined: Mon Jul 19, 2010 4:05 am

Post Sat Oct 01, 2011 1:24 am

Re: Using CURL to force library refresh

Here is the fix for the new version,

Xmantium test this for me,

I have added a header to the POST request telling the REST interface it is xml.
the highlighted text is the added info to the script.

headers = { "Content-type": "text/xml" }
connection.request('POST', '/rest/action' , body_content , headers)

or copy + paste the whole script.

  Code:
#!/usr/bin/env python
import httplib
connection = httplib.HTTPConnection('192.168.1.6:23423')
body_content = '<action><name>forceLibraryRefresh</name></action>'
headers = { "Content-type": "text/xml" }
connection.request('POST', '/rest/action' , body_content , headers)
result = connection.getresponse()
if result.status == 200:
    print "Updated Serviio Library",
else :
    print "Update Failed",
print result.status,


hope it helps
J03
<<

Xmantium

User avatar

DLNA master

Posts: 1396

Joined: Sat Jul 23, 2011 2:12 pm

Location: Manchester, UK

Post Sat Oct 01, 2011 4:56 pm

Re: Using CURL to force library refresh

Tested this and its working fine again!!

Thanks for getting back to me :D

Sabnzbd and Serviio combined is the perfect media station!
Sony Bravia 2010 52NX803 - Sony PS3 - Xbox 360
Serviio running on QNAP NAS 639 Pro - 1.6 Intel Dual Core - 2GB RAM and QNAP NAS 121 - 2Ghz ARM Marvell - 1GB RAM
Console using ServiiDroid for Android, ServiiMetro and ServiiWP for Windows Phone and WebUI for iOS
<<

Xmantium

User avatar

DLNA master

Posts: 1396

Joined: Sat Jul 23, 2011 2:12 pm

Location: Manchester, UK

Post Sun Feb 19, 2012 4:01 pm

Re: Using CURL to force library refresh

Update: For QNAP users who who use SABnzbd to run the script, Ive also noticed sickbeard takes over the Serviio library refresh script if sickbeard installed. The quick solution is edit sickbeard.sh and remove the following code:
  Code:
config_sabnzbdplus() {
if [ -f $SABconfig ] && [ -f ${QPKG_DIR}/config.ini ]; then
/sbin/setcfg misc script_dir "${QPKG_DIR}/autoProcessTV" -f $SABconfig
/sbin/setcfg misc enable_tv_sorting 0 -f $SABconfig
/sbin/setcfg [tv] script sabToSickBeard.py -f $SABconfig
/sbin/setcfg [tv] dir TV -f $SABconfig
fi
inject_sb_startup_procedure
}
Last edited by Xmantium on Sun Feb 26, 2012 7:13 pm, edited 1 time in total.
Sony Bravia 2010 52NX803 - Sony PS3 - Xbox 360
Serviio running on QNAP NAS 639 Pro - 1.6 Intel Dual Core - 2GB RAM and QNAP NAS 121 - 2Ghz ARM Marvell - 1GB RAM
Console using ServiiDroid for Android, ServiiMetro and ServiiWP for Windows Phone and WebUI for iOS
<<

J038lack

Serviio newbie

Posts: 12

Joined: Mon Jul 19, 2010 4:05 am

Post Sun Feb 26, 2012 8:07 am

Re: Using CURL to force library refresh

Xmantium,

What do you mean Sickbeard takes over the Serviio refresh?

Im running Sabnzbd, Sickbeard, and CouchPotato with Serviio and I am having no problems. Sickbeard Allows you to run post-processing Scripts from the app itself. Just manually configure the Config.ini.

extra_scripts = C:\\Python27\\pythonw.exe C:\\NZB\\SickBeard\\forceserviio.pyw (running on a windows box)

And CouchPotato has just added post-processing to the renaming section in its new Version also allowing a force update script.

Also remember I let CouchPotato and Sickbeard do all the renaming and creating of thumbnails and metadata allowing Serviio to just serve the files.

J03
<<

Xmantium

User avatar

DLNA master

Posts: 1396

Joined: Sat Jul 23, 2011 2:12 pm

Location: Manchester, UK

Post Sun Feb 26, 2012 7:11 pm

Re: Using CURL to force library refresh

Ah you let sickbeard run the script, i use sab to run the script

I think this must be only for QNAP users
Looking at out sickbeard.sh script, it changes serviiorefresh.py to sabToSickBeard.py everytime my Qnap restarts
I actually let Sabnzbd do all the renaming, i dont like how sickbeard renames the files
I just use sickbeard to send the nzb to sab and let sab do the rest :)

Thanks for this amazing script, works wonders!!
Sony Bravia 2010 52NX803 - Sony PS3 - Xbox 360
Serviio running on QNAP NAS 639 Pro - 1.6 Intel Dual Core - 2GB RAM and QNAP NAS 121 - 2Ghz ARM Marvell - 1GB RAM
Console using ServiiDroid for Android, ServiiMetro and ServiiWP for Windows Phone and WebUI for iOS
<<

DeanoX

Streaming enthusiast

Posts: 23

Joined: Thu Jan 03, 2013 10:30 pm

Post Tue Jan 15, 2013 2:58 pm

Re: Using CURL to force library refresh

phardwick wrote:Quick tip:

I use this to force a library refresh (I'm running on linux):

curl -X POST "http://localhost:23423/rest/action" -H "Content-Type: text/xml" -d "<action><name>forceLibraryRefresh</name></action>"

I plan on putting this into a daily cron job and disabling the auto library refresh.


Many Thanks :-) My windows batch file that creates a few directory based playlists now updates the library on completion. Perfect !
Zyxel NSA325 running Serviio 1.1 | Sony Bravia 2011 KDL-24EX320 / KDL-40EX723
Previous

Return to Third-party tools integration

Who is online

Users browsing this forum: No registered users and 5 guests

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