I found a solution that should be acceptable for most people
that are looking for a way to do this
By adding -scantime 0 -forceinitialscan 0 to the startup string of twonky
doing this stops the startup scanning
By adding wget -o /dev/null "http ://127.0.0.1:9000/rpc/set_option?scantime=-1"
to the startup script after server startup
media detection is re-enabled, so that adding new media will be detected
I added some sleep time before issueing the wget command
5 seconds seems to be good, 10 is a safe bet
if it is done too quckly it might not get set as the server isnt fully running yet
I modified the default twonky.sh for 7.0.9
and changed the following to get this to work on my nas
Code: Select all
fi
echo -n "Starting $TWONKYSRV ... "
"$TWONKYSRV"
rc_status -v
fi
start_support_daemon "${WEBDAV_DAEMON}" "${WORKDIR}"
start_support_daemon "${PROXY_DAEMON}" "${WORKDIR}"
;;
Code: Select all
fi
echo -n "Starting ${DAEMON} ... "
"$TWONKYSRV" -scantime 0 -forceinitialscan 0
rc_status -v
fi
start_support_daemon "${WEBDAV_DAEMON}" "${WORKDIR}"
start_support_daemon "${PROXY_DAEMON}" "${WORKDIR}"
( sleep 5; wget -o /dev/null "http://127.0.0.1:9000/rpc/set_option?scantime=-1" )
;;
and any media added post twonky server startup
will be automatically added
There are two things to be aware of
1.
any media added while twonky server is not running
will not be detected, and you will have to do a rescan
this shouldnt be a problem at all is it is set to run at startup on most nas's
2.
doing a server restart from the twonky gui or an rpc call
will not invoke the wget that sets scantime to -1
so it will go back to 0
since you are already at the twonky web gui
you could change it to -1 once the server has been restarted
you have to do it after the server restart, as it uses the startup switches on restart
however if you do it from the shell "./twonky stop" and then "./twonky start"
then it that is the same as startup
and will get changed to -1 with the wget command