Mailing List archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[vdr] Re: Recording Folder changed with AIO22.06 ??



>
>
>> I noticed one thing with AIO 22.06:
>>
>> The format of a folder with a recording changed from
>> yyyy-mm-dd.hh:mm....
>> to
>> yyyy-mm-dd.hh.mm....
>
>
> This is due to the VFAT option in the "make" line. If you compile with 
> the option, you'll get one type of filenames, without the option, you 
> get the other type.

I see.
Looking into the source I found the responsible part:

in recording.c at the beginning:

  #define DATAFORMAT   "%4d-%02d-%02d.%02d.%02d.%02d.%02d" RECEXT
  #else
  #define DATAFORMAT   "%4d-%02d-%02d.%02d:%02d.%02d.%02d" RECEXT
  #endif

It's neccessary because windoze won't take a ":" in a filename :p

Well,
for all those who need it I wrote a little perlscript that converts the 
dirnames with : to dirnames with .:



#!/usr/bin/perl
$video_dir = "/video";
opendir DIR, $video_dir || die "can't open $video_dir\n";
# Get every entry from the given directory
@dirnames = readdir(DIR);
# Check every entry if it's a subdirectory
foreach $dir (@dirnames) {
  
($dev,$ino,$mode,$nlink,$uid,$gid,$rdev,$size,$atime,$mtime,$ctime,$blksize,$blocks)=stat("$video_dir/$dir");
  if ($mode == "16877") { # Entry is a directory
      # check every directory if it's a VDR Recording
        opendir RECDIR, "$video_dir/$dir";
        @recordings = readdir(RECDIR);
        foreach $recording (@recordings) {
          # check if the directory is â VDR recording
            # A check on the name should be sufficient.
          if ($recording =~ 
/(\d\d\d\d-\d\d-\d\d\.\d\d):(\d\d\.\d\d\.\d\d.*)/) {
                $oldfile = "$video_dir/$dir/$recording";
                $newfile = "$video_dir/$dir/$1.$2";
              print "Changing $oldfile to $newfile\n";
                rename $oldfile,$newfile || die "Couldn't rename $oldfile";
            }
        }
        closedir RECDIR;
    }
}
closedir DIR;




It's not too comfortable, but I guess everyone that can apply the AIO to 
the sources of VDR and get it running should be able to figure out how 
it works and how to custimize it if neccessary.
For all those who can't: email me and I'll improve it!

Thomas





Home | Main Index | Thread Index