Skip to content

Commit

Permalink
chore(merge): merge upstream till v0.14.6
Browse files Browse the repository at this point in the history
  • Loading branch information
LuftVerbot committed Jul 23, 2023
1 parent 6e31739 commit 88cff99
Show file tree
Hide file tree
Showing 269 changed files with 3,208 additions and 2,823 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/build_pull_request.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,10 +28,10 @@ jobs:
- name: Dependency Review
uses: actions/dependency-review-action@v3

- name: Set up JDK 11
- name: Set up JDK
uses: actions/setup-java@v3
with:
java-version: 11
java-version: 17
distribution: adopt

- name: Build app and run unit tests
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/build_push.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,10 +23,10 @@ jobs:
- name: Validate Gradle Wrapper
uses: gradle/wrapper-validation-action@v1

- name: Set up JDK 11
- name: Set up JDK
uses: actions/setup-java@v3
with:
java-version: 11
java-version: 17
distribution: adopt

- name: Build app and run unit tests
Expand Down
5 changes: 4 additions & 1 deletion .github/workflows/issue_moderator.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,11 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Moderate issues
uses: tachiyomiorg/issue-moderator-action@v1
uses: tachiyomiorg/issue-moderator-action@v2
with:
repo-token: ${{ secrets.GITHUB_TOKEN }}
duplicate-label: Duplicate

auto-close-rules: |
[
{
Expand All @@ -27,3 +29,4 @@ jobs:
"message": "Requested information in the template was not filled out."
}
]
auto-close-ignore-label: do-not-autoclose
8 changes: 4 additions & 4 deletions app/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,8 @@ android {

defaultConfig {
applicationId = "xyz.jmir.tachiyomi.mi"
versionCode = 99
versionName = "0.14.5"
versionCode = 102
versionName = "0.14.6"

buildConfigField("String", "COMMIT_COUNT", "\"${getCommitCount()}\"")
buildConfigField("String", "COMMIT_SHA", "\"${getGitSha()}\"")
Expand Down Expand Up @@ -102,7 +102,7 @@ android {
}
}

packagingOptions {
packaging {
resources.excludes.addAll(listOf(
"META-INF/DEPENDENCIES",
"LICENSE.txt",
Expand Down Expand Up @@ -258,7 +258,7 @@ dependencies {
implementation(libs.bundles.shizuku)

// Tests
testImplementation(libs.junit)
testImplementation(libs.bundles.test)

// For detecting memory leaks; see https://square.github.io/leakcanary/
// debugImplementation(libs.leakcanary.android)
Expand Down
1 change: 1 addition & 0 deletions app/proguard-android-optimize.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
-dontusemixedcaseclassnames
-ignorewarnings
-verbose

-keepattributes *Annotation*
Expand Down
3 changes: 3 additions & 0 deletions app/proguard-rules.pro
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
-dontobfuscate

-keep,allowoptimization class eu.kanade.**
-keep,allowoptimization class tachiyomi.**

# Keep common dependencies used in extensions
-keep,allowoptimization class androidx.preference.** { public protected *; }
-keep,allowoptimization class android.content.** { *; }
Expand Down
6 changes: 3 additions & 3 deletions app/src/debug/res/mipmap-anydpi-v26/ic_launcher.xml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<adaptive-icon xmlns:android="http://schemas.android.com/apk/res/android">
<background android:drawable="@android:color/transparent"/>
<foreground android:drawable="@drawable/ic_launcher_foreground"/>
<monochrome android:drawable="@drawable/ic_ani_monochrome_launcher" />
<background android:drawable="@android:color/transparent"/>
<foreground android:drawable="@drawable/ic_launcher_foreground"/>
<monochrome android:drawable="@drawable/ic_ani_monochrome_launcher" />
</adaptive-icon>
6 changes: 3 additions & 3 deletions app/src/debug/res/mipmap-anydpi-v26/ic_launcher_round.xml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<adaptive-icon xmlns:android="http://schemas.android.com/apk/res/android">
<background android:drawable="@android:color/transparent"/>
<foreground android:drawable="@drawable/ic_launcher_foreground"/>
<monochrome android:drawable="@drawable/ic_ani_monochrome_launcher" />
<background android:drawable="@android:color/transparent"/>
<foreground android:drawable="@drawable/ic_launcher_foreground"/>
<monochrome android:drawable="@drawable/ic_ani_monochrome_launcher" />
</adaptive-icon>
4 changes: 0 additions & 4 deletions app/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -281,10 +281,6 @@
android:name=".data.updater.AppUpdateService"
android:exported="false" />

<service
android:name=".data.backup.BackupRestoreService"
android:exported="false" />

<service android:name=".extension.manga.util.MangaExtensionInstallService"
android:exported="false" />

Expand Down
6 changes: 3 additions & 3 deletions app/src/main/java/eu/kanade/core/util/CollectionUtils.kt
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,10 @@ fun <T : R, R : Any> List<T>.insertSeparators(
val newList = mutableListOf<R>()
for (i in -1..lastIndex) {
val before = getOrNull(i)
before?.let { newList.add(it) }
before?.let(newList::add)
val after = getOrNull(i + 1)
val separator = generator.invoke(before, after)
separator?.let { newList.add(it) }
separator?.let(newList::add)
}
return newList
}
Expand Down Expand Up @@ -80,7 +80,7 @@ inline fun <T, R> List<T>.fastMapNotNull(transform: (T) -> R?): List<R> {
contract { callsInPlace(transform) }
val destination = ArrayList<R>()
fastForEach { element ->
transform(element)?.let { destination.add(it) }
transform(element)?.let(destination::add)
}
return destination
}
Expand Down
7 changes: 7 additions & 0 deletions app/src/main/java/eu/kanade/domain/base/BasePreferences.kt
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ package eu.kanade.domain.base
import android.content.Context
import android.content.pm.PackageManager
import android.os.Build
import eu.kanade.tachiyomi.R
import tachiyomi.core.preference.PreferenceStore

class BasePreferences(
Expand All @@ -22,4 +23,10 @@ class BasePreferences(
fun acraEnabled() = preferenceStore.getBoolean("acra.enable", false)

fun deviceHasPip() = Build.VERSION.SDK_INT >= Build.VERSION_CODES.O && context.packageManager.hasSystemFeature(PackageManager.FEATURE_PICTURE_IN_PICTURE)

enum class ExtensionInstaller(val titleResId: Int) {
LEGACY(R.string.ext_installer_legacy),
PACKAGEINSTALLER(R.string.ext_installer_packageinstaller),
SHIZUKU(R.string.ext_installer_shizuku),
}
}
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
package eu.kanade.domain.base

import android.content.Context
import eu.kanade.tachiyomi.data.preference.PreferenceValues.ExtensionInstaller
import eu.kanade.domain.base.BasePreferences.ExtensionInstaller
import eu.kanade.tachiyomi.util.system.hasMiuiPackageInstaller
import eu.kanade.tachiyomi.util.system.isShizukuInstalled
import kotlinx.coroutines.CoroutineScope
Expand Down
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
package eu.kanade.domain.entries.anime.interactor

import eu.kanade.domain.entries.anime.model.hasCustomCover
import eu.kanade.domain.entries.anime.model.isLocal
import eu.kanade.tachiyomi.animesource.model.SAnime
import eu.kanade.tachiyomi.data.cache.AnimeCoverCache
import tachiyomi.domain.entries.anime.model.Anime
import tachiyomi.domain.entries.anime.model.AnimeUpdate
import tachiyomi.domain.entries.anime.repository.AnimeRepository
import tachiyomi.source.local.entries.anime.isLocal
import uy.kohesive.injekt.Injekt
import uy.kohesive.injekt.api.get
import java.util.Date
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ import eu.kanade.tachiyomi.animesource.model.SAnime
import eu.kanade.tachiyomi.data.cache.AnimeCoverCache
import tachiyomi.domain.entries.TriStateFilter
import tachiyomi.domain.entries.anime.model.Anime
import tachiyomi.source.local.entries.anime.LocalAnimeSource
import uy.kohesive.injekt.Injekt
import uy.kohesive.injekt.api.get

Expand Down Expand Up @@ -77,8 +76,6 @@ fun SAnime.toDomainAnime(sourceId: Long): Anime {
)
}

fun Anime.isLocal(): Boolean = source == LocalAnimeSource.ID

fun Anime.hasCustomCover(coverCache: AnimeCoverCache = Injekt.get()): Boolean {
return coverCache.getCustomCoverFile(id).exists()
}
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
package eu.kanade.domain.entries.manga.interactor

import eu.kanade.domain.entries.manga.model.hasCustomCover
import eu.kanade.domain.entries.manga.model.isLocal
import eu.kanade.tachiyomi.data.cache.MangaCoverCache
import eu.kanade.tachiyomi.source.model.SManga
import tachiyomi.domain.entries.manga.model.Manga
import tachiyomi.domain.entries.manga.model.MangaUpdate
import tachiyomi.domain.entries.manga.repository.MangaRepository
import tachiyomi.source.local.entries.manga.isLocal
import uy.kohesive.injekt.Injekt
import uy.kohesive.injekt.api.get
import java.util.Date
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@ import tachiyomi.core.metadata.comicinfo.ComicInfoPublishingStatus
import tachiyomi.domain.entries.TriStateFilter
import tachiyomi.domain.entries.manga.model.Manga
import tachiyomi.domain.items.chapter.model.Chapter
import tachiyomi.source.local.entries.manga.LocalMangaSource
import uy.kohesive.injekt.Injekt
import uy.kohesive.injekt.api.get

Expand Down Expand Up @@ -89,8 +88,6 @@ fun SManga.toDomainManga(sourceId: Long): Manga {
)
}

fun Manga.isLocal(): Boolean = source == LocalMangaSource.ID

fun Manga.hasCustomCover(coverCache: MangaCoverCache = Injekt.get()): Boolean {
return coverCache.getCustomCoverFile(id).exists()
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ import eu.kanade.domain.items.chapter.model.toSChapter
import eu.kanade.tachiyomi.data.download.manga.MangaDownloadManager
import eu.kanade.tachiyomi.data.download.manga.MangaDownloadProvider
import eu.kanade.tachiyomi.source.MangaSource
import eu.kanade.tachiyomi.source.manga.isLocal
import eu.kanade.tachiyomi.source.model.SChapter
import eu.kanade.tachiyomi.source.online.HttpSource
import tachiyomi.data.items.chapter.ChapterSanitizer
Expand All @@ -20,6 +19,7 @@ import tachiyomi.domain.items.chapter.model.NoChaptersException
import tachiyomi.domain.items.chapter.model.toChapterUpdate
import tachiyomi.domain.items.chapter.repository.ChapterRepository
import tachiyomi.domain.items.chapter.service.ChapterRecognition
import tachiyomi.source.local.entries.manga.isLocal
import uy.kohesive.injekt.Injekt
import uy.kohesive.injekt.api.get
import java.lang.Long.max
Expand Down
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
package eu.kanade.domain.items.chapter.model

import eu.kanade.domain.entries.manga.model.downloadedFilter
import eu.kanade.domain.entries.manga.model.isLocal
import eu.kanade.tachiyomi.data.download.manga.MangaDownloadManager
import eu.kanade.tachiyomi.ui.entries.manga.ChapterItem
import tachiyomi.domain.entries.applyFilter
import tachiyomi.domain.entries.manga.model.Manga
import tachiyomi.domain.items.chapter.model.Chapter
import tachiyomi.domain.items.chapter.service.getChapterSort
import tachiyomi.source.local.entries.manga.isLocal

/**
* Applies the view filters to the list of chapters obtained from the database.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@ import eu.kanade.tachiyomi.animesource.model.SEpisode
import eu.kanade.tachiyomi.animesource.online.AnimeHttpSource
import eu.kanade.tachiyomi.data.download.anime.AnimeDownloadManager
import eu.kanade.tachiyomi.data.download.anime.AnimeDownloadProvider
import eu.kanade.tachiyomi.source.anime.isLocal
import tachiyomi.data.items.episode.EpisodeSanitizer
import tachiyomi.domain.entries.anime.model.Anime
import tachiyomi.domain.items.episode.interactor.GetEpisodeByAnimeId
Expand All @@ -20,6 +19,7 @@ import tachiyomi.domain.items.episode.model.NoEpisodesException
import tachiyomi.domain.items.episode.model.toEpisodeUpdate
import tachiyomi.domain.items.episode.repository.EpisodeRepository
import tachiyomi.domain.items.episode.service.EpisodeRecognition
import tachiyomi.source.local.entries.anime.isLocal
import uy.kohesive.injekt.Injekt
import uy.kohesive.injekt.api.get
import java.lang.Long.max
Expand Down
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
package eu.kanade.domain.items.episode.model

import eu.kanade.domain.entries.anime.model.downloadedFilter
import eu.kanade.domain.entries.anime.model.isLocal
import eu.kanade.tachiyomi.data.download.anime.AnimeDownloadManager
import eu.kanade.tachiyomi.ui.entries.anime.EpisodeItem
import tachiyomi.domain.entries.anime.model.Anime
import tachiyomi.domain.entries.applyFilter
import tachiyomi.domain.items.episode.model.Episode
import tachiyomi.domain.items.episode.service.getEpisodeSort
import tachiyomi.source.local.entries.anime.isLocal

/**
* Applies the view filters to the list of episodes obtained from the database.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,11 @@ import androidx.work.CoroutineWorker
import androidx.work.ExistingWorkPolicy
import androidx.work.NetworkType
import androidx.work.OneTimeWorkRequestBuilder
import androidx.work.WorkManager
import androidx.work.WorkerParameters
import eu.kanade.domain.track.anime.model.toDbTrack
import eu.kanade.domain.track.anime.store.DelayedAnimeTrackingStore
import eu.kanade.tachiyomi.data.track.TrackManager
import eu.kanade.tachiyomi.util.system.workManager
import logcat.LogPriority
import tachiyomi.core.util.lang.withIOContext
import tachiyomi.core.util.system.logcat
Expand Down Expand Up @@ -74,8 +74,7 @@ class DelayedAnimeTrackingUpdateJob(context: Context, workerParams: WorkerParame
.addTag(TAG)
.build()

WorkManager.getInstance(context)
.enqueueUniqueWork(TAG, ExistingWorkPolicy.REPLACE, request)
context.workManager.enqueueUniqueWork(TAG, ExistingWorkPolicy.REPLACE, request)
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,11 @@ import androidx.work.CoroutineWorker
import androidx.work.ExistingWorkPolicy
import androidx.work.NetworkType
import androidx.work.OneTimeWorkRequestBuilder
import androidx.work.WorkManager
import androidx.work.WorkerParameters
import eu.kanade.domain.track.manga.model.toDbTrack
import eu.kanade.domain.track.manga.store.DelayedMangaTrackingStore
import eu.kanade.tachiyomi.data.track.TrackManager
import eu.kanade.tachiyomi.util.system.workManager
import logcat.LogPriority
import tachiyomi.core.util.lang.withIOContext
import tachiyomi.core.util.system.logcat
Expand Down Expand Up @@ -74,8 +74,7 @@ class DelayedMangaTrackingUpdateJob(context: Context, workerParams: WorkerParame
.addTag(TAG)
.build()

WorkManager.getInstance(context)
.enqueueUniqueWork(TAG, ExistingWorkPolicy.REPLACE, request)
context.workManager.enqueueUniqueWork(TAG, ExistingWorkPolicy.REPLACE, request)
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ import eu.kanade.tachiyomi.util.system.LocaleHelper
import tachiyomi.domain.source.anime.model.AnimeSource
import tachiyomi.domain.source.anime.model.Pin
import tachiyomi.presentation.core.components.ScrollbarLazyColumn
import tachiyomi.presentation.core.components.material.SecondaryItemAlpha
import tachiyomi.presentation.core.components.material.padding
import tachiyomi.presentation.core.components.material.topSmallPaddingValues
import tachiyomi.presentation.core.screens.EmptyScreen
Expand Down Expand Up @@ -143,7 +144,7 @@ private fun AnimeSourcePinButton(
onClick: () -> Unit,
) {
val icon = if (isPinned) Icons.Filled.PushPin else Icons.Outlined.PushPin
val tint = if (isPinned) MaterialTheme.colorScheme.primary else MaterialTheme.colorScheme.onBackground
val tint = if (isPinned) MaterialTheme.colorScheme.primary else MaterialTheme.colorScheme.onBackground.copy(alpha = SecondaryItemAlpha)
val description = if (isPinned) R.string.action_unpin else R.string.action_pin
IconButton(onClick = onClick) {
Icon(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,7 @@ fun BrowseAnimeSourceContent(

if (animeList.itemCount <= 0 && errorState != null && errorState is LoadState.Error) {
EmptyScreen(
modifier = Modifier.padding(contentPadding),
message = getErrorMessage(errorState),
actions = if (source is LocalAnimeSource) {
listOf(
Expand Down Expand Up @@ -112,7 +113,9 @@ fun BrowseAnimeSourceContent(
}

if (animeList.itemCount == 0 && animeList.loadState.refresh is LoadState.Loading) {
LoadingScreen()
LoadingScreen(
modifier = Modifier.padding(contentPadding),
)
return
}

Expand Down
Loading

0 comments on commit 88cff99

Please sign in to comment.