Updated for Ubuntu 22.04. Also fixed merge videos cmin check
[videoscripts/.git] / homevideo_random.pl
1 #!/usr/bin/perl
2
3 use List::Util 'shuffle';
4
5 my $dir = "/naspool/videos/HomeVideos";
6 my $plsfile = "$dir/Random.pls";
7 my $mkvfiles = "????/*.mkv";
8
9 chdir $dir || die "Couldn't change directory!\n";
10 system "rm -f $plsfile";
11 @files = `ls -1 $mkvfiles`;
12 @shuffled = shuffle(@files);
13 open (FILE, ">$plsfile") || die "Couldn't open $plsfile!\n";
14 print FILE @shuffled;
15 close (FILE);
16