Skip to content

Commit

Permalink
bump version
Browse files Browse the repository at this point in the history
  • Loading branch information
nonproto committed Jul 23, 2024
1 parent 30afcca commit 56476fc
Show file tree
Hide file tree
Showing 218 changed files with 2,655 additions and 3,904 deletions.
4 changes: 2 additions & 2 deletions app/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,8 @@ android {
minSdk = AndroidConfig.minSdkVersion
targetSdk = AndroidConfig.targetSdkVersion
applicationId = "org.nekomanga.neko"
versionCode = 10
versionName = "2.16.9"
versionCode = 11
versionName = "2.16.10"
testInstrumentationRunner = "androidx.test.runner.AndroidJUnitRunner"
multiDexEnabled = true
setProperty("archivesBaseName", "Neko")
Expand Down
3 changes: 1 addition & 2 deletions app/src/main/java/eu/kanade/tachiyomi/AppModule.kt
Original file line number Diff line number Diff line change
Expand Up @@ -177,8 +177,7 @@ class PreferenceModule(val application: Application) : InjektModule {
StoragePreferences(
context = application,
folderProvider = get<AndroidStorageFolderProvider>(),
preferenceStore = get()
)
preferenceStore = get())
}

addSingletonFactory { BackupPreferences(get()) }
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -80,10 +80,7 @@ class BackupCreatorJob(private val context: Context, workerParams: WorkerParamet
.build()

workManager.enqueueUniquePeriodicWork(
TAG_AUTO,
ExistingPeriodicWorkPolicy.UPDATE,
request
)
TAG_AUTO, ExistingPeriodicWorkPolicy.UPDATE, request)
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -111,9 +111,7 @@ class BackupNotifier(private val context: Context) {
R.drawable.ic_close_24dp,
context.getString(R.string.stop),
NotificationReceiver.cancelRestorePendingBroadcast(
context,
Notifications.ID_RESTORE_PROGRESS
),
context, Notifications.ID_RESTORE_PROGRESS),
)
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -127,10 +127,7 @@ class BackupRestorer(val context: Context, val notifier: BackupNotifier) {
restoreProgress += 1
totalAmount += 1
restoreHelper.showProgressNotification(
restoreProgress,
totalAmount,
context.getString(R.string.categories)
)
restoreProgress, totalAmount, context.getString(R.string.categories))
}

private fun restoreManga(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -54,8 +54,7 @@ class MergeMangaGetResolver : DefaultGetResolver<MergeMangaImpl>() {
url = cursor.getString(cursor.getColumnIndex(MergeMangaTable.COL_URL)),
mergeType =
MergeType.getById(
cursor.getInt(cursor.getColumnIndex(MergeMangaTable.COL_MERGE_TYPE))
),
cursor.getInt(cursor.getColumnIndex(MergeMangaTable.COL_MERGE_TYPE))),
)
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -145,8 +145,7 @@ interface HistoryQueries : DbProvider {
.rawQuery(
RawQuery.builder()
.query(
"SELECT SUM(${HistoryTable.COL_TIME_READ}) FROM ${HistoryTable.TABLE}"
)
"SELECT SUM(${HistoryTable.COL_TIME_READ}) FROM ${HistoryTable.TABLE}")
.observesTables(HistoryTable.TABLE)
.build(),
)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,7 @@ interface MangaCategoryQueries : DbProvider {
DeleteQuery.builder()
.table(MangaCategoryTable.TABLE)
.where(
"${MangaCategoryTable.COL_MANGA_ID} IN (${Queries.placeholders(mangaList.size)})"
)
"${MangaCategoryTable.COL_MANGA_ID} IN (${Queries.placeholders(mangaList.size)})")
.whereArgs(*mangaList.map { it.id }.toTypedArray())
.build(),
)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -103,8 +103,7 @@ interface MangaQueries : DbProvider {
db.put()
.`object`(manga)
.withPutResolver(
MangaFlagsPutResolver(MangaTable.COL_CHAPTER_FLAGS, Manga::chapter_flags)
)
MangaFlagsPutResolver(MangaTable.COL_CHAPTER_FLAGS, Manga::chapter_flags))
.prepare()

fun updateChapterFlags(manga: List<Manga>) =
Expand All @@ -129,8 +128,7 @@ interface MangaQueries : DbProvider {
db.put()
.objects(manga)
.withPutResolver(
MangaFlagsPutResolver(MangaTable.COL_VIEWER, Manga::viewer_flags, true)
)
MangaFlagsPutResolver(MangaTable.COL_VIEWER, Manga::viewer_flags, true))
.prepare()

fun updateScanlatorFilterFlag(manga: Manga) =
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,8 +40,7 @@ interface MergeMangaQueries : DbProvider {
DeleteQuery.builder()
.table(MergeMangaTable.TABLE)
.where(
"${MergeMangaTable.COL_MANGA_ID} = ? AND ${MergeMangaTable.COL_MERGE_TYPE} = ?"
)
"${MergeMangaTable.COL_MANGA_ID} = ? AND ${MergeMangaTable.COL_MERGE_TYPE} = ?")
.whereArgs(mangaId, mergeType.id)
.build(),
)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,7 @@ class ChapterSourceOrderPutResolver : PutResolver<Chapter>() {
UpdateQuery.builder()
.table(ChapterTable.TABLE)
.where(
"${ChapterTable.COL_MANGADEX_CHAPTER_ID} = ? AND ${ChapterTable.COL_MANGA_ID} = ?"
)
"${ChapterTable.COL_MANGADEX_CHAPTER_ID} = ? AND ${ChapterTable.COL_MANGA_ID} = ?")
.whereArgs(chapter.mangadex_chapter_id, chapter.manga_id)
.build()

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -82,18 +82,14 @@ class DownloadCache(
val fileNames = mangaFiles[manga.id]?.first ?: return false
val mangadexIds = mangaFiles[manga.id]?.second ?: return false

if (
!chapter.isMergedChapter() &&
chapter.mangadex_chapter_id.isNotEmpty() &&
chapter.mangadex_chapter_id in mangadexIds
) {
if (!chapter.isMergedChapter() &&
chapter.mangadex_chapter_id.isNotEmpty() &&
chapter.mangadex_chapter_id in mangadexIds) {
return true
}
if (
!chapter.isMergedChapter() &&
chapter.old_mangadex_id != null &&
chapter.old_mangadex_id in mangadexIds
) {
if (!chapter.isMergedChapter() &&
chapter.old_mangadex_id != null &&
chapter.old_mangadex_id in mangadexIds) {
return true
}

Expand Down Expand Up @@ -129,13 +125,11 @@ class DownloadCache(
files.forEach {
if (!MergeType.containsMergeSourceName(it)) {
val mangadexId = it.substringAfterLast("- ")
if (
mangadexId.isNotBlank() &&
mangadexId.isDigitsOnly() &&
!ids.contains(
mangadexId,
)
) {
if (mangadexId.isNotBlank() &&
mangadexId.isDigitsOnly() &&
!ids.contains(
mangadexId,
)) {
count++
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -86,8 +86,7 @@ class DownloadJob(val context: Context, workerParameters: WorkerParameters) :
!noWifi
} else {
downloadManager.downloaderStop(
applicationContext.getString(R.string.no_network_connection)
)
applicationContext.getString(R.string.no_network_connection))
false
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -244,9 +244,8 @@ class DownloadManager(val context: Context) {
launchIO {
chapterDirs.forEach { it.delete() }

if (
cache.getDownloadCount(manga, true) == 0
) { // Delete manga directory if empty
if (cache.getDownloadCount(manga, true) ==
0) { // Delete manga directory if empty
chapterDirs.firstOrNull()?.parentFile?.delete()
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -56,10 +56,7 @@ class DownloadProvider(

throw Exception(
context.getString(
R.string.invalid_download_location,
downloadsDir?.displayablePath ?: ""
)
)
R.string.invalid_download_location, downloadsDir?.displayablePath ?: ""))
}
}

Expand Down
30 changes: 10 additions & 20 deletions app/src/main/java/eu/kanade/tachiyomi/data/download/Downloader.kt
Original file line number Diff line number Diff line change
Expand Up @@ -136,6 +136,7 @@ class Downloader(

DownloadJob.stop(context)
}

/** Pauses the downloader */
fun pause() {
cancelDownloaderJob()
Expand Down Expand Up @@ -410,10 +411,7 @@ class Downloader(
page.imageUrl!!,
) ->
copyImageFromCache(
chapterCache.getImageFile(page.imageUrl!!),
tmpDir,
filename
)
chapterCache.getImageFile(page.imageUrl!!), tmpDir, filename)
else -> downloadImage(page, download.source, tmpDir, filename)
}

Expand Down Expand Up @@ -524,13 +522,11 @@ class Downloader(
val imageFile =
tmpDir.listFiles()?.find { it.name!!.startsWith(filename) }
?: throw Error(
context.getString(R.string.download_notifier_split_page_not_found, page.number)
)
context.getString(R.string.download_notifier_split_page_not_found, page.number))
val imageFilePath =
imageFile.filePath
?: throw Error(
context.getString(R.string.download_notifier_split_page_not_found, page.number)
)
context.getString(R.string.download_notifier_split_page_not_found, page.number))

// check if the original page was previously split before then skip.
if (imageFile.name!!.contains("__")) return true
Expand Down Expand Up @@ -623,10 +619,8 @@ class Downloader(
private fun removeFromQueue(download: Download) {
_queueState.update {
store.remove(download)
if (
download.status == Download.State.DOWNLOADING ||
download.status == Download.State.QUEUE
) {
if (download.status == Download.State.DOWNLOADING ||
download.status == Download.State.QUEUE) {
download.status = Download.State.NOT_DOWNLOADED
}
it - download
Expand All @@ -638,10 +632,8 @@ class Downloader(
val downloads = queue.filter { predicate(it) }
store.removeAll(downloads)
downloads.forEach { download ->
if (
download.status == Download.State.DOWNLOADING ||
download.status == Download.State.QUEUE
) {
if (download.status == Download.State.DOWNLOADING ||
download.status == Download.State.QUEUE) {
download.status = Download.State.NOT_DOWNLOADED
}
}
Expand All @@ -661,10 +653,8 @@ class Downloader(
private fun clearQueueState() {
_queueState.update {
it.forEach { download ->
if (
download.status == Download.State.DOWNLOADING ||
download.status == Download.State.QUEUE
) {
if (download.status == Download.State.DOWNLOADING ||
download.status == Download.State.QUEUE) {
download.status = Download.State.NOT_DOWNLOADED
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,8 +46,7 @@ class AlternativeMangaCoverFetcher(
ArtworkKeyer()
.key(
Artwork(url = url, inLibrary = false, originalArtwork = "", mangaId = mangaId),
options
)
options)
}

val fileScope = CoroutineScope(Job() + Dispatchers.IO)
Expand Down Expand Up @@ -151,8 +150,7 @@ class AlternativeMangaCoverFetcher(
sourceLazy.value.headers
.newBuilder()
.add("x-request-id", "Neko-" + UUID.randomUUID())
.build()
)
.build())
// Support attaching custom data to the network request.
.tag(Parameters::class.java, options.parameters)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,9 +25,7 @@ class CoverViewTarget(
view.setImageDrawable(
view.context.iconicsDrawableLarge(
MaterialDesignDx.Icon.gmf_broken_image,
color = android.R.attr.textColorSecondary
)
)
color = android.R.attr.textColorSecondary))
} else {
val request =
ImageRequest.Builder(view.context)
Expand Down
Loading

0 comments on commit 56476fc

Please sign in to comment.