From 07a8421cdf6fd70d217de1b1b6367752a4b42620 Mon Sep 17 00:00:00 2001 From: Andreas Brachold Date: Mon, 7 Apr 2008 17:43:02 +0000 Subject: * RECORDS: info.vdr parse field 'V' VPS/PDC time into database --- lib/XXV/MODULES/RECORDS.pm | 21 +++++++++++++++++++-- 1 file changed, 19 insertions(+), 2 deletions(-) (limited to 'lib') diff --git a/lib/XXV/MODULES/RECORDS.pm b/lib/XXV/MODULES/RECORDS.pm index 51d6dea..74d6da7 100644 --- a/lib/XXV/MODULES/RECORDS.pm +++ b/lib/XXV/MODULES/RECORDS.pm @@ -1065,6 +1065,9 @@ sub readinfo { elsif($zeile =~ /^S\s+(.+)$/s) { $info->{subtitle} = $1; } + elsif($zeile =~ /^V\s+(.+)$/s) { + $info->{vpstime} = $1; + } elsif($zeile =~ /^X\s+1\s+(.+)$/s) { $info->{video} = $1; } @@ -1120,6 +1123,12 @@ sub saveinfo { undef $info->{channel}; } } + elsif($zeile =~ /^V\s+(\S+)/s) { + if(defined $info->{vpstime} && $info->{vpstime}) { + $out .= "V ". $info->{vpstime} . "\n" if($info->{vpstime}); + undef $info->{vpstime}; + } + } elsif($zeile =~ /^X\s+1\s+(.+)$/s) { if(defined $info->{video} && $info->{video}) { $out .= "X 1 ". $info->{video} . "\n" if($info->{video}); @@ -1153,6 +1162,9 @@ sub saveinfo { if(defined $info->{description} && $info->{description}) { $out .= "D ". $info->{description} . "\n"; } + if(defined $info->{vpstime} && $info->{vpstime}) { + $out .= "V ". $info->{vpstime} . "\n" if($info->{vpstime}); + } if(defined $info->{video} && $info->{video}) { $out .= "X 1 ". $info->{video} . "\n" if($info->{video}); } @@ -1369,6 +1381,7 @@ sub createOldEventId { channel => $info->{channel} || "", duration => $duration, starttime => $start, + vpstime => $info->{vpstime} || 0, video => $info->{video} || "", audio => $info->{audio} || "", }; @@ -1380,8 +1393,8 @@ sub createOldEventId { my $sth = $obj->{dbh}->prepare( q|REPLACE INTO OLDEPG(eventid, title, subtitle, description, channel_id, - duration, tableid, starttime, video, audio, addtime) - VALUES (?,?,?,?,?,?,?,FROM_UNIXTIME(?),?,?,NOW())|); + duration, tableid, starttime, vpstime, video, audio, addtime) + VALUES (?,?,?,?,?,?,?,FROM_UNIXTIME(?),FROM_UNIXTIME(?),?,?,NOW())|); $sth->execute( $attr->{eventid}, @@ -1392,6 +1405,7 @@ q|REPLACE INTO OLDEPG(eventid, title, subtitle, description, channel_id, int($attr->{duration}), $attr->{tableid}, $attr->{starttime}, + $attr->{vpstime}, $attr->{video}, $attr->{audio} ); @@ -2042,6 +2056,9 @@ WHERE $data->{title} =~s#^~##g; $data->{title} =~s#~$##g; + # Keep PDC Time + $data->{vpstime} = $status->{vpstime} if($status->{vpstime}); + if($data->{title} ne $rec->{title} or $data->{description} ne $status->{description} or $data->{channel} ne $status->{channel} -- cgit v1.2.3