Skip to content

Commit

Permalink
debugging
Browse files Browse the repository at this point in the history
  • Loading branch information
Blatzar committed Nov 4, 2021
1 parent 8d772b8 commit a941f71
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -44,8 +45,10 @@ class DownloadFragment : Fragment() {
}

private fun setList(list: List<VisualDownloadHeaderCached>) {
(download_list?.adapter as DownloadHeaderAdapter?)?.cardList = list
download_list?.adapter?.notifyDataSetChanged()
main {
(download_list?.adapter as DownloadHeaderAdapter?)?.cardList = list
download_list?.adapter?.notifyDataSetChanged()
}
}

override fun onDestroyView() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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 =
Expand All @@ -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)

Expand Down Expand Up @@ -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 =
Expand Down

0 comments on commit a941f71

Please sign in to comment.