修改会刷到重复视频问题

This commit is contained in:
Jack
2020-03-09 15:58:30 +08:00
parent 1259199e2c
commit 2b141e79cd

View File

@ -46,6 +46,7 @@ class VideoDetailContainerViewModel(application: Application) : AndroidViewModel
var gameId = ""
private var page = 1
private var cacheVideoIds: MutableList<String>? = null
private var cacheId = ""
var positionAndPackageMap = HashMap<String, Int>() // 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<ResponseBody>() {
override fun onSuccess(data: ResponseBody) {
Utils.toast(getApplication(), "取消点赞")
Utils.toast(getApplication(), "取消点赞")
}
override fun onFailure(exception: Exception) {