DownloadClient

The client for downloading tracks. Needs to support the following:

  • Get the download tracks for the given media item.

  • Get the download folder for the given context of downloading track.

  • Which server to use for downloading.

  • Which sources to use for downloading.

  • Download the given sources.

  • Merge the given media files into a single file.

  • Tag a file with the given track metadata.

  • The maximum number of concurrent downloads allowed.

Properties

Link copied to clipboard
abstract val concurrentDownloads: Int

The maximum number of concurrent downloads allowed.

Functions

Link copied to clipboard
abstract suspend fun download(progressFlow: <Error class: unknown class><Progress>, context: DownloadContext, source: Streamable.Source): File

Download the given source.

Link copied to clipboard
abstract suspend fun getDownloadTracks(extensionId: String, item: EchoMediaItem, context: EchoMediaItem?): List<DownloadContext>

Get the download tracks for the given item.

Link copied to clipboard
abstract suspend fun getSettingItems(): List<Setting>

List of Settings to be displayed in the settings screen

Link copied to clipboard
abstract suspend fun merge(progressFlow: <Error class: unknown class><Progress>, context: DownloadContext, files: List<File>): File

Merge the given media files into a single file. The old files should be deleted after merging.

Link copied to clipboard
open suspend fun onExtensionSelected()

Only called when an extension is selected by the user, not when the extension is loaded Use the onInitialize for doing stuff to initialize the extension

Link copied to clipboard
open suspend fun onInitialize()

Called when the extension is loaded, called after all the injections are done. Only called once

Link copied to clipboard
abstract suspend fun selectServer(context: DownloadContext): Streamable

Which server to use for downloading. use this to get the available servers.

Link copied to clipboard

Which source to use for downloading.

Link copied to clipboard
abstract fun setSettings(settings: Settings)

Called when the extension is initialized, to provide the Settings to the extension

Link copied to clipboard
abstract suspend fun tag(progressFlow: <Error class: unknown class><Progress>, context: DownloadContext, file: File): File

Tag a file with the given track metadata use this to tag the file with the track metadata