mirror of
https://github.com/mitb-archive/filebot
synced 2024-12-25 01:08:52 -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) {
|
private static File nextAvailableIndexedName(File file) {
|
||||||
IntStream seq = IntStream.range(1, 100);
|
|
||||||
|
|
||||||
File parent = file.getParentFile();
|
File parent = file.getParentFile();
|
||||||
String name = getName(file);
|
String name = getName(file);
|
||||||
String ext = getExtension(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
|
@Override
|
||||||
|
Loading…
Reference in New Issue
Block a user