View Full Version : Getting Title from Ty imported ty file

01-25-2008, 07:57 PM
I wrote some code to pull the Title from a movie so I can check who is Nude in said movie. http://www.dealdatabase.com/forum/showthread.php?t=49876

However, now that I'm importing videos via mfs_ftp I'm running into a problem. Currently I get the title like so:

set tivlog [exec grep "WatchTV" /var/log/tivoLog.prv | tail -n 1]
set tmsidlist [split $tivlog "|"]
set tmsid [lindex $tmsidlist 5]

set db [dbopen]
# Also check if it's in Now Showing
# ForeachMfsFile recfsid name type "/Recording/TmsId" foundtmsid
ForeachMfsFile recfsid name type "/Recording/TmsId" "$tmsid:" {
RetryTransaction {
dputs "JOEY recfsid: $recfsid name: $name type: $type"
# set findingtmsid [split $foundtmsid ":"]
# set foundthis [lindex $findingtmsid 1]
set rec [db $db openid $recfsid]
set show [dbobj $rec get Showing]
set program [dbobj $show get Program]
set title [strim [dbobj $program get Title]]
# return "nowshowing [dbobj $show fsid]/[dbobj $show subobjid]"
#dputs "fsid [dbobj $show fsid]" DEBUG
# set fixedtitle [string map {"%20" " "} $title]
dputs "Title $title" DEBUG
return $title

The problem is the mfs_ftp inserted streams have NULL for tmsid's. All I'm really doing, is trying to find the title of the show that I'm currently viewing.

Anyone have any better methods to extract the name of the currently playing Show/Movie?
Joseph Elwell.