Merge remote-tracking branch 'origin/dev' into dev

This commit is contained in:
aayush262 2024-03-12 10:23:12 +05:30
commit 07662a91f4
3 changed files with 6 additions and 4 deletions

View file

@ -163,7 +163,7 @@ object Anilist {
throw Exception("Rate limited after $retry seconds") throw Exception("Rate limited after $retry seconds")
} }
if (!json.text.startsWith("{")) {throw Exception(currContext()?.getString(R.string.anilist_down))} if (!json.text.startsWith("{")) {throw Exception(currContext()?.getString(R.string.anilist_down))}
if (show) println("Response : ${json.text}") if (show) Logger.log("Anilist Query: ${json.text}")
json.parsed() json.parsed()
} else null } else null
} catch (e: Exception) { } catch (e: Exception) {

View file

@ -23,6 +23,7 @@ import ani.dantotsu.others.MalScraper
import ani.dantotsu.settings.saving.PrefManager import ani.dantotsu.settings.saving.PrefManager
import ani.dantotsu.settings.saving.PrefName import ani.dantotsu.settings.saving.PrefName
import ani.dantotsu.snackString import ani.dantotsu.snackString
import ani.dantotsu.util.Logger
import kotlinx.coroutines.async import kotlinx.coroutines.async
import kotlinx.coroutines.awaitAll import kotlinx.coroutines.awaitAll
import kotlinx.coroutines.runBlocking import kotlinx.coroutines.runBlocking
@ -464,7 +465,8 @@ class AnilistQueries {
}, recommendationPlannedQueryManga: ${recommendationPlannedQuery("MANGA")}""" }, recommendationPlannedQueryManga: ${recommendationPlannedQuery("MANGA")}"""
query += """}""".trimEnd(',') query += """}""".trimEnd(',')
val response = executeQuery<Query.HomePageMedia>(query) val response = executeQuery<Query.HomePageMedia>(query, show = true)
Logger.log(response.toString())
val returnMap = mutableMapOf<String, ArrayList<Media>>() val returnMap = mutableMapOf<String, ArrayList<Media>>()
fun current(type: String) { fun current(type: String) {
val subMap = mutableMapOf<Int, Media>() val subMap = mutableMapOf<Int, Media>()

View file

@ -94,7 +94,7 @@ object Logger {
if (file == null) e.printStackTrace() else { if (file == null) e.printStackTrace() else {
file?.appendText("---------------------------Exception---------------------------\n") file?.appendText("---------------------------Exception---------------------------\n")
file?.appendText("date/time: ${Date()} | ${e.message}\n") file?.appendText("date/time: ${Date()} | ${e.message}\n")
file?.appendText("trace: ${e.stackTrace}\n") file?.appendText("trace: ${e.stackTraceToString()}\n")
} }
} }
} }
@ -104,7 +104,7 @@ object Logger {
if (file == null) e.printStackTrace() else { if (file == null) e.printStackTrace() else {
file?.appendText("---------------------------Exception---------------------------\n") file?.appendText("---------------------------Exception---------------------------\n")
file?.appendText("date/time: ${Date()} | ${e.message}\n") file?.appendText("date/time: ${Date()} | ${e.message}\n")
file?.appendText("trace: ${e.stackTrace}\n") file?.appendText("trace: ${e.stackTraceToString()}\n")
} }
} }
} }