From: kilian (ksmachome) Date: Thu, 26 Dec 2019 07:13:22 +0000 (+0100) Subject: v20191224 X-Git-Url: http://cloud.dks.lu/git/?a=commitdiff_plain;h=faae89285bf4313509708b7a2f3ac8153137a029;p=dksnas.git v20191224 --- diff --git a/bin/clr_tmpsetplaylists.pl b/bin/clr_tmpsetplaylists.pl new file mode 100644 index 0000000..b74ea98 --- /dev/null +++ b/bin/clr_tmpsetplaylists.pl @@ -0,0 +1,27 @@ +#!/Users/kilian/perl5/perlbrew/perls/perl-5.24.1/bin/perl +use strict; +use File::Basename; +use FindBin qw($RealBin); + +my $inyear = "2019"; +my $outyear = "2020"; +my $inpath = dirname($RealBin).'/data/coloradio/aral/playlists/default/'.$inyear; +my $outpath = dirname($RealBin).'/data/coloradio/aral/playlists/default/'.$outyear; +print "$inpath => $outpath\n"; +opendir(INP,$inpath); +while (my $m3u = readdir(INP)){ + if ($m3u =~ /\.m3u$/){ + my @files = (); + open(M3U,$inpath.'/'.$m3u); + @files = ; + close(M3U); + print $m3u."\n"; + my $newfile = $m3u; + $newfile =~ s/$inyear/$outyear/; + open(OUT,">".$outpath.'/'.$newfile); + @files = reverse(@files); + print OUT join("\n",@files); + close(OUT); + } +} +closedir(INP); \ No newline at end of file