mirror of
https://github.com/mitb-archive/filebot
synced 2024-12-24 16:58:51 -05:00
Refactor
This commit is contained in:
parent
aba1effc83
commit
856972e4da
@ -679,12 +679,10 @@ public class CmdlineOperations implements CmdlineInterface {
|
||||
}
|
||||
|
||||
private static File nextAvailableIndexedName(File file) {
|
||||
IntStream seq = IntStream.range(1, 100);
|
||||
|
||||
File parent = file.getParentFile();
|
||||
String name = getName(file);
|
||||
String ext = getExtension(file);
|
||||
return seq.mapToObj(i -> new File(parent, name + '.' + i + '.' + ext)).filter(f -> !f.exists()).findFirst().get();
|
||||
return IntStream.range(1, 100).mapToObj(i -> new File(parent, name + '.' + i + '.' + ext)).filter(f -> !f.exists()).findFirst().get();
|
||||
}
|
||||
|
||||
@Override
|
||||
|
Loading…
Reference in New Issue
Block a user