* forgot to auto-adjust extension when exporting multiple subtitles

This commit is contained in:
Reinhard Pointner 2011-09-06 09:11:25 +00:00
parent 38210a5565
commit de9b5eb624
1 changed files with 6 additions and 1 deletions

View File

@ -343,7 +343,12 @@ class SubtitleDownloadComponent extends JComponent {
for (Object object : selection) {
MemoryFile file = (MemoryFile) object;
File destination = new File(folder, validateFileName(file.getName()));
// normalize name and auto-adjust extension
String ext = sf.getSelectedFormat().getFilter().extensions()[0];
String name = validateFileName(getNameWithoutExtension(file.getName()));
File destination = new File(folder, name + "." + ext);
exportSubtitles(decodeSubtitles(file), destination, sf.getSelectedEncoding(), sf.getSelectedFormat(), sf.getTimingOffset());
}
}