This commit is contained in:
rebelonion 2024-01-26 00:29:19 -06:00
parent 49b3c33fbc
commit 0ebd067bc2
22 changed files with 121 additions and 68 deletions

View file

@ -45,9 +45,18 @@ class SubtitleDownloader {
}
//actually downloads lol
suspend fun downloadSubtitle(context: Context, url: String, downloadedType: DownloadedType) {
suspend fun downloadSubtitle(
context: Context,
url: String,
downloadedType: DownloadedType
) {
try {
val directory = DownloadsManager.getDirectory(context, downloadedType.type, downloadedType.title, downloadedType.chapter)
val directory = DownloadsManager.getDirectory(
context,
downloadedType.type,
downloadedType.title,
downloadedType.chapter
)
if (!directory.exists()) { //just in case
directory.mkdirs()
}