Skip to content

Commit

Permalink
Warinrgs (wip)
Browse files Browse the repository at this point in the history
im sleeping
  • Loading branch information
Caio99BR committed Jul 2, 2024
1 parent be801f7 commit 2710a7c
Show file tree
Hide file tree
Showing 9 changed files with 17 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import android.content.Context
import eu.kanade.tachiyomi.data.download.model.Download
import eu.kanade.tachiyomi.source.Source
import eu.kanade.tachiyomi.source.model.Page
import kotlinx.coroutines.DelicateCoroutinesApi
import kotlinx.coroutines.flow.Flow
import kotlinx.coroutines.flow.asFlow
import kotlinx.coroutines.flow.drop
Expand Down Expand Up @@ -32,6 +33,7 @@ import uy.kohesive.injekt.api.get
* and retrieved through dependency injection. You can use this class to queue new chapters or query
* downloaded chapters.
*/
@DelicateCoroutinesApi
class DownloadManager(
private val context: Context,
private val provider: DownloadProvider = Injekt.get(),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ import eu.kanade.tachiyomi.util.storage.DiskUtil.NOMEDIA_FILE
import eu.kanade.tachiyomi.util.storage.saveTo
import kotlinx.coroutines.CancellationException
import kotlinx.coroutines.CoroutineScope
import kotlinx.coroutines.DelicateCoroutinesApi
import kotlinx.coroutines.Dispatchers
import kotlinx.coroutines.Job
import kotlinx.coroutines.SupervisorJob
Expand Down Expand Up @@ -67,6 +68,7 @@ import java.util.Locale
*
* Its queue contains the list of chapters to download.
*/
@DelicateCoroutinesApi
class Downloader(
private val context: Context,
private val provider: DownloadProvider,
Expand Down Expand Up @@ -111,6 +113,7 @@ class Downloader(
var isPaused: Boolean = false

init {
@Suppress("OPT_IN_USAGE")
launchNow {
val chapters = async { store.restore() }
addAllToQueue(chapters.await())
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ import eu.kanade.tachiyomi.util.system.cancelNotification
import eu.kanade.tachiyomi.util.system.getBitmapOrNull
import eu.kanade.tachiyomi.util.system.notificationBuilder
import eu.kanade.tachiyomi.util.system.notify
import kotlinx.coroutines.DelicateCoroutinesApi
import tachiyomi.core.common.Constants
import tachiyomi.core.common.i18n.pluralStringResource
import tachiyomi.core.common.i18n.stringResource
Expand All @@ -42,6 +43,7 @@ import uy.kohesive.injekt.api.get
import java.math.RoundingMode
import java.text.NumberFormat

@DelicateCoroutinesApi
class LibraryUpdateNotifier(
private val context: Context,

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ import eu.kanade.tachiyomi.util.system.getParcelableExtraCompat
import eu.kanade.tachiyomi.util.system.notificationManager
import eu.kanade.tachiyomi.util.system.toShareIntent
import eu.kanade.tachiyomi.util.system.toast
import kotlinx.coroutines.DelicateCoroutinesApi
import kotlinx.coroutines.runBlocking
import tachiyomi.core.common.Constants
import tachiyomi.core.common.util.lang.launchIO
Expand All @@ -39,6 +40,7 @@ import eu.kanade.tachiyomi.BuildConfig.APPLICATION_ID as ID
* Pending Broadcasts should be made from here.
* NOTE: Use local broadcasts if possible.
*/
@DelicateCoroutinesApi
class NotificationReceiver : BroadcastReceiver() {

private val getManga: GetManga by injectLazy()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ class Bangumi(id: Long) : BaseTracker(id, "Bangumi") {
override suspend fun refresh(track: Track): Track {
val remoteStatusTrack = api.statusLibManga(track)
track.copyPersonalFrom(remoteStatusTrack!!)
api.findLibManga(track)?.let { remoteTrack ->
api.findLibManga(track).let { remoteTrack ->
track.total_chapters = remoteTrack.total_chapters
}
return track
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ class ExtensionInstallActivity : Activity() {
override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)

val installIntent = Intent(Intent.ACTION_INSTALL_PACKAGE)
@Suppress("DEPRECATION") val installIntent = Intent(Intent.ACTION_INSTALL_PACKAGE)
.setDataAndType(intent.data, intent.type)
.putExtra(Intent.EXTRA_RETURN_RESULT, true)
.setFlags(Intent.FLAG_GRANT_READ_URI_PERMISSION)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,7 @@ import eu.kanade.tachiyomi.util.system.dpToPx
import eu.kanade.tachiyomi.util.system.isNavigationBarNeedsScrim
import eu.kanade.tachiyomi.util.system.openInBrowser
import eu.kanade.tachiyomi.util.view.setComposeContent
import kotlinx.coroutines.DelicateCoroutinesApi
import kotlinx.coroutines.channels.awaitClose
import kotlinx.coroutines.flow.callbackFlow
import kotlinx.coroutines.flow.collectLatest
Expand All @@ -99,6 +100,7 @@ import tachiyomi.presentation.core.util.collectAsState
import uy.kohesive.injekt.injectLazy
import androidx.compose.ui.graphics.Color.Companion as ComposeColor

@DelicateCoroutinesApi
class MainActivity : BaseActivity() {

private val libraryPreferences: LibraryPreferences by injectLazy()
Expand Down Expand Up @@ -142,7 +144,7 @@ class MainActivity : BaseActivity() {
val indexing by downloadCache.isInitializing.collectAsState()

// Set status bar color considering the top app state banner
val systemUiController = rememberSystemUiController()
@Suppress("DEPRECATION") val systemUiController = rememberSystemUiController()
val isSystemInDarkTheme = isSystemInDarkTheme()
val statusBarBackgroundColor = when {
indexing -> IndexingBannerBackgroundColor
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ import eu.kanade.tachiyomi.ui.reader.model.ReaderChapter
import eu.kanade.tachiyomi.ui.reader.model.ReaderPage
import kotlinx.coroutines.CancellationException
import kotlinx.coroutines.CoroutineScope
import kotlinx.coroutines.DelicateCoroutinesApi
import kotlinx.coroutines.Dispatchers
import kotlinx.coroutines.SupervisorJob
import kotlinx.coroutines.cancel
Expand All @@ -26,6 +27,7 @@ import kotlin.math.min
/**
* Loader used to load chapters from an online source.
*/
@DelicateCoroutinesApi
internal class HttpPageLoader(
private val chapter: ReaderChapter,
private val source: HttpSource,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ class WebtoonLayoutManager(context: Context) : LinearLayoutManager(context) {
/**
* Returns the custom extra layout space.
*/
@Deprecated("Deprecated in Java")
override fun getExtraLayoutSpace(state: RecyclerView.State): Int {
return extraLayoutSpace
}
Expand Down

0 comments on commit 2710a7c

Please sign in to comment.