refactor: composer loader

Signed-off-by: rhunk <101876869+rhunk@users.noreply.github.com>
This commit is contained in:
rhunk
2024-06-08 21:31:47 +02:00
parent c72cc1d320
commit 31ae06ed62
4 changed files with 15 additions and 15 deletions

View File

@@ -91,6 +91,12 @@ class RemoteFileHandleManager(
File(userImportFolder, name.substringAfterLast("/"))
)
}
FileHandleScope.COMPOSER -> {
return AssetFileHandle(
context,
"composer/${name.substringAfterLast("/")}"
)
}
else -> return null
}
}

View File

@@ -193,12 +193,6 @@ class RemoteScriptManager(
}
override fun getScriptContent(moduleName: String): ParcelFileDescriptor? {
if (moduleName.startsWith("composer/")) {
return runCatching {
context.androidContext.assets.open("composer/${moduleName.removePrefix("composer/")}")
.toParcelFileDescriptor(context.coroutineScope)
}.getOrNull()
}
return getScriptInputStream(moduleName) { it?.toParcelFileDescriptor(context.coroutineScope) }
}