fix(anilist): fixed some TypeErrors (#233)

* fix(anilist): forward-declare flushCoverSnapshot before first use

* fix(anilist): split json.encode from writeFile call to avoid arg splat

* chore(anilist): version bump
This commit is contained in:
Justin
2026-08-03 22:36:52 -04:00
committed by GitHub
parent 774a439b35
commit fb16e3d3a5
2 changed files with 9 additions and 6 deletions
+1 -1
View File
@@ -1,6 +1,6 @@
id = "cleboost/anilist"
name = "AniList (UNOFFICIAL)"
version = "1.1.1"
version = "1.1.2"
plugin_api = 15
author = "Cleboost"
license = "MIT"
+8 -5
View File
@@ -35,6 +35,7 @@ local oauthStartedAt = 0
local libraryFetch = nil
local finalizeQueue = nil
local flushCoverSnapshot
local legacyCachePurged = false
local pendingLegacyPurge = false
@@ -317,10 +318,11 @@ local function writeCoverMeta(mediaId, url)
if not metaPath then
return
end
noctalia.writeFile(metaPath, noctalia.json.encode({
local payload = noctalia.json.encode({
url = url,
version = COVER_CACHE_VERSION,
}))
})
noctalia.writeFile(metaPath, payload)
end
local function removeCoverCache(mediaId)
@@ -411,7 +413,7 @@ local function requestCoverSnapshot()
pendingCoverSnapshot = true
end
local function flushCoverSnapshot()
function flushCoverSnapshot()
if pendingCoverSnapshot then
pendingCoverSnapshot = false
publishSnapshot()
@@ -1289,10 +1291,11 @@ local function startOAuthLogin()
local resultPath = dataDir .. "/" .. OAUTH_RESULT_FILE
noctalia.removeFile(resultPath)
local credOk = noctalia.writeFile(credPath, noctalia.json.encode({
local credPayload = noctalia.json.encode({
client_id = clientId,
client_secret = clientSecret,
}))
})
local credOk = noctalia.writeFile(credPath, credPayload)
if not credOk then
setError(tr("oauth_unavailable"))
return