mirror of
				https://github.com/mihonapp/mihon.git
				synced 2025-11-03 23:58:55 +01:00 
			
		
		
		
	Migrate old update jobs
This commit is contained in:
		@@ -1,6 +1,7 @@
 | 
			
		||||
package exh
 | 
			
		||||
 | 
			
		||||
import android.content.Context
 | 
			
		||||
import android.os.Build
 | 
			
		||||
import com.elvishew.xlog.XLog
 | 
			
		||||
import com.pushtorefresh.storio.sqlite.queries.Query
 | 
			
		||||
import com.pushtorefresh.storio.sqlite.queries.RawQuery
 | 
			
		||||
@@ -14,6 +15,7 @@ import eu.kanade.tachiyomi.data.database.resolvers.MangaUrlPutResolver
 | 
			
		||||
import eu.kanade.tachiyomi.data.database.tables.MangaTable
 | 
			
		||||
import eu.kanade.tachiyomi.data.preference.PreferencesHelper
 | 
			
		||||
import eu.kanade.tachiyomi.data.preference.getOrDefault
 | 
			
		||||
import eu.kanade.tachiyomi.util.jobScheduler
 | 
			
		||||
import exh.source.BlacklistedSources
 | 
			
		||||
import rx.Observable
 | 
			
		||||
import uy.kohesive.injekt.injectLazy
 | 
			
		||||
@@ -77,7 +79,6 @@ object EXHMigrations {
 | 
			
		||||
                    backupDatabase(context, oldVersion)
 | 
			
		||||
                }
 | 
			
		||||
 | 
			
		||||
                // Backup database in next release
 | 
			
		||||
                if (oldVersion < 8405) {
 | 
			
		||||
                    db.inTransaction {
 | 
			
		||||
                        // Migrate HBrowse source IDs
 | 
			
		||||
@@ -90,6 +91,11 @@ object EXHMigrations {
 | 
			
		||||
                                .affectsTables(MangaTable.TABLE)
 | 
			
		||||
                                .build())
 | 
			
		||||
                    }
 | 
			
		||||
 | 
			
		||||
                    // Cancel old scheduler jobs with old ids
 | 
			
		||||
                    if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) {
 | 
			
		||||
                        context.jobScheduler.cancelAll()
 | 
			
		||||
                    }
 | 
			
		||||
                }
 | 
			
		||||
 | 
			
		||||
                // TODO BE CAREFUL TO NOT FUCK UP MergedSources IF CHANGING URLs
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user