feat: support for multiple audio/subtitle downloads

This commit is contained in:
rebelonion 2024-05-16 14:51:35 -05:00
parent fd8dd26435
commit f1d16ba16a
10 changed files with 137 additions and 117 deletions

View file

@ -0,0 +1,32 @@
package ani.dantotsu.addons.download
import android.content.Context
import android.net.Uri
interface DownloadAddonApiV2 {
fun cancelDownload(sessionId: Long)
fun setDownloadPath(context: Context, uri: Uri): String
suspend fun executeFFProbe(
videoUrl: String,
headers: Map<String, String> = emptyMap(),
logCallback: (String) -> Unit
)
suspend fun executeFFMpeg(
videoUrl: String,
downloadPath: String,
headers: Map<String, String> = emptyMap(),
subtitleUrls: List<Pair<String, String>> = emptyList(),
audioUrls: List<Pair<String, String>> = emptyList(),
statCallback: (Double) -> Unit
): Long
fun getState(sessionId: Long): String
fun getStackTrace(sessionId: Long): String?
fun hadError(sessionId: Long): Boolean
}