mirror of
https://github.com/mihonapp/mihon.git
synced 2024-11-29 16:23:18 -05:00
For library update error log, group errors by error string, and then sort the resulting list by source (#5586)
Format is ``` ! Error # Source - Manga ```
This commit is contained in:
parent
7f76ffa5cb
commit
8bd965267c
1 changed files with 13 additions and 3 deletions
|
@ -511,9 +511,19 @@ class LibraryUpdateService(
|
||||||
if (errors.isNotEmpty()) {
|
if (errors.isNotEmpty()) {
|
||||||
val file = createFileInCacheDir("tachiyomi_update_errors.txt")
|
val file = createFileInCacheDir("tachiyomi_update_errors.txt")
|
||||||
file.bufferedWriter().use { out ->
|
file.bufferedWriter().use { out ->
|
||||||
errors.forEach { (manga, error) ->
|
// Error file format:
|
||||||
val source = sourceManager.getOrStub(manga.source)
|
// ! Error
|
||||||
out.write("${manga.title} ($source): $error\n")
|
// # Source
|
||||||
|
// - Manga
|
||||||
|
errors.groupBy({ it.second }, { it.first }).forEach { (error, mangas) ->
|
||||||
|
out.write("! ${error}\n")
|
||||||
|
mangas.groupBy { it.source }.forEach { (srcId, mangas) ->
|
||||||
|
val source = sourceManager.getOrStub(srcId)
|
||||||
|
out.write(" # $source\n")
|
||||||
|
mangas.forEach {
|
||||||
|
out.write(" - ${it.title}\n")
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return file
|
return file
|
||||||
|
|
Loading…
Reference in a new issue