mirror of
https://github.com/recloudstream/cloudstream.git
synced 2024-08-15 01:53:11 +00:00
Prevent re-loading plugins if they're already loaded previously upon checking for plugin updates.
This commit is contained in:
parent
006d8e37de
commit
7341f23c0f
2 changed files with 7 additions and 6 deletions
|
@ -576,7 +576,7 @@ class MainActivity : AppCompatActivity(), ColorPickerDialogListener {
|
||||||
false
|
false
|
||||||
)
|
)
|
||||||
) {
|
) {
|
||||||
PluginManager.downloadNotExistingPluginsAndLoad(this@MainActivity)
|
PluginManager.downloadNotExistingPluginsAndLoad(this@MainActivity, isLoaded)
|
||||||
isLoaded = true
|
isLoaded = true
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -284,11 +284,12 @@ object PluginManager {
|
||||||
* 2. Fetch all not downloaded plugins
|
* 2. Fetch all not downloaded plugins
|
||||||
* 3. Download them and reload plugins
|
* 3. Download them and reload plugins
|
||||||
**/
|
**/
|
||||||
fun downloadNotExistingPluginsAndLoad(activity: Activity) {
|
fun downloadNotExistingPluginsAndLoad(activity: Activity, isLoaded: Boolean) {
|
||||||
// Load all plugins as fast as possible!
|
// Load all plugins as fast as possible, if its not loaded yet.
|
||||||
|
if (!isLoaded) {
|
||||||
loadAllOnlinePlugins(activity)
|
loadAllOnlinePlugins(activity)
|
||||||
|
|
||||||
afterPluginsLoadedEvent.invoke(true)
|
afterPluginsLoadedEvent.invoke(true)
|
||||||
|
}
|
||||||
|
|
||||||
val newDownloadPlugins = mutableListOf<String>()
|
val newDownloadPlugins = mutableListOf<String>()
|
||||||
val urls = (getKey<Array<RepositoryData>>(REPOSITORIES_KEY)
|
val urls = (getKey<Array<RepositoryData>>(REPOSITORIES_KEY)
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue