[mythtv-users] HDHR + Over the Air + Sony Network Media Player + Buffalo NAS
Jeremy Jones
jeremy.dwain.jones at gmail.com
Fri Dec 16 23:03:11 UTC 2011
On Fri, Dec 16, 2011 at 11:38 AM, Craig Treleaven <ctreleaven at cogeco.ca>wrote:
> **
> At 10:53 AM -0600 12/16/11, Jeremy Jones wrote:
>
> On Thu, Dec 15, 2011 at 9:54 PM, Jeff Tucker <jefftucker at gmail.com>
> wrote:
>
>
> So basically I recorded a TV episode and once it completed its recording I
> ran mythlink.pl to create the organized/readable links. MiniDLNA is
> running so I assumed that it would have updated itself with the newest
> folders/videos.
>
>
> Yes, you can set up a user job to run mythlink for that recording only.
> I also have a cron job setup to run mythlink nightly, so that I can clean
> up the links to deleted recordings.
>
>
> [...] The cron job is necessary though, otherwise you will end up with a
> bunch of links to files that don't exist.
>
>
> Minor point, but my strategy is to refresh ALL the links every time a
> recording ends. Only takes a few seconds and I've never seen any
> noticeable impact on either backend or frontend activities on that
> machine. Maybe if you have multiple hundreds of recordings, it would be
> different.
>
>
> Craig is right. What I should have said was:
You can't just run mythlink as a user job inputting the recording to add.
At some point you will need to run it with a full rescan. I originally
had my system setup that way, but after re-looking at it, I am not running
that userjob at all. I guess after a while I just forgot about ticking
the userjob to run mithlink, and I just didn't realize it because I always
had a backlog. What is happening is that the cron job runs nightly and it
executes this script:
------------------
#!/bin/bash
/usr/share/doc/mythtv-backend/contrib/user_jobs/mythlink.pl --link
/2TB_HDD_1/videos/recordedTV --underscore --format %T/%oY-%om-%od_%S
------------------
I suppose one could execute that same script as a user job and refresh them
all at once. I also have this script that I wrote back when I was first
setting everything up. It runs mythlink via the script above and then waits
a given time before restarting minidlna. One problem I had was that
minidlna needed to run as root. Anyway, the script is below. Hope some of
this helps.
Jeremy
----------------------------------
#/usr/share/doc/mythtv-backend/contrib/user_jobs/mythlink.pl --link
/2TB_HDD_1/videos/mythtv --underscore --format %T/%T%-%S%-%Y-%m-%d
/home/jeremy/runmythlink
echo -n 'Creating Symbolic links for Recorded TV - Wait: '
# Give mythlink time to finish
cycleTime=1
timeToWait=10
strlen=${#timeToWait}
until [ $timeToWait -lt 1 ];do
# echo
# echo "the backspaces should be: ${#timeToWait}"
## echo "The time will be: $timeToWait"
echo -n "$timeToWait"
sleep $cycleTime
# echo ${#timeToWait}
while [ $strlen -gt 0 ];do
echo -ne "\b"
echo -ne " "
echo -ne "\b"
let strlen=strlen-=1
done
#if [ $timeToWait -lt 11 ] ; then
# echo -ne " "
#fi
let timeToWait=timeToWait-=$cycleTime
let strlen=${#timeToWait}
#echo
#echo $strlen
done
echo
#restart minidlna and force a rescan
gksudo /etc/init.d/minidlna restart
------------------------------------------------------------
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://www.mythtv.org/pipermail/mythtv-users/attachments/20111216/c7634182/attachment.html
More information about the mythtv-users
mailing list