mirror of
https://github.com/recloudstream/cloudstream.git
synced 2024-08-15 01:53:11 +00:00
Revert name changes
This commit is contained in:
parent
4428431bad
commit
c38bc8aabf
5 changed files with 10 additions and 12 deletions
|
@ -622,8 +622,8 @@ abstract class MainAPI {
|
||||||
/**Used for testing and can be used to disable the providers if WebView is not available*/
|
/**Used for testing and can be used to disable the providers if WebView is not available*/
|
||||||
open val usesWebView = false
|
open val usesWebView = false
|
||||||
|
|
||||||
/** Determines which plugin a given provider is from */
|
/** Determines which plugin a given provider is from. This is the full path to the plugin. */
|
||||||
var sourcePluginPath: String? = null
|
var sourcePlugin: String? = null
|
||||||
|
|
||||||
open val hasMainPage = false
|
open val hasMainPage = false
|
||||||
open val hasQuickSearch = false
|
open val hasQuickSearch = false
|
||||||
|
|
|
@ -34,7 +34,7 @@ abstract class Plugin {
|
||||||
*/
|
*/
|
||||||
fun registerMainAPI(element: MainAPI) {
|
fun registerMainAPI(element: MainAPI) {
|
||||||
Log.i(PLUGIN_TAG, "Adding ${element.name} (${element.mainUrl}) MainAPI")
|
Log.i(PLUGIN_TAG, "Adding ${element.name} (${element.mainUrl}) MainAPI")
|
||||||
element.sourcePluginPath = this.__filepath
|
element.sourcePlugin = this.__filepath
|
||||||
// Race condition causing which would case duplicates if not for distinctBy
|
// Race condition causing which would case duplicates if not for distinctBy
|
||||||
synchronized(APIHolder.allProviders) {
|
synchronized(APIHolder.allProviders) {
|
||||||
APIHolder.allProviders.add(element)
|
APIHolder.allProviders.add(element)
|
||||||
|
@ -48,7 +48,7 @@ abstract class Plugin {
|
||||||
*/
|
*/
|
||||||
fun registerExtractorAPI(element: ExtractorApi) {
|
fun registerExtractorAPI(element: ExtractorApi) {
|
||||||
Log.i(PLUGIN_TAG, "Adding ${element.name} (${element.mainUrl}) ExtractorApi")
|
Log.i(PLUGIN_TAG, "Adding ${element.name} (${element.mainUrl}) ExtractorApi")
|
||||||
element.sourcePluginPath = this.__filepath
|
element.sourcePlugin = this.__filepath
|
||||||
extractorApis.add(element)
|
extractorApis.add(element)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -18,7 +18,6 @@ import com.lagradost.cloudstream3.APIHolder.getApiProviderLangSettings
|
||||||
import com.lagradost.cloudstream3.APIHolder.removePluginMapping
|
import com.lagradost.cloudstream3.APIHolder.removePluginMapping
|
||||||
import com.lagradost.cloudstream3.AcraApplication.Companion.getActivity
|
import com.lagradost.cloudstream3.AcraApplication.Companion.getActivity
|
||||||
import com.lagradost.cloudstream3.AcraApplication.Companion.getKey
|
import com.lagradost.cloudstream3.AcraApplication.Companion.getKey
|
||||||
import com.lagradost.cloudstream3.AcraApplication.Companion.removeKey
|
|
||||||
import com.lagradost.cloudstream3.AcraApplication.Companion.setKey
|
import com.lagradost.cloudstream3.AcraApplication.Companion.setKey
|
||||||
import com.lagradost.cloudstream3.CommonActivity.showToast
|
import com.lagradost.cloudstream3.CommonActivity.showToast
|
||||||
import com.lagradost.cloudstream3.MainAPI.Companion.settingsForProvider
|
import com.lagradost.cloudstream3.MainAPI.Companion.settingsForProvider
|
||||||
|
@ -567,14 +566,14 @@ object PluginManager {
|
||||||
|
|
||||||
// remove all registered apis
|
// remove all registered apis
|
||||||
synchronized(APIHolder.apis) {
|
synchronized(APIHolder.apis) {
|
||||||
APIHolder.apis.filter { api -> api.sourcePluginPath == plugin.__filepath }.forEach {
|
APIHolder.apis.filter { api -> api.sourcePlugin == plugin.__filepath }.forEach {
|
||||||
removePluginMapping(it)
|
removePluginMapping(it)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
synchronized(APIHolder.allProviders) {
|
synchronized(APIHolder.allProviders) {
|
||||||
APIHolder.allProviders.removeIf { provider: MainAPI -> provider.sourcePluginPath == plugin.__filepath }
|
APIHolder.allProviders.removeIf { provider: MainAPI -> provider.sourcePlugin == plugin.__filepath }
|
||||||
}
|
}
|
||||||
extractorApis.removeIf { provider: ExtractorApi -> provider.sourcePluginPath == plugin.__filepath }
|
extractorApis.removeIf { provider: ExtractorApi -> provider.sourcePlugin == plugin.__filepath }
|
||||||
|
|
||||||
classLoaders.values.removeIf { v -> v == plugin }
|
classLoaders.values.removeIf { v -> v == plugin }
|
||||||
|
|
||||||
|
|
|
@ -2,7 +2,6 @@ package com.lagradost.cloudstream3.ui.settings.testing
|
||||||
|
|
||||||
import android.app.AlertDialog
|
import android.app.AlertDialog
|
||||||
import android.view.LayoutInflater
|
import android.view.LayoutInflater
|
||||||
import android.view.View
|
|
||||||
import android.view.ViewGroup
|
import android.view.ViewGroup
|
||||||
import android.widget.ImageView
|
import android.widget.ImageView
|
||||||
import android.widget.TextView
|
import android.widget.TextView
|
||||||
|
@ -89,7 +88,7 @@ class TestResultAdapter(override val items: MutableList<Pair<MainAPI, TestingUti
|
||||||
// Ok button just closes the dialog
|
// Ok button just closes the dialog
|
||||||
.setPositiveButton(R.string.ok) { _, _ -> }
|
.setPositiveButton(R.string.ok) { _, _ -> }
|
||||||
|
|
||||||
api.sourcePluginPath?.let { path ->
|
api.sourcePlugin?.let { path ->
|
||||||
val pluginFile = File(path)
|
val pluginFile = File(path)
|
||||||
// Cannot delete a deleted plugin
|
// Cannot delete a deleted plugin
|
||||||
if (!pluginFile.exists()) return@let
|
if (!pluginFile.exists()) return@let
|
||||||
|
|
|
@ -1000,8 +1000,8 @@ abstract class ExtractorApi {
|
||||||
abstract val mainUrl: String
|
abstract val mainUrl: String
|
||||||
abstract val requiresReferer: Boolean
|
abstract val requiresReferer: Boolean
|
||||||
|
|
||||||
/** Determines which plugin a given extractor is from */
|
/** Determines which plugin a given provider is from. This is the full path to the plugin. */
|
||||||
var sourcePluginPath: String? = null
|
var sourcePlugin: String? = null
|
||||||
|
|
||||||
//suspend fun getSafeUrl(url: String, referer: String? = null): List<ExtractorLink>? {
|
//suspend fun getSafeUrl(url: String, referer: String? = null): List<ExtractorLink>? {
|
||||||
// return suspendSafeApiCall { getUrl(url, referer) }
|
// return suspendSafeApiCall { getUrl(url, referer) }
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue