Skip to content

Miscellaneous Sorting

Lockzi edited this page Sep 13, 2010 · 11 revisions

Shell script that can be called by newsreader to invoke sorting script:

(UNIX)


#!/bin/sh

#OSX hack: SABnzbd on Mac OSX comes bundled with all Python libraries
#necessary for its function. Because of this, SABnzbd sets PYTHONHOME
#to point to its own Python libraries. This causes a problem for Media
#Rover due to the fact that some of the key Python libraries are not
#bundled. Therefore, we delete PYTHONHOME before invoking Media Rover
unset PYTHONHOME

#filesystem path where Media Rover is installed
ROOT=/PATH/TO/MEDIAROVER

#filesystem path to configuration directory
CONFIG=$HOME/.mediarover

python $ROOT/episodesort.py -c “$CONFIG” “$1” “$2” “$3” “$4” “$5” “$6” “$7”


(Windows)


@ECHO OFF

REM filesystem direct path to Media Rover’s episodesort script
SET ROOT=“PROGRAMFILES\mediarover\episodesort.py”

REM filesystem path to configuration directory
IF DEFINED LOCALAPPDATA
(
# Vista and newer
SET CONFIG=“LOCALAPPDATA\Mediarover”
)
ELSE
(
# XP
SET CONFIG=“APPDATA\Mediarover”
)

REM filesystem path to python installation
SET PYTHON=“HOMEDRIVE\Python26\pythonw.exe”

REM invoke Media Rover episode sorting script
%PYTHON% %ROOT% -c %CONFIG% %1 %2 %3 %4 %5 %6 %7


Updated for SABnzb v5 beta, it now requires 7 parameters to be sent.
Also changed to locations of the quotes due to problems with spacing in filesystem path to episodesort.py
SABnzb v0.5 beta auto quotes the parameters sent by SABnzb.

Clone this wiki locally