debugging

This commit is contained in:
Blatzar 2021-11-04 17:07:29 +01:00
parent 8d772b8ad0
commit a941f71e90
3 changed files with 12 additions and 4 deletions

View file

@ -17,6 +17,7 @@ import com.lagradost.cloudstream3.isMovieType
import com.lagradost.cloudstream3.mvvm.observe
import com.lagradost.cloudstream3.ui.download.DownloadButtonSetup.handleDownloadClick
import com.lagradost.cloudstream3.utils.AppUtils.loadResult
import com.lagradost.cloudstream3.utils.Coroutines.main
import com.lagradost.cloudstream3.utils.DOWNLOAD_EPISODE_CACHE
import com.lagradost.cloudstream3.utils.DataStore
import com.lagradost.cloudstream3.utils.UIHelper.fixPaddingStatusbar
@ -44,9 +45,11 @@ class DownloadFragment : Fragment() {
}
private fun setList(list: List<VisualDownloadHeaderCached>) {
main {
(download_list?.adapter as DownloadHeaderAdapter?)?.cardList = list
download_list?.adapter?.notifyDataSetChanged()
}
}
override fun onDestroyView() {
(download_list?.adapter as DownloadHeaderAdapter?)?.killAdapter()

View file

@ -34,7 +34,6 @@ class DownloadFileWorkManager(val context: Context, private val workerParams: Wo
val info = applicationContext.getKey<VideoDownloadManager.DownloadInfo>(WORK_KEY_INFO, key)
val pkg =
applicationContext.getKey<VideoDownloadManager.DownloadResumePackage>(WORK_KEY_PACKAGE, key)
println("INFO $info PKG ::: $pkg")
if (info != null) {
downloadEpisode(
applicationContext,

View file

@ -1365,6 +1365,8 @@ object VideoDownloadManager {
val info = context.getKey<DownloadedFileInfo>(KEY_DOWNLOAD_INFO, id.toString()) ?: return null
val base = basePathToFile(context, info.basePath)
println("INFFOFOFOF $info ${base?.filePath} ")
if (isScopedStorage && base.isDownloadDir()) {
val cr = context.contentResolver ?: return null
val fileUri =
@ -1373,7 +1375,11 @@ object VideoDownloadManager {
if (fileLength == 0L) return null
return DownloadedFileInfoResult(fileLength, info.totalBytes, fileUri)
} else {
val file = base?.gotoDir(info.relativePath, false)?.findFile(info.displayName)
println("ffffffile ${file?.filePath} ${file?.uri} $file ")
// val normalPath = context.getNormalPath(getFile(info.relativePath), info.displayName)
// val dFile = File(normalPath)
@ -1409,7 +1415,7 @@ object VideoDownloadManager {
downloadStatusEvent.invoke(Pair(id, DownloadType.IsStopped))
downloadDeleteEvent.invoke(id)
val base = basePathToFile(context, info.basePath)
println("DOWNLOAD DIRRRR ----- ${base?.filePath} -------- ${info.relativePath} --------- ${info.displayName} -------- ${info.basePath} $")
if (isScopedStorage && base.isDownloadDir()) {
val cr = context.contentResolver ?: return false
val fileUri =