vdr/Tools/master-timer/process_summary.pl
Klaus Schmidinger f1d1c9849c Version 0.90
- Modified the display of the channel group separators (thanks to Markus Lang
  for this suggestion).
- Added support for replaying DVDs (thanks to Andreas Schultz). See INSTALL for
  instructions on how to compile VDR with DVD support.
- Fixed replay progress display in case replay is paused while watching an
  ongoing recording.
- Ringbuffer uses semaphores to signal empty/full conditions.
- Fixed calculating the timeout value in cFile::FileReady() (thanks to
  Wolfgang Henselmann-Weiss).
2001-08-06 18:00:00 +02:00

80 lines
1.4 KiB
Perl
Executable File

#!/usr/bin/perl -w
$dir = "/home/ms/.master-timer";
open (FI,"$dir/done") or die "Can't open \"done\"\n";
while (<FI>)
{
chomp;
if ($_)
{
($title,$subtitle) = split (/\|/,$_,2);
$Done{$title}{$subtitle}=1;
}
}
close (FI);
&traverse('/video');
if ($hit)
{
rename ("$dir/done","$dir/done.bak");
open (FO,">$dir/done");
foreach $title (sort keys %Done)
{
foreach $subtitle (sort keys %{%Done->{$title}})
{
print FO "$title\|$subtitle\n";
}
}
}
sub traverse
{
local($dir) = shift;
local($path);
unless (opendir(DIR, $dir))
{
warn "Can't open $dir\n";
closedir(DIR);
return;
}
foreach (readdir(DIR))
{
next if $_ eq '.' || $_ eq '..';
$path = "$dir/$_";
if (-d $path) # a directory
{
&traverse($path);
}
if ($_ eq "summary.vdr")
{
open (FI,"$path") or die "Can't open \"$path\"\n";
@lines = <FI>;
close (FI);
if ($lines[0] =~ /^Title\:\s\"(.*)\"/)
{
@titles = split (/\~/,$1);
if ($lines[2] && $lines[2] =~ /^Subtitle\:\s\"(.*)\"/)
{
@subtitles = split (/\~/,$1);
foreach $num (0 .. $#titles)
{
if ($titles[$num] && $subtitles[$num])
{
if (!$Done{$titles[$num]}{$subtitles[$num]})
{
$Done{$titles[$num]}{$subtitles[$num]}=1;
$hit = 1;
}
}
}
}
}
}
}
closedir(DIR);
}