don't unlink non-existing video.ogv
authorDobrica Pavlinusic <dpavlin@rot13.org>
Mon, 21 Dec 2009 21:54:37 +0000 (22:54 +0100)
committerDobrica Pavlinusic <dpavlin@rot13.org>
Mon, 21 Dec 2009 21:54:37 +0000 (22:54 +0100)
bin/mplayer.pl

index 806820d..160769f 100755 (executable)
@@ -35,7 +35,7 @@ if ( ! $movie && -e 'media/_editing' ) {
 } elsif ( -f $movie && $movie =~ m{\.og[vg]\b}i ) {
        my $movie_master = $movie;
        $movie = base_dir($movie) . '/video.ogv';
 } elsif ( -f $movie && $movie =~ m{\.og[vg]\b}i ) {
        my $movie_master = $movie;
        $movie = base_dir($movie) . '/video.ogv';
-       unlink $movie;
+       unlink $movie if -e $movie;
        symlink base_name($movie_master), $movie;
        warn "symlink video.ogv -> $movie_master";
 } else {
        symlink base_name($movie_master), $movie;
        warn "symlink video.ogv -> $movie_master";
 } else {