mirror of
https://github.com/recloudstream/cloudstream.git
synced 2024-08-15 01:53:11 +00:00
Merge remote-tracking branch 'origin/master'
This commit is contained in:
commit
72f1726367
1 changed files with 3 additions and 4 deletions
|
@ -189,7 +189,7 @@ object PluginManager {
|
||||||
if (!dir.exists()) {
|
if (!dir.exists()) {
|
||||||
val res = dir.mkdirs()
|
val res = dir.mkdirs()
|
||||||
if (!res) {
|
if (!res) {
|
||||||
//logger.error("Failed to create directories!", null);
|
Log.w(TAG, "Failed to create local directories")
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -212,14 +212,13 @@ object PluginManager {
|
||||||
val filePath = file.absolutePath
|
val filePath = file.absolutePath
|
||||||
Log.i(TAG, "Loading plugin: $data")
|
Log.i(TAG, "Loading plugin: $data")
|
||||||
|
|
||||||
//logger.info("Loading plugin: " + fileName);
|
|
||||||
return try {
|
return try {
|
||||||
val loader = PathClassLoader(filePath, activity.classLoader)
|
val loader = PathClassLoader(filePath, activity.classLoader)
|
||||||
var manifest: Plugin.Manifest
|
var manifest: Plugin.Manifest
|
||||||
loader.getResourceAsStream("manifest.json").use { stream ->
|
loader.getResourceAsStream("manifest.json").use { stream ->
|
||||||
if (stream == null) {
|
if (stream == null) {
|
||||||
failedToLoad[file] = "No manifest found"
|
failedToLoad[file] = "No manifest found"
|
||||||
//logger.error("Failed to load plugin " + fileName + ": No manifest found", null);
|
Log.e(TAG, "Failed to load plugin $fileName: No manifest found")
|
||||||
return false
|
return false
|
||||||
}
|
}
|
||||||
InputStreamReader(stream).use { reader ->
|
InputStreamReader(stream).use { reader ->
|
||||||
|
@ -265,7 +264,7 @@ object PluginManager {
|
||||||
true
|
true
|
||||||
} catch (e: Throwable) {
|
} catch (e: Throwable) {
|
||||||
failedToLoad[file] = e
|
failedToLoad[file] = e
|
||||||
e.printStackTrace()
|
Log.e(TAG, "Failed to load $file: ${Log.getStackTraceString(e)}")
|
||||||
showToast(
|
showToast(
|
||||||
activity,
|
activity,
|
||||||
activity.getString(R.string.plugin_load_fail).format(fileName),
|
activity.getString(R.string.plugin_load_fail).format(fileName),
|
||||||
|
|
Loading…
Reference in a new issue