VideoDownloadManager

Types

Link copied to clipboard
data class DownloadMetaData(id: Int?, linkHash: Int, var bytesDownloaded: Long = 0, var bytesWritten: Long = 0, var totalBytes: Long? = null, lastUpdatedMs: Long = 0, lastDownloadedBytes: Long = 0, createNotificationCallback: (DownloadObjects.CreateNotificationMetadata) -> Unit, internalType: VideoDownloadManager.DownloadType = DownloadType.IsPending, val isHLS: Boolean, var hlsProgress: Int = 0, var hlsTotal: Int? = null, var hlsWrittenProgress: Int = 0, downloadFileInfoTemplate: DownloadObjects.DownloadedFileInfo? = null) : Closeable

This class handles the notifications, as well as the relevant key

Link copied to clipboard
class EpisodeDownloadInstance(val context: Context, val downloadQueueWrapper: DownloadObjects.DownloadQueueWrapper)
Link copied to clipboard
data class LazyStreamDownloadData(url: String, headers: Map<String, String>, referer: String, chuckStartByte: LongArray, val totalLength: Long?, val downloadLength: Long?, val chuckSize: Long, val bufferSize: Int, val isResumed: Boolean)

Properties

Link copied to clipboard
val currentDownloads: StateFlow<Set<Int>>
Link copied to clipboard

50MB minimum size

Link copied to clipboard
Link copied to clipboard
val imgDone: ERROR CLASS: Unresolved name: rddone
Link copied to clipboard
val imgDownloading: ERROR CLASS: Unresolved name: rdload
Link copied to clipboard
val imgError: ERROR CLASS: Unresolved name: rderror
Link copied to clipboard
val imgPaused: ERROR CLASS: Unresolved name: rdpause
Link copied to clipboard
val imgStopped: ERROR CLASS: Unresolved name: rderror
Link copied to clipboard
Link copied to clipboard

A key to save all the downloads which have not yet started and those currently running, using DownloadQueueWrapper can store keys which should not be automatically queued, unlike this key.

Link copied to clipboard
Link copied to clipboard
val pressToPauseIcon: ERROR CLASS: Unresolved name: ic_baseline_pause_24
Link copied to clipboard
val pressToResumeIcon: ERROR CLASS: Unresolved name: ic_baseline_play_arrow_24
Link copied to clipboard
val pressToStopIcon: ERROR CLASS: Unresolved name: baseline_stop_24
Link copied to clipboard
const val TAG: String

Functions

Link copied to clipboard
fun deleteFilesAndUpdateSettings(context: Context, ids: Set<Int>, scope: CoroutineScope, onComplete: (Set<Int>) -> Unit = {})
Link copied to clipboard
suspend fun downloadThing(context: Context, link: IDownloadableMinimum, name: String, folder: String, extension: String, tryResume: Boolean, parentId: Int?, createNotificationCallback: (DownloadObjects.CreateNotificationMetadata) -> Unit, parallelConnections: Int = 3, minimumSize: Long = 100): DownloadObjects.DownloadStatus

download a file that consist of a single stream of data

Link copied to clipboard
fun getDownloadEpisodeMetadata(episode: ResultEpisode, titleName: String, apiName: String, currentPoster: String?, currentIsMovie: Boolean, tvType: TvType): DownloadObjects.DownloadEpisodeMetadata
Link copied to clipboard
Link copied to clipboard
fun setupStream(context: Context, name: String, folder: String?, extension: String, tryResume: Boolean): DownloadObjects.StreamData

fun setupStream(baseFile: SafeFile, name: String, folder: String?, extension: String, tryResume: Boolean): DownloadObjects.StreamData

Sets up the appropriate file and creates a data stream from the file. Used for initializing downloads and backups.

Link copied to clipboard
suspend fun streamLazy(url: String, headers: Map<String, String>, referer: String, startByte: Long, chuckSize: Long = (1 shl 20) * 10, bufferSize: Int = DEFAULT_BUFFER_SIZE, maximumSmallSize: Long = chuckSize * 2): VideoDownloadManager.LazyStreamDownloadData