From 2b141e79cd401afd91f2c101ffbb51f162287067 Mon Sep 17 00:00:00 2001 From: Jack <1484288157@qq.com> Date: Mon, 9 Mar 2020 15:58:30 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E4=BC=9A=E5=88=B7=E5=88=B0?= =?UTF-8?q?=E9=87=8D=E5=A4=8D=E8=A7=86=E9=A2=91=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../video/detail/VideoDetailContainerViewModel.kt | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/app/src/main/java/com/gh/gamecenter/video/detail/VideoDetailContainerViewModel.kt b/app/src/main/java/com/gh/gamecenter/video/detail/VideoDetailContainerViewModel.kt index 4a5cdacb77..eb171daae1 100644 --- a/app/src/main/java/com/gh/gamecenter/video/detail/VideoDetailContainerViewModel.kt +++ b/app/src/main/java/com/gh/gamecenter/video/detail/VideoDetailContainerViewModel.kt @@ -46,6 +46,7 @@ class VideoDetailContainerViewModel(application: Application) : AndroidViewModel var gameId = "" private var page = 1 private var cacheVideoIds: MutableList? = null + private var cacheId = "" var positionAndPackageMap = HashMap() // key: packageName + position, value: position var isPauseVideo = true @@ -112,7 +113,9 @@ class VideoDetailContainerViewModel(application: Application) : AndroidViewModel cacheVideoIds = it requestMap["cache_video_ids"] = it val body = requestMap.createRequestBodyAny() - val cacheId = "${Util_System_Phone_State.getImei(HaloApp.getInstance().application)}${System.currentTimeMillis()}${Random.nextInt(9999)}" + if (cacheId.isEmpty()) { + cacheId = "${Util_System_Phone_State.getImei(HaloApp.getInstance().application)}${System.currentTimeMillis()}${Random.nextInt(9999)}" + } RetrofitManager.getInstance(getApplication()) .api.getVideoStream(type, body, videoId, cacheId, page) }.subscribeOn(Schedulers.io()) @@ -238,7 +241,7 @@ class VideoDetailContainerViewModel(application: Application) : AndroidViewModel .subscribeOn(Schedulers.io()) .subscribe(object : BiResponse() { override fun onSuccess(data: ResponseBody) { - Utils.toast(getApplication(), "取消点赞") + Utils.toast(getApplication(), "取消点赞") } override fun onFailure(exception: Exception) {