自动修正下载文件夹名
This commit is contained in:
1 parent
b55d5a1538
commit
07335ba49c
1 file changed
+9
-4
@@ -87,11 +87,16 @@ public final class EhUtils {
|
||||
File downloadDir = new File(Config.getDownloadPath());
|
||||
File gDir = new File(downloadDir,
|
||||
Utils.standardizeFilename(Integer.toString(gid)));
|
||||
File defaultDir = generateGalleryDir(gid, title);
|
||||
|
||||
if (gDir.exists())
|
||||
return gDir;
|
||||
else
|
||||
return generateGalleryDir(gid, title);
|
||||
if (gDir.exists()) {
|
||||
if (gDir.renameTo(defaultDir))
|
||||
return defaultDir;
|
||||
else
|
||||
return gDir;
|
||||
} else {
|
||||
return defaultDir;
|
||||
}
|
||||
|
||||
// TODO check a dir start with the gid, but it may take a long time
|
||||
// Create a map to record all ?
|
||||
|
||||
Reference in new issue
Block a user