瀏覽代碼

Renumber the NFO when renaming

Zachary Kotlarek 12 年之前
父節點
當前提交
2ff878f587
共有 1 個文件被更改,包括 3 次插入 和 0 次删除
  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