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:
+1
-1
@@ -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"
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user