From faae89285bf4313509708b7a2f3ac8153137a029 Mon Sep 17 00:00:00 2001 From: "kilian (ksmachome)" Date: Thu, 26 Dec 2019 08:13:22 +0100 Subject: [PATCH] v20191224 --- bin/clr_tmpsetplaylists.pl | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) create mode 100644 bin/clr_tmpsetplaylists.pl 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 -- 2.39.5