mirror of
https://github.com/Suwayomi/Suwayomi-Server.git
synced 2026-07-21 19:53:33 -05:00
Update dependency com.pinterest.ktlint:ktlint-cli to v1.8.0 (#1786)
* Update dependency com.pinterest.ktlint:ktlint-cli to v1.8.0 * Format --------- Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> Co-authored-by: Syer10 <syer10@users.noreply.github.com>
This commit is contained in:
@@ -319,6 +319,7 @@ object OpdsEntryBuilder {
|
||||
}
|
||||
titlePrefix = statusKey.localized(locale)
|
||||
}
|
||||
|
||||
is ProgressSource.Remote -> {
|
||||
idSuffix = ":remote"
|
||||
titlePrefix = MR.strings.opds_chapter_status_synced.localized(locale, progressSource.device)
|
||||
@@ -378,6 +379,7 @@ object OpdsEntryBuilder {
|
||||
}
|
||||
titleRes.localized(locale)
|
||||
}
|
||||
|
||||
progressSource is ProgressSource.Local -> {
|
||||
val titleRes =
|
||||
if (progressSource.lastPageRead > 0) {
|
||||
@@ -387,6 +389,7 @@ object OpdsEntryBuilder {
|
||||
}
|
||||
titleRes.localized(locale)
|
||||
}
|
||||
|
||||
progressSource is ProgressSource.Remote -> {
|
||||
val titleRes =
|
||||
if (progressSource.lastPageRead > 0) {
|
||||
@@ -396,7 +399,11 @@ object OpdsEntryBuilder {
|
||||
}
|
||||
titleRes.localized(locale, progressSource.device)
|
||||
}
|
||||
else -> "" // Should not happen
|
||||
|
||||
else -> {
|
||||
// Should not happen
|
||||
""
|
||||
}
|
||||
}
|
||||
|
||||
links.add(
|
||||
|
||||
@@ -155,30 +155,40 @@ object OpdsFeedBuilder {
|
||||
|
||||
val feedTitle =
|
||||
when (criteria.primaryFilter) {
|
||||
PrimaryFilterType.SOURCE ->
|
||||
PrimaryFilterType.SOURCE -> {
|
||||
MR.strings.opds_feeds_library_source_specific_title.localized(
|
||||
locale,
|
||||
result.feedTitleComponent ?: criteria.sourceId.toString(),
|
||||
)
|
||||
PrimaryFilterType.CATEGORY ->
|
||||
}
|
||||
|
||||
PrimaryFilterType.CATEGORY -> {
|
||||
MR.strings.opds_feeds_category_specific_title.localized(
|
||||
locale,
|
||||
result.feedTitleComponent ?: criteria.categoryId.toString(),
|
||||
)
|
||||
PrimaryFilterType.GENRE ->
|
||||
}
|
||||
|
||||
PrimaryFilterType.GENRE -> {
|
||||
MR.strings.opds_feeds_genre_specific_title.localized(
|
||||
locale,
|
||||
result.feedTitleComponent ?: "Unknown",
|
||||
)
|
||||
}
|
||||
|
||||
PrimaryFilterType.STATUS -> {
|
||||
val statusName = NavigationRepository.getStatuses(locale).find { it.id == criteria.statusId }?.title
|
||||
MR.strings.opds_feeds_status_specific_title.localized(locale, statusName ?: criteria.statusId.toString())
|
||||
}
|
||||
|
||||
PrimaryFilterType.LANGUAGE -> {
|
||||
val langName = Locale.forLanguageTag(criteria.langCode ?: "").getDisplayName(locale)
|
||||
MR.strings.opds_feeds_language_specific_title.localized(locale, langName)
|
||||
}
|
||||
else -> MR.strings.opds_feeds_all_series_in_library_title.localized(locale)
|
||||
|
||||
else -> {
|
||||
MR.strings.opds_feeds_all_series_in_library_title.localized(locale)
|
||||
}
|
||||
}
|
||||
|
||||
val feedUrl =
|
||||
|
||||
@@ -108,7 +108,7 @@ object MangaRepository {
|
||||
// Efficiently get the name of the primary filter item
|
||||
val specificFilterName =
|
||||
when (criteria.primaryFilter) {
|
||||
PrimaryFilterType.SOURCE ->
|
||||
PrimaryFilterType.SOURCE -> {
|
||||
criteria.sourceId?.let {
|
||||
SourceTable
|
||||
.select(SourceTable.name)
|
||||
@@ -116,7 +116,9 @@ object MangaRepository {
|
||||
.firstOrNull()
|
||||
?.get(SourceTable.name)
|
||||
}
|
||||
PrimaryFilterType.CATEGORY ->
|
||||
}
|
||||
|
||||
PrimaryFilterType.CATEGORY -> {
|
||||
criteria.categoryId?.let {
|
||||
CategoryTable
|
||||
.select(CategoryTable.name)
|
||||
@@ -124,10 +126,25 @@ object MangaRepository {
|
||||
.firstOrNull()
|
||||
?.get(CategoryTable.name)
|
||||
}
|
||||
PrimaryFilterType.GENRE -> criteria.genre
|
||||
PrimaryFilterType.STATUS -> criteria.statusId.toString() // Controller will map this to a localized string
|
||||
PrimaryFilterType.LANGUAGE -> criteria.langCode // Controller will map this to a display name
|
||||
else -> null
|
||||
}
|
||||
|
||||
PrimaryFilterType.GENRE -> {
|
||||
criteria.genre
|
||||
}
|
||||
|
||||
// Controller will map this to a localized string
|
||||
PrimaryFilterType.STATUS -> {
|
||||
criteria.statusId.toString()
|
||||
}
|
||||
|
||||
// Controller will map this to a display name
|
||||
PrimaryFilterType.LANGUAGE -> {
|
||||
criteria.langCode
|
||||
}
|
||||
|
||||
else -> {
|
||||
null
|
||||
}
|
||||
}
|
||||
|
||||
applyMangaLibrarySortAndFilter(query, sort, filter)
|
||||
|
||||
@@ -44,10 +44,18 @@ object OpdsStringUtil {
|
||||
if (serverConfig.opdsUseBinaryFileSizes.value) {
|
||||
// Binary notation (base 1024)
|
||||
when {
|
||||
size >= 1_125_899_906_842_624 -> "%.2f TiB".format(size / 1_125_899_906_842_624.0) // 1024^4
|
||||
size >= 1_073_741_824 -> "%.2f GiB".format(size / 1_073_741_824.0) // 1024^3
|
||||
size >= 1_048_576 -> "%.2f MiB".format(size / 1_048_576.0) // 1024^2
|
||||
size >= 1024 -> "%.2f KiB".format(size / 1024.0) // 1024
|
||||
// 1024^4
|
||||
size >= 1_125_899_906_842_624 -> "%.2f TiB".format(size / 1_125_899_906_842_624.0)
|
||||
|
||||
// 1024^3
|
||||
size >= 1_073_741_824 -> "%.2f GiB".format(size / 1_073_741_824.0)
|
||||
|
||||
// 1024^2
|
||||
size >= 1_048_576 -> "%.2f MiB".format(size / 1_048_576.0)
|
||||
|
||||
// 1024
|
||||
size >= 1024 -> "%.2f KiB".format(size / 1024.0)
|
||||
|
||||
else -> "$size bytes"
|
||||
}
|
||||
} else {
|
||||
|
||||
Reference in New Issue
Block a user