diff --git a/rrm/rclean b/rrm/rclean index d7f0980..030c156 100755 --- a/rrm/rclean +++ b/rrm/rclean @@ -38,6 +38,10 @@ close RRM; for my $size (keys %rrm) { for my $file (@{$size{$size}}) { if(-e $file) { + if($opt::sizeonly) { + print "$file\n"; + next; + } my $md5 = Digest::MD5->new; $md5->addpath($file); my $sha = Digest::SHA->new(256); diff --git a/vid/vid b/vid/vid index 0fbabcb..0064450 100755 --- a/vid/vid +++ b/vid/vid @@ -181,7 +181,13 @@ stdout() { VIDEOPLAYER=${VIDEOPLAYER:-vlc --} if $stdin_is_terminal ; then # STDIN is terminal => limit to 100 - shuf | parallel --halt now,done=1 --lb -n100 -Xj1 $VIDEOPLAYER + # shuf | parallel --halt now,done=1 --lb -n100 -Xj1 $VIDEOPLAYER + # Sort file name, select random starting point, print 100 next paths. + perl -e '$n = 100; + @l = sort { (split m{/}, $a)[-1] cmp (split m{/}, $b)[-1] } <>; + $r = rand(@l - --$n); + print @l[$r..($r+$n)];' | + parallel --halt now,done=1 --lb -n100 -Xj1 $VIDEOPLAYER else parallel --halt now,done=1 --lb -Xj1 $VIDEOPLAYER fi