Explorar o código

Renumber the NFO when renaming

Zachary Kotlarek %!s(int64=12) %!d(string=hai) anos
pai
achega
2ff878f587
Modificáronse 1 ficheiros con 3 adicións e 0 borrados
  1. 3 0
      yt/subscribe.pl

+ 3 - 0
yt/subscribe.pl

@@ -195,6 +195,9 @@ foreach my $id (keys(%{$videos})) {
 			print STDERR 'Renaming ' . $files->{$id}->{'path'} . ' => ' . $basePath . $files->{$id}->{'suffix'} . "\n";
 			rename($files->{$id}->{'path'}, $basePath . $files->{$id}->{'suffix'});
 			rename($files->{$id}->{'nfo'},  $nfo);
+			
+			# This is a hack, but it fits nicely in one line
+			system('sed', '-i', 's%<episode>[0-9]*</episode>%<episode>' . $videos->{$id}->{'number'} . '</episode>%');
 		} else {
 
 			# Find the old NFO to avoid re-fetching