fix: excess scope and redundancy
This commit is contained in:
parent
12a5b602e9
commit
89fe3b82a3
1 changed files with 1 additions and 3 deletions
|
@ -355,15 +355,13 @@ class AnimeDownloaderService : Service() {
|
||||||
return false
|
return false
|
||||||
}
|
}
|
||||||
|
|
||||||
@OptIn(DelicateCoroutinesApi::class)
|
|
||||||
private fun saveMediaInfo(task: AnimeDownloadTask) {
|
private fun saveMediaInfo(task: AnimeDownloadTask) {
|
||||||
GlobalScope.launch(Dispatchers.IO) {
|
CoroutineScope(Dispatchers.IO).launch {
|
||||||
val directory = File(
|
val directory = File(
|
||||||
getExternalFilesDir(Environment.DIRECTORY_DOWNLOADS),
|
getExternalFilesDir(Environment.DIRECTORY_DOWNLOADS),
|
||||||
"${DownloadsManager.animeLocation}/${task.title}"
|
"${DownloadsManager.animeLocation}/${task.title}"
|
||||||
)
|
)
|
||||||
val episodeDirectory = File(directory, task.episode)
|
val episodeDirectory = File(directory, task.episode)
|
||||||
if (!directory.exists()) directory.mkdirs()
|
|
||||||
if (!episodeDirectory.exists()) episodeDirectory.mkdirs()
|
if (!episodeDirectory.exists()) episodeDirectory.mkdirs()
|
||||||
|
|
||||||
val file = File(directory, "media.json")
|
val file = File(directory, "media.json")
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue