O'Reilly Hacks
oreilly.comO'Reilly NetworkSafari BookshelfConferences Sign In/My Account | View Cart   
Book List Learning Lab PDFs O'Reilly Gear Newsletters Press Room Jobs  



HACK
#96
Making Recordings Start Late and End Early
Only interested in your local news for tomorrow's weather report, but you find yourself having to fast forward through the whole thing every night? By altering TiVo's resources, you can allow scheduled recordings of only the portion of a show you're interested in
The Code
[Discuss (2) | Link to this hack]

The Code

Mike Baker wrote this padhack.tcl script, which modifies resource group 32, items 19 and 21, which supply values to the Start Recording and StopRecording options.

#!/tvbin/tivosh

EnableTransactionHoldoff true

set db [dbopen]
RetryTransaction {
  # get handles to the right database entries
  set swsysa [db $db open "/SwSystem/ACTIVE"]
  set tmpgrp [dbobj $swsysa get ResourceGroup 32]

  # add new values for the start recording times
  set tmpres [dbobj $tmpgrp get "Item" 19]
  dbobj $tmpres set String "On-time|0|1 minute early|60|2 minutes↵
  early|120|3 minutes early|180|4 minutes early|240|5 minutes early|300|10↵
  minutes early|600|1 minute late|-60|2 minutes late|-120|3 minutes late|↵
  -180|4 minutes late|-240|5 minutes late|-300|10 minutes late|-600|"↵
  # add new values for the stop recording times↵
  set tmpres [dbobj $tmpgrp get "Item" 21]

  dbobj $tmpres set String "On-time|0|1 minute longer|60|2 minutes↵
  longer|120|5 minutes longer|300|15 minutes longer|900|30 minutes↵
  longer|1800|1 hour longer|3600|1 1/2 hours longer|5400|3 hours↵
  longer|10800|1 minute shorter|-60|2 minutes shorter|-120|3 minute↵
  shorter|-180|4 minutes shorter|-240|5 minutes shorter|-300|10 minutes↵
  shorter| 600|"
  
  dbobj $tmpgrp remove "CompressedFile"
}

To understand how this works, run dump.tcl and find resource group 32. You'll see that item 19 dictates values for the Start Recording offset, and item 21 controls the Stop Recording offsets:

32 19 {On-time|0|1 minute early|60|2 minutes early|120|3 minutes early|180|4 
minutes early|240|5 minutes early|300|10 minutes early|600|}
...
32 21 {On-time|0|1 minute longer|60|2 minutes longer|120|5 
minutes longer|300|15 minutes longer|900|30 minutes longer|1800|1 hour longer|3600|1 
1/2 hours longer|5400|3 hours longer|10800|}

Save the code as padhack.tcl in TiVo's /var/hack/bin directory and make it executable:

bash-2.02# chmod 755 /var/hack/bin/padhack.tcl


O'Reilly Home | Privacy Policy

© 2007 O'Reilly Media, Inc.
Website: | Customer Service: | Book issues:

All trademarks and registered trademarks appearing on oreilly.com are the property of their respective owners.