From 6cdc025c40633f7c00cefa006cbb72bf6a0a660c Mon Sep 17 00:00:00 2001 From: LittleSheep Date: Thu, 5 Sep 2024 21:53:42 +0800 Subject: [PATCH] :bug: Will throw track not found when has no privilege to play on netease cloud music --- lib/services/sourced_track/sources/netease.dart | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/lib/services/sourced_track/sources/netease.dart b/lib/services/sourced_track/sources/netease.dart index e7220fc..cce5294 100755 --- a/lib/services/sourced_track/sources/netease.dart +++ b/lib/services/sourced_track/sources/netease.dart @@ -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,