From 88a2901f27cdefe18e3ffd29086319f94dbf192c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ville=20Skytt=C3=A4?= Date: Sun, 4 Sep 2011 22:20:40 +0300 Subject: Support changed SVDRP LSTR output of VDR >= 1.7.21. --- HISTORY | 1 + vdradmind.pl | 28 ++++++++++++++++++++-------- 2 files changed, 21 insertions(+), 8 deletions(-) diff --git a/HISTORY b/HISTORY index ecb51fd..92e12f0 100644 --- a/HISTORY +++ b/HISTORY @@ -5,6 +5,7 @@ VDR-Portal: amair ----------------------------------------------------------- 201x-xx-xx: x.x.x +- Added: Support changed SVDRP LSTR output of VDR >= 1.7.21 (Ville Skyttä). - Fixed: --log 0 command line argument (Ville Skyttä). - Improved: Startup error messages on module load failures (Ville Skyttä). - Added: -L/--logfile command line arg for overriding config (Ville Skyttä). diff --git a/vdradmind.pl b/vdradmind.pl index d8cd51b..ce18897 100755 --- a/vdradmind.pl +++ b/vdradmind.pl @@ -5076,7 +5076,11 @@ sub rec_stream { my $c; for (SendCMD("lstr")) { - ($i, $date, $time, $title) = split(/ +/, $_, 4); + if ($FEATURES{VDRVERSION} < 10721) { + ($i, $date, $time, $title) = split(/ +/, $_, 4); + } else { + ($i, $date, $time, undef, $title) = split(/ +/, $_, 5); + } last if ($id == $i); } $time = substr($time, 0, 5); # needed for wareagel-patch @@ -6027,13 +6031,21 @@ sub ParseRecordings { next if (length($recording) == 0); last if ($recording =~ /^No recordings available/); - my ($new); - my ($id, $date, $time, $name) = split(/ +/, $recording, 4); - - # - if (length($time) > 5) { - $new = 1; - $time = substr($time, 0, 5); + my ($id, $date, $time, $length, $name, $new); + if ($FEATURES{VDRVERSION} < 10721) { + # id date time* name + ($id, $date, $time, $name) = split(/ +/, $recording, 4); + if (length($time) > 5) { + $new = 1; + $time = substr($time, 0, 5); + } + } else { + # id date time length* name + ($id, $date, $time, $length, $name) = split(/ +/, $recording, 5); + if ($length =~ /^(\d+:\d+)\D/) { + $new = 1; + $length = $1; + } } # -- cgit v1.2.3