feat: change single episode monitoring status

This commit is contained in:
Simon Ding
2024-08-03 10:46:52 +08:00
parent 578b6a9d78
commit 16216fcc4f
8 changed files with 81 additions and 23 deletions

View File

@@ -48,6 +48,19 @@ class SeriesDetailData
var name = (sp.data as Map<String, dynamic>)["name"];
return name;
}
Future<void> changeMonitoringStatus(int episodeId, bool b) async {
final dio = APIs.getDio();
var resp = await dio.post(APIs.changeMonitoringUrl, data: {
"episode_id": episodeId,
"monitor": b,
});
var sp = ServerResponse.fromJson(resp.data);
if (sp.code != 0) {
throw sp.message;
}
ref.invalidateSelf();
}
}
class SeriesDetails {