Skip to content

Commit 67180c5

Browse files
committed
修复一些bug
1 parent 4cef7bd commit 67180c5

4 files changed

Lines changed: 17 additions & 11 deletions

File tree

‎app/src/main/java/remix/myplayer/request/qq/QQClient.kt‎

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -25,8 +25,9 @@ class QQClient @Inject constructor(
2525
// 通用参数
2626
private val comm = mutableMapOf<String, Any>(
2727
"ct" to 11,
28-
"cv" to "2111",
29-
"v" to "2111",
28+
// QQ 音乐目前只接受轻量版客户端标识;桌面版组合会返回 2001。
29+
"cv" to "1003006",
30+
"v" to "1003006",
3031
"os_ver" to "15",
3132
"phonetype" to "24122RKC7C", // REDMI K80 Pro
3233
"rom" to "Redmi/miro/miro:15/AE3A.240806.005/OS2.0.10${
@@ -35,7 +36,7 @@ class QQClient @Inject constructor(
3536
6
3637
)
3738
}.0.VOMCNXM:user/release-keys",
38-
"tmeAppID" to "qqmusic",
39+
"tmeAppID" to "qqmusiclight",
3940
"nettype" to "NETWORK_WIFI",
4041
"udid" to "0"
4142
)
@@ -56,7 +57,8 @@ class QQClient @Inject constructor(
5657
val data = request("GetSession", "music.getSession.session", param)
5758
val session = data.getJSONObject("session")
5859

59-
comm["uid"] = session.getString("uid")
60+
// 服务端返回的是数值 uid,保留其 JSON 类型以匹配轻量版客户端请求。
61+
comm["uid"] = session.getLong("uid")
6062
comm["sid"] = session.getString("sid")
6163
comm["userip"] = session.getString("userip")
6264

@@ -131,8 +133,8 @@ class QQClient @Inject constructor(
131133
"grp" to 1
132134
)
133135

134-
val data = request("DoSearchForQQMusicDesktop", "music.search.SearchCgiService", param)
135-
val itemSong = data.getJSONObject("body").getJSONObject("song").optJSONArray("list") ?: JSONArray()
136+
val data = request("DoSearchForQQMusicLite", "music.search.SearchCgiService", param)
137+
val itemSong = data.getJSONObject("body").optJSONArray("item_song") ?: JSONArray()
136138
val result = ArrayList<QQSong>()
137139
for (i in 0 until itemSong.length()) {
138140
val obj = itemSong.getJSONObject(i)

‎app/src/main/java/remix/myplayer/service/MusicService.kt‎

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -807,10 +807,10 @@ class MusicService : BaseService(),
807807
*/
808808
private fun start(crossFade: Boolean) {
809809
Timber.v("play: $crossFade")
810-
if (!playback.isPrepared) {
811-
MessageNotifier.show(R.string.buffering_wait)
812-
return
813-
}
810+
// if (!playback.isPrepared) {
811+
// MessageNotifier.show(R.string.buffering_wait)
812+
// return
813+
// }
814814

815815
// 播放
816816
playback.start()

‎app/src/main/java/remix/myplayer/ui/screen/playing/PlayingLyric.kt‎

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -175,6 +175,10 @@ internal fun PlayingLyric(song: Song) {
175175

176176
when (extra) {
177177
LyricManager.CHANGE_LYRIC -> {
178+
if (!currentSong.valid()) {
179+
return
180+
}
181+
178182
lyricsManager.clearCache(currentSong)
179183

180184
// 如果是手动选择则直接使用UriProvider解析

‎app/src/main/java/remix/myplayer/util/ImageUtil.kt‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ object ImageUtil {
6666
}
6767
return@withContext null
6868
} catch (e: Exception) {
69-
Timber.w("extractAlbumArt", e)
69+
Timber.w(e, "extractAlbumArt")
7070
return@withContext null
7171
}
7272
}

0 commit comments

Comments
 (0)