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) {}
|
||||
} catch (e: Exception) {
|
||||
ctx.importError = when (e) {
|
||||
else -> "Exception occurred: ${e.javaClass.canonicalName}"
|
||||
else -> "Exception occurred: ${e.message}"
|
||||
}
|
||||
e.printStackTrace()
|
||||
}
|
||||
|
|
|
|||
|
|
@ -78,6 +78,7 @@ fun parseRecipeFiles(ctx: MainActivity) {
|
|||
}
|
||||
|
||||
Recipe.clearCache()
|
||||
recipeFiles.clear()
|
||||
|
||||
// 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()
|
||||
|
||||
val newFile = File(parentDir, fileName)
|
||||
if (!newFile.exists()) {
|
||||
newFile.createNewFile()
|
||||
}
|
||||
else if (newFile.isDirectory) {
|
||||
if (newFile.isDirectory) {
|
||||
continue
|
||||
}
|
||||
|
||||
|
|
@ -107,7 +104,7 @@ fun sync(ctx: MainActivity, nav: NavHostController, setLoading: (Boolean) -> Uni
|
|||
} catch (e: Exception) {
|
||||
ctx.importError = when (e) {
|
||||
is SocketTimeoutException -> "Connection timed out"
|
||||
else -> "Exception occurred: ${e.javaClass.canonicalName}"
|
||||
else -> "Exception occurred: ${e.message}"
|
||||
}
|
||||
e.printStackTrace()
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue