Browse Source

Better NFO handling in dup/rename usage.
Do
not force a new download/NFO just because we renamed

Zachary Kotlarek 12 years ago
parent
commit
aa4a3faed1
1 changed files with 1 additions and 3 deletions
  1. 1 3
      yt/subscribe.pl

+ 1 - 3
yt/subscribe.pl

@@ -182,8 +182,7 @@ foreach my $id (keys(%{$videos})) {
 		if ($RENAME) {
 			print STDERR 'Renaming ' . $files->{$id}->{'path'} . ' => ' . $basePath . $files->{$id}->{'suffix'} . "\n";
 			rename($files->{$id}->{'path'}, $basePath . $files->{$id}->{'suffix'});
-			unlink($files->{$id}->{'nfo'});
-			delete($files->{$id});
+			rename($files->{$id}->{'nfo'}, $nfo);
 		}
 	}
 
@@ -397,7 +396,6 @@ sub findFiles($) {
 
 					print STDERR 'Deleting duplicate: ' . $del->{'path'} . "\n";
 					unlink($del->{'path'});
-					unlink($del->{'nfo'});
 				}
 			}
 			$files{$id} = \%tmp;