🐛 Will throw track not found when has no privilege to play on netease cloud music

This commit is contained in:
LittleSheep 2024-09-05 21:53:42 +08:00
parent de3ad4b21e
commit 6cdc025c40

View File

@ -75,7 +75,12 @@ class NeteaseSourcedTrack extends SourcedTrack {
throw TrackNotFoundError(track);
}
await db.database.into(db.database.sourceMatchTable).insert(
final client = getClient();
final checkResp =
await client.get('/check/music?id=${siblings.first.info.id}');
if (checkResp.body['success'] != true) throw TrackNotFoundError(track);
await await db.database.into(db.database.sourceMatchTable).insert(
SourceMatchTableCompanion.insert(
trackId: track.id!,
sourceId: siblings.first.info.id,