Repository navigation
Releases
v2.12
Bug 修复
- 修复
TokenAutoRefreshPluginV2解析刷新令牌响应失败的问题。现在同时支持令牌字段直接位于响应根节点,或嵌套在response对象中的响应格式;刷新成功后会使用新令牌重试原请求。
破坏性变更
-
TokenStorage改为挂起接口。原有的
fun getToken(TokenType)和fun setToken(TokenType, String)
必须改为suspend实现,并新增以下方法:suspend fun getExpireTime(): Long? suspend fun setExpireTime(expire: Long?) suspend fun getProfile(): SimpleMeProfile? suspend fun setProfile(profile: SimpleMeProfile)
自定义存储器仍通过
PixivAccountFactory.newAccountFromConfig { storage = ... }传入,但所有存储操作必须在协程中执行。expire使用 Unix epoch 毫秒;登录验证PixivVerification.verify(...)和自动刷新成功后会写入新的 access token、refresh token、过期时间及SimpleMeProfile。searchIllust(...)与searchNovel(...)会优先读取缓存的 profile,缓存为空时调用getCurrentUserSimpleProfile()并写回缓存。 -
刷新令牌异常类型由拼写错误的
InvaidRefreshTokenException重命名为InvalidRefreshTokenException。调用方需要同步更新 import、catch 类型及测试;新类型支持可选的message和cause参数。 -
Illust.LimitLevel新增LIMIT_UNKNOWN。illust.limitLevel现在按图片链接前缀识别限制类型:r18g_、r18_、mypixiv_、sanity_level_、unviewable_和unknown_,其中未知或不可查看的限制映射到LIMIT_UNKNOWN。此前仅识别固定的 4 个图片 URL;使用穷举when处理LimitLevel的调用方必须增加LIMIT_UNKNOWN分支,illust.isLimited也会覆盖这些新增限制。
v2.11
v2.10.0
废弃了 val IllustComment.comment,新写法为IllustComment.comment(string or stamp id)
Full Changelog: https://github.com/magic-cucumber/pixko/commits/v2.10