Implement Mihon's spotless PR (#1257)

* Remove detekt (mihonapp/mihon#1130)

Annoying. More annoying in this project.

(cherry picked from commit 777ae2461e1eb277a3aa0c998ff69e4f100387a1)

* Add spotless (with ktlint) (mihonapp/mihon#1136)

(cherry picked from commit 5ae8095ef1ed2ae9f98486f9148e933c77a28692)

* Address spotless lint errors (mihonapp/mihon#1138)

* Add spotless (with ktlint)

* Run spotlessApply

* screaming case screaming case screaming case

* Update PagerViewerAdapter.kt

* Update ReaderTransitionView.kt

(cherry picked from commit d6252ab7703d52ecf9f43de3ee36fd63e665a31f)

* Generate locales_config.xml in build dir

(cherry picked from commit ac41bffdc97b4cfed923de6b9e8e01cccf3eb6eb)

* Address more spotless lint errors in SY

* some more missed

* more missed

* still missing, not sure while it won't report error when running locally

* one more

* more

* more

* correct comment

---------

Co-authored-by: AntsyLich <59261191+AntsyLich@users.noreply.github.com>
This commit is contained in:
Tran M. Cuong
2024-08-23 08:24:50 +07:00
committed by GitHub
parent 759fd4d4e3
commit 3705880a77
363 changed files with 1223 additions and 3138 deletions
@@ -1,2 +1,2 @@
<?xml version="1.0" encoding="utf-8"?>
<manifest />
<manifest />
@@ -60,8 +60,11 @@ actual class LocalSource(
private val json: Json by injectLazy()
private val xml: XML by injectLazy()
private val POPULAR_FILTERS = FilterList(OrderBy.Popular(context))
private val LATEST_FILTERS = FilterList(OrderBy.Latest(context))
@Suppress("PrivatePropertyName", "ktlint:standard:property-naming")
private val PopularFilters = FilterList(OrderBy.Popular(context))
@Suppress("PrivatePropertyName", "ktlint:standard:property-naming")
private val LatestFilters = FilterList(OrderBy.Latest(context))
override val name: String = context.stringResource(MR.strings.local_source)
@@ -74,12 +77,12 @@ actual class LocalSource(
override val supportsLatest: Boolean = true
// Browse related
override suspend fun getPopularManga(page: Int) = getSearchManga(page, "", POPULAR_FILTERS)
override suspend fun getPopularManga(page: Int) = getSearchManga(page, "", PopularFilters)
override suspend fun getLatestUpdates(page: Int) = getSearchManga(page, "", LATEST_FILTERS)
override suspend fun getLatestUpdates(page: Int) = getSearchManga(page, "", LatestFilters)
override suspend fun getSearchManga(page: Int, query: String, filters: FilterList): MangasPage = withIOContext {
val lastModifiedLimit = if (filters === LATEST_FILTERS) {
val lastModifiedLimit = if (filters === LatestFilters) {
System.currentTimeMillis() - LATEST_THRESHOLD
} else {
0L
@@ -183,8 +186,8 @@ actual class LocalSource(
copyComicInfoFile(
xml.encodeToString(ComicInfo.serializer(), newComicInfo).byteInputStream(),
it,
comicInfoArchiveReader?.encrypted ?: false
)
comicInfoArchiveReader?.encrypted ?: false,
)
}
}
// SY <--
@@ -57,7 +57,7 @@ actual class LocalCoverManager(
inputStream.use { input ->
// SY -->
if (encrypted) {
ZipWriter(context, targetFile, encrypt = true ).use { writer ->
ZipWriter(context, targetFile, encrypt = true).use { writer ->
writer.write(inputStream.readBytes(), DEFAULT_COVER_NAME)
}
DiskUtil.createNoMediaFile(directory, context)