mirror of
https://github.com/mihonapp/mihon.git
synced 2024-09-20 04:32:39 +02:00
Compare commits
5 Commits
c5dee0b084
...
2fe942ff15
Author | SHA1 | Date | |
---|---|---|---|
|
2fe942ff15 | ||
|
1e570bc965 | ||
|
9cc7d42dd9 | ||
|
f5c6d2e1a6 | ||
|
3d8f6dd310 |
@ -84,6 +84,7 @@ fun MangaScreen(
|
||||
state: MangaScreenModel.State.Success,
|
||||
snackbarHostState: SnackbarHostState,
|
||||
nextUpdate: Instant?,
|
||||
isUpdateIntervalEnabled: Boolean,
|
||||
isTabletUi: Boolean,
|
||||
chapterSwipeStartAction: LibraryPreferences.ChapterSwipeAction,
|
||||
chapterSwipeEndAction: LibraryPreferences.ChapterSwipeAction,
|
||||
@ -139,6 +140,7 @@ fun MangaScreen(
|
||||
state = state,
|
||||
snackbarHostState = snackbarHostState,
|
||||
nextUpdate = nextUpdate,
|
||||
isUpdateIntervalEnabled = isUpdateIntervalEnabled,
|
||||
chapterSwipeStartAction = chapterSwipeStartAction,
|
||||
chapterSwipeEndAction = chapterSwipeEndAction,
|
||||
onBackClicked = onBackClicked,
|
||||
@ -176,6 +178,7 @@ fun MangaScreen(
|
||||
chapterSwipeStartAction = chapterSwipeStartAction,
|
||||
chapterSwipeEndAction = chapterSwipeEndAction,
|
||||
nextUpdate = nextUpdate,
|
||||
isUpdateIntervalEnabled = isUpdateIntervalEnabled,
|
||||
onBackClicked = onBackClicked,
|
||||
onChapterClicked = onChapterClicked,
|
||||
onDownloadChapter = onDownloadChapter,
|
||||
@ -212,6 +215,7 @@ private fun MangaScreenSmallImpl(
|
||||
state: MangaScreenModel.State.Success,
|
||||
snackbarHostState: SnackbarHostState,
|
||||
nextUpdate: Instant?,
|
||||
isUpdateIntervalEnabled: Boolean,
|
||||
chapterSwipeStartAction: LibraryPreferences.ChapterSwipeAction,
|
||||
chapterSwipeEndAction: LibraryPreferences.ChapterSwipeAction,
|
||||
onBackClicked: () -> Unit,
|
||||
@ -396,6 +400,7 @@ private fun MangaScreenSmallImpl(
|
||||
favorite = state.manga.favorite,
|
||||
trackingCount = state.trackingCount,
|
||||
nextUpdate = nextUpdate,
|
||||
isUpdateIntervalEnabled = isUpdateIntervalEnabled,
|
||||
isUserIntervalMode = state.manga.fetchInterval < 0,
|
||||
onAddToLibraryClicked = onAddToLibraryClicked,
|
||||
onWebViewClicked = onWebViewClicked,
|
||||
@ -456,6 +461,7 @@ fun MangaScreenLargeImpl(
|
||||
state: MangaScreenModel.State.Success,
|
||||
snackbarHostState: SnackbarHostState,
|
||||
nextUpdate: Instant?,
|
||||
isUpdateIntervalEnabled: Boolean,
|
||||
chapterSwipeStartAction: LibraryPreferences.ChapterSwipeAction,
|
||||
chapterSwipeEndAction: LibraryPreferences.ChapterSwipeAction,
|
||||
onBackClicked: () -> Unit,
|
||||
@ -628,6 +634,7 @@ fun MangaScreenLargeImpl(
|
||||
favorite = state.manga.favorite,
|
||||
trackingCount = state.trackingCount,
|
||||
nextUpdate = nextUpdate,
|
||||
isUpdateIntervalEnabled = isUpdateIntervalEnabled,
|
||||
isUserIntervalMode = state.manga.fetchInterval < 0,
|
||||
onAddToLibraryClicked = onAddToLibraryClicked,
|
||||
onWebViewClicked = onWebViewClicked,
|
||||
|
@ -157,11 +157,13 @@ fun MangaInfoBox(
|
||||
}
|
||||
}
|
||||
|
||||
@Suppress("CyclomaticComplexMethod")
|
||||
@Composable
|
||||
fun MangaActionRow(
|
||||
favorite: Boolean,
|
||||
trackingCount: Int,
|
||||
nextUpdate: Instant?,
|
||||
isUpdateIntervalEnabled: Boolean,
|
||||
isUserIntervalMode: Boolean,
|
||||
onAddToLibraryClicked: () -> Unit,
|
||||
onWebViewClicked: (() -> Unit)?,
|
||||
@ -195,20 +197,22 @@ fun MangaActionRow(
|
||||
onClick = onAddToLibraryClicked,
|
||||
onLongClick = onEditCategory,
|
||||
)
|
||||
MangaActionButton(
|
||||
title = when (nextUpdateDays) {
|
||||
null -> stringResource(MR.strings.not_applicable)
|
||||
0 -> stringResource(MR.strings.manga_interval_expected_update_soon)
|
||||
else -> pluralStringResource(
|
||||
MR.plurals.day,
|
||||
count = nextUpdateDays,
|
||||
nextUpdateDays,
|
||||
)
|
||||
},
|
||||
icon = Icons.Default.HourglassEmpty,
|
||||
color = if (isUserIntervalMode) MaterialTheme.colorScheme.primary else defaultActionButtonColor,
|
||||
onClick = { onEditIntervalClicked?.invoke() },
|
||||
)
|
||||
if (nextUpdateDays != null || isUpdateIntervalEnabled) {
|
||||
MangaActionButton(
|
||||
title = when (nextUpdateDays) {
|
||||
null -> stringResource(MR.strings.not_applicable)
|
||||
0 -> stringResource(MR.strings.manga_interval_expected_update_soon)
|
||||
else -> pluralStringResource(
|
||||
MR.plurals.day,
|
||||
count = nextUpdateDays,
|
||||
nextUpdateDays,
|
||||
)
|
||||
},
|
||||
icon = Icons.Default.HourglassEmpty,
|
||||
color = if (isUserIntervalMode) MaterialTheme.colorScheme.primary else defaultActionButtonColor,
|
||||
onClick = { onEditIntervalClicked?.invoke() },
|
||||
)
|
||||
}
|
||||
MangaActionButton(
|
||||
title = if (trackingCount == 0) {
|
||||
stringResource(MR.strings.manga_tracking_tab)
|
||||
|
@ -2,7 +2,6 @@ package eu.kanade.presentation.util
|
||||
|
||||
import android.content.Context
|
||||
import eu.kanade.tachiyomi.network.HttpException
|
||||
import eu.kanade.tachiyomi.source.online.LicensedMangaChaptersException
|
||||
import eu.kanade.tachiyomi.util.system.isOnline
|
||||
import tachiyomi.core.common.i18n.stringResource
|
||||
import tachiyomi.data.source.NoResultsException
|
||||
@ -25,7 +24,6 @@ val Throwable.formattedMessage: String
|
||||
|
||||
is NoResultsException -> return stringResource(MR.strings.no_results_found)
|
||||
is SourceNotInstalledException -> return stringResource(MR.strings.loader_not_implemented_error)
|
||||
is LicensedMangaChaptersException -> return stringResource(MR.strings.licensed_manga_chapters_error)
|
||||
}
|
||||
return when (val className = this::class.simpleName) {
|
||||
"Exception", "IOException" -> message ?: className
|
||||
|
@ -25,7 +25,7 @@ data class KitsuListSearchResult(
|
||||
title = manga.canonicalTitle
|
||||
total_chapters = manga.chapterCount ?: 0
|
||||
cover_url = manga.posterImage?.original ?: ""
|
||||
summary = manga.synopsis
|
||||
summary = manga.synopsis ?: ""
|
||||
tracking_url = KitsuApi.mangaUrl(remote_id)
|
||||
publishing_status = manga.status
|
||||
publishing_type = manga.mangaType ?: ""
|
||||
@ -73,7 +73,7 @@ data class KitsuListSearchItemIncludedAttributes(
|
||||
val chapterCount: Long?,
|
||||
val mangaType: String?,
|
||||
val posterImage: KitsuSearchItemCover?,
|
||||
val synopsis: String,
|
||||
val synopsis: String?,
|
||||
val startDate: String?,
|
||||
val status: String,
|
||||
)
|
||||
|
@ -118,6 +118,7 @@ class MangaScreen(
|
||||
state = successState,
|
||||
snackbarHostState = screenModel.snackbarHostState,
|
||||
nextUpdate = successState.manga.expectedNextUpdate,
|
||||
isUpdateIntervalEnabled = screenModel.isUpdateIntervalEnabled,
|
||||
isTabletUi = isTabletUi(),
|
||||
chapterSwipeStartAction = screenModel.chapterSwipeStartAction,
|
||||
chapterSwipeEndAction = screenModel.chapterSwipeEndAction,
|
||||
|
@ -32,7 +32,7 @@ jsoup = "org.jsoup:jsoup:1.18.1"
|
||||
|
||||
disklrucache = "com.jakewharton:disklrucache:2.0.2"
|
||||
unifile = "com.github.tachiyomiorg:unifile:e0def6b3dc"
|
||||
libarchive = "me.zhanghai.android.libarchive:library:1.1.0"
|
||||
libarchive = "me.zhanghai.android.libarchive:library:1.1.1"
|
||||
|
||||
sqlite-framework = { module = "androidx.sqlite:sqlite-framework", version.ref = "sqlite" }
|
||||
sqlite-ktx = { module = "androidx.sqlite:sqlite-ktx", version.ref = "sqlite" }
|
||||
|
@ -647,7 +647,6 @@
|
||||
<!-- missing prompt after Compose rewrite #7901 -->
|
||||
<string name="no_more_results">No more results</string>
|
||||
<string name="no_results_found">No results found</string>
|
||||
<string name="licensed_manga_chapters_error">Licensed - No chapters to show</string>
|
||||
<string name="local_source">Local source</string>
|
||||
<string name="other_source">Other</string>
|
||||
<string name="last_used_source">Last used</string>
|
||||
|
@ -251,28 +251,19 @@ abstract class HttpSource : CatalogueSource {
|
||||
*
|
||||
* @param manga the manga to update.
|
||||
* @return the chapters for the manga.
|
||||
* @throws LicensedMangaChaptersException if a manga is licensed and therefore no chapters are available.
|
||||
*/
|
||||
@Suppress("DEPRECATION")
|
||||
override suspend fun getChapterList(manga: SManga): List<SChapter> {
|
||||
if (manga.status == SManga.LICENSED) {
|
||||
throw LicensedMangaChaptersException()
|
||||
}
|
||||
|
||||
return fetchChapterList(manga).awaitSingle()
|
||||
}
|
||||
|
||||
@Deprecated("Use the non-RxJava API instead", replaceWith = ReplaceWith("getChapterList"))
|
||||
override fun fetchChapterList(manga: SManga): Observable<List<SChapter>> {
|
||||
return if (manga.status != SManga.LICENSED) {
|
||||
client.newCall(chapterListRequest(manga))
|
||||
.asObservableSuccess()
|
||||
.map { response ->
|
||||
chapterListParse(response)
|
||||
}
|
||||
} else {
|
||||
Observable.error(LicensedMangaChaptersException())
|
||||
}
|
||||
return client.newCall(chapterListRequest(manga))
|
||||
.asObservableSuccess()
|
||||
.map { response ->
|
||||
chapterListParse(response)
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
@ -472,5 +463,3 @@ abstract class HttpSource : CatalogueSource {
|
||||
*/
|
||||
override fun getFilterList() = FilterList()
|
||||
}
|
||||
|
||||
class LicensedMangaChaptersException : RuntimeException()
|
||||
|
Loading…
Reference in New Issue
Block a user