mirror of
https://github.com/tachiyomiorg/tachiyomi.git
synced 2024-12-23 15:41:52 +01:00
compile fixes
This commit is contained in:
parent
d308e0c29f
commit
281470252b
@ -1,7 +1,6 @@
|
||||
package eu.kanade.tachiyomi.data.backup
|
||||
|
||||
import android.content.Context
|
||||
import android.net.Uri
|
||||
import androidx.core.net.toUri
|
||||
import androidx.work.ExistingPeriodicWorkPolicy
|
||||
import androidx.work.PeriodicWorkRequestBuilder
|
||||
|
@ -1,7 +1,6 @@
|
||||
package eu.kanade.tachiyomi.data.download
|
||||
|
||||
import android.content.Context
|
||||
import android.net.Uri
|
||||
import androidx.core.net.toUri
|
||||
import com.hippo.unifile.UniFile
|
||||
import eu.kanade.tachiyomi.R
|
||||
@ -108,7 +107,6 @@ class DownloadProvider(private val context: Context) {
|
||||
}
|
||||
val afterScanlatorCheck = fileName.substringAfter("_")
|
||||
return@filter chapterNameHashSet.contains(fileName) || chapterNameHashSet.contains(afterScanlatorCheck)
|
||||
|
||||
}
|
||||
return@filter false
|
||||
}
|
||||
@ -164,21 +162,20 @@ class DownloadProvider(private val context: Context) {
|
||||
val chapterNameHashSet = chapters.map { it.name }.toHashSet()
|
||||
val scanalatorNameHashSet = chapters.map { getChapterDirName(it) }.toHashSet()
|
||||
|
||||
|
||||
return mangaDir.listFiles()!!.asList().filter { file ->
|
||||
file.name?.let { fileName ->
|
||||
if (fileName.endsWith(Downloader.TMP_DIR_SUFFIX)) {
|
||||
return@filter true
|
||||
}
|
||||
//check this first because this is the normal name format
|
||||
// check this first because this is the normal name format
|
||||
if (scanalatorNameHashSet.contains(fileName)) {
|
||||
return@filter false
|
||||
}
|
||||
val afterScanlatorCheck = fileName.substringAfter("_")
|
||||
//check both these dont exist because who knows how a chapter name is and it might not trim scanlator correctly
|
||||
// check both these dont exist because who knows how a chapter name is and it might not trim scanlator correctly
|
||||
return@filter !chapterNameHashSet.contains(fileName) && !chapterNameHashSet.contains(afterScanlatorCheck)
|
||||
}
|
||||
//everything else is considered true
|
||||
// everything else is considered true
|
||||
return@filter true
|
||||
}
|
||||
}
|
||||
|
@ -1,6 +1,5 @@
|
||||
package eu.kanade.tachiyomi.data.track.anilist
|
||||
|
||||
import android.net.Uri
|
||||
import androidx.core.net.toUri
|
||||
import com.github.salomonbrys.kotson.array
|
||||
import com.github.salomonbrys.kotson.get
|
||||
|
@ -1,6 +1,5 @@
|
||||
package eu.kanade.tachiyomi.data.track.bangumi
|
||||
|
||||
import android.net.Uri
|
||||
import androidx.core.net.toUri
|
||||
import com.github.salomonbrys.kotson.array
|
||||
import com.github.salomonbrys.kotson.obj
|
||||
|
@ -1,6 +1,5 @@
|
||||
package eu.kanade.tachiyomi.data.track.myanimelist
|
||||
|
||||
import android.net.Uri
|
||||
import androidx.core.net.toUri
|
||||
import eu.kanade.tachiyomi.data.database.models.Track
|
||||
import eu.kanade.tachiyomi.data.track.TrackManager
|
||||
|
@ -1,6 +1,5 @@
|
||||
package eu.kanade.tachiyomi.data.track.shikimori
|
||||
|
||||
import android.net.Uri
|
||||
import androidx.core.net.toUri
|
||||
import com.github.salomonbrys.kotson.array
|
||||
import com.github.salomonbrys.kotson.jsonObject
|
||||
@ -103,7 +102,7 @@ class ShikimoriApi(private val client: OkHttpClient, interceptor: ShikimoriInter
|
||||
.appendQueryParameter("target_type", "Manga").build()
|
||||
val request = Request.Builder().url(url.toString()).get().build()
|
||||
|
||||
val urlMangas ="$apiUrl/mangas".toUri().buildUpon().appendPath(track.media_id.toString())
|
||||
val urlMangas = "$apiUrl/mangas".toUri().buildUpon().appendPath(track.media_id.toString())
|
||||
.build()
|
||||
val requestMangas = Request.Builder().url(urlMangas.toString()).get().build()
|
||||
|
||||
|
@ -23,7 +23,6 @@ import androidx.core.content.ContextCompat
|
||||
import androidx.core.graphics.ColorUtils
|
||||
import androidx.core.view.GestureDetectorCompat
|
||||
import androidx.lifecycle.lifecycleScope
|
||||
import com.afollestad.materialdialogs.MaterialDialog
|
||||
import com.bluelinelabs.conductor.Conductor
|
||||
import com.bluelinelabs.conductor.Controller
|
||||
import com.bluelinelabs.conductor.ControllerChangeHandler
|
||||
|
@ -1,7 +1,6 @@
|
||||
package eu.kanade.tachiyomi.ui.manga.track
|
||||
|
||||
import android.content.Intent
|
||||
import android.net.Uri
|
||||
import android.os.Bundle
|
||||
import android.view.View
|
||||
import android.view.ViewGroup
|
||||
|
@ -7,7 +7,6 @@ import android.graphics.BitmapFactory
|
||||
import android.graphics.Color
|
||||
import android.graphics.PointF
|
||||
import android.graphics.drawable.Drawable
|
||||
import android.net.Uri
|
||||
import android.view.GestureDetector
|
||||
import android.view.Gravity
|
||||
import android.view.MotionEvent
|
||||
@ -459,7 +458,7 @@ class PagerPageHolder(
|
||||
}
|
||||
|
||||
val imageUrl = page.imageUrl
|
||||
if (imageUrl.orEmpty().startsWith("http", true)) {
|
||||
if (imageUrl != null && imageUrl.startsWith("http", true)) {
|
||||
PagerButton(context, viewer).apply {
|
||||
layoutParams = LayoutParams(WRAP_CONTENT, WRAP_CONTENT).apply {
|
||||
setMargins(margins, margins, margins, margins)
|
||||
|
@ -4,7 +4,6 @@ import android.annotation.SuppressLint
|
||||
import android.content.Intent
|
||||
import android.content.res.Resources
|
||||
import android.graphics.Color
|
||||
import android.net.Uri
|
||||
import android.view.Gravity
|
||||
import android.view.ViewGroup
|
||||
import android.view.ViewGroup.LayoutParams.MATCH_PARENT
|
||||
@ -452,7 +451,7 @@ class WebtoonPageHolder(
|
||||
}
|
||||
|
||||
val imageUrl = page?.imageUrl
|
||||
if (imageUrl.orEmpty().startsWith("http")) {
|
||||
if (imageUrl != null && imageUrl.startsWith("http")) {
|
||||
AppCompatButton(context).apply {
|
||||
layoutParams = FrameLayout.LayoutParams(WRAP_CONTENT, WRAP_CONTENT).apply {
|
||||
setMargins(0, margins, 0, margins)
|
||||
|
@ -2,7 +2,6 @@ package eu.kanade.tachiyomi.ui.setting
|
||||
|
||||
import android.app.Dialog
|
||||
import android.content.Intent
|
||||
import android.net.Uri
|
||||
import android.os.Bundle
|
||||
import androidx.core.net.toUri
|
||||
import androidx.preference.PreferenceScreen
|
||||
|
@ -4,7 +4,6 @@ import android.annotation.SuppressLint
|
||||
import android.app.Dialog
|
||||
import android.content.Context
|
||||
import android.content.Intent
|
||||
import android.net.Uri
|
||||
import android.os.Build
|
||||
import android.os.Bundle
|
||||
import android.os.PowerManager
|
||||
@ -175,7 +174,7 @@ class SettingsAdvancedController : SettingsController() {
|
||||
for (mangaFolder in mangaFolders) {
|
||||
val manga = sourceManga.find { downloadProvider.getMangaDirName(it) == mangaFolder.name }
|
||||
if (manga == null) {
|
||||
//download is orphaned and not even in the db delete it if remove non favorited is enabled
|
||||
// download is orphaned and not even in the db delete it if remove non favorited is enabled
|
||||
if (removeNonFavorite) {
|
||||
foldersCleared += 1 + (mangaFolder.listFiles()?.size ?: 0)
|
||||
mangaFolder.delete()
|
||||
|
Loading…
Reference in New Issue
Block a user