open-ani / animeko

一站式在线弹幕追番平台:全自动 BT + 在线多数据源聚合,离线缓存,Bangumi 收藏同步,弹幕云过滤 ... 100% Kotlin Compose Multiplatform
https://myani.org
GNU Affero General Public License v3.0
2.02k stars 62 forks source link

ikaros数据源数据转换问题 #1223

Closed chivehao closed 1 week ago

chivehao commented 1 week ago

问题描述

数据源结构是有变化嘛?目前没法正常用了,创建个issue等我有空时适配下。

复现步骤

No response

Ani 版本号

4.0.0-beta5

操作系统

Android, Windows

应用日志

2024-11-19 19:57:56 INFO  d.i.IkarosMediaSource [null:6]  POST https://ikaros.ch.ikaros.run/api/v1alpha1/subject/sync/platform?platform=BGM_TV&platformId=130250 [Authorized]: 200  in 246.377240ms
2024-11-19 19:57:56 ERROR a.d.m.f.MediaSourceMediaFetcher [null:192] Failed to fetch media from 76b9435e-83c8-41bb-a765-0030346e4e9c due to upstream error
B5.e: Expected response body of the type 'class me.him188.ani.datasources.ikaros.models.IkarosSubjectDetails' but was 'class io.ktor.utils.io.E'
In response from `https://ikaros.ch.ikaros.run/api/v1alpha1/subject/sync/platform?platform=BGM_TV&platformId=130250`
Response status `200 `
Response header `ContentType: null` 
Request header `Accept: application/json`

You can read how to resolve NoTransformationFoundException at FAQ: 
https://ktor.io/docs/faq.html#no-transformation-found-exception
    at B5.d.b(Unknown Source:236)
    at me.him188.ani.datasources.ikaros.IkarosClient.postSubjectSyncBgmTv(Unknown Source:127)
    at me.him188.ani.datasources.ikaros.IkarosClient$postSubjectSyncBgmTv$1.invokeSuspend(Unknown Source:12)
    at B6.a.resumeWith(Unknown Source:8)
    at l8.L.run(Unknown Source:106)
    at s8.a.run(Unknown Source:126)
Him188 commented 1 week ago

Response header ContentType: null

你需要返回 ContentType: application/json

chivehao commented 1 week ago

想起来了,好像是这个接口ikaros那边之前有调整,目前不返回值了,需要发起另外两请求,一个是获取SubjectSync,另一个是获取条目和获取剧集,等我有空时就适配下那边的接口变动。

说起来目前剧集看完,条目收藏更新之类的操作,有暴露事件给数据源嘛?

Him188 commented 1 week ago

目前数据源是单向的, 不支持接受事件

chivehao commented 1 week ago

目前数据源是单向的, 不支持接受事件

我的意思是,比如看完某个剧集,调用下数据源的某个方法通知下,比如

类似这种,数据源可以实现也可以不实现,至少数据源能感知到了。

Him188 commented 1 week ago

看完某个剧集,调用下数据源的某个方法通知下

你可以开个 issue