Clear the list used for parsing recipes
parent
68a4cecaa4
commit
d9773c9fc2
|
|
@ -23,7 +23,7 @@ fun import(ctx: MainActivity, nav: NavHostController, setLoading: (Boolean) -> U
|
||||||
while(!ctx.importFinished) {}
|
while(!ctx.importFinished) {}
|
||||||
} catch (e: Exception) {
|
} catch (e: Exception) {
|
||||||
ctx.importError = when (e) {
|
ctx.importError = when (e) {
|
||||||
else -> "Exception occurred: ${e.javaClass.canonicalName}"
|
else -> "Exception occurred: ${e.message}"
|
||||||
}
|
}
|
||||||
e.printStackTrace()
|
e.printStackTrace()
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -78,6 +78,7 @@ fun parseRecipeFiles(ctx: MainActivity) {
|
||||||
}
|
}
|
||||||
|
|
||||||
Recipe.clearCache()
|
Recipe.clearCache()
|
||||||
|
recipeFiles.clear()
|
||||||
|
|
||||||
// ctx.filesDir.walkTopDown().forEach { println(it.absolutePath + " | " + Path(it.absolutePath).fileSize()) }
|
// ctx.filesDir.walkTopDown().forEach { println(it.absolutePath + " | " + Path(it.absolutePath).fileSize()) }
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -66,10 +66,7 @@ fun sync(ctx: MainActivity, nav: NavHostController, setLoading: (Boolean) -> Uni
|
||||||
parentDir.mkdirs()
|
parentDir.mkdirs()
|
||||||
|
|
||||||
val newFile = File(parentDir, fileName)
|
val newFile = File(parentDir, fileName)
|
||||||
if (!newFile.exists()) {
|
if (newFile.isDirectory) {
|
||||||
newFile.createNewFile()
|
|
||||||
}
|
|
||||||
else if (newFile.isDirectory) {
|
|
||||||
continue
|
continue
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -107,7 +104,7 @@ fun sync(ctx: MainActivity, nav: NavHostController, setLoading: (Boolean) -> Uni
|
||||||
} catch (e: Exception) {
|
} catch (e: Exception) {
|
||||||
ctx.importError = when (e) {
|
ctx.importError = when (e) {
|
||||||
is SocketTimeoutException -> "Connection timed out"
|
is SocketTimeoutException -> "Connection timed out"
|
||||||
else -> "Exception occurred: ${e.javaClass.canonicalName}"
|
else -> "Exception occurred: ${e.message}"
|
||||||
}
|
}
|
||||||
e.printStackTrace()
|
e.printStackTrace()
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue