Skip to content

Commit 062e1c6

Browse files
committed
ref: remove library update order as the app doesn't really use it now
1 parent 04dbc88 commit 062e1c6

File tree

6 files changed

+4
-110
lines changed

6 files changed

+4
-110
lines changed

app/build.gradle.kts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,8 +24,8 @@ android {
2424
minSdk = AndroidConfig.minSdkVersion
2525
targetSdk = AndroidConfig.targetSdkVersion
2626
applicationId = "org.nekomanga.neko"
27-
versionCode = 49
28-
versionName = "3.1.5"
27+
versionCode = 50
28+
versionName = "3.1.6"
2929
testInstrumentationRunner = "androidx.test.runner.AndroidJUnitRunner"
3030
multiDexEnabled = true
3131
setProperty("archivesBaseName", "Neko")

app/src/main/java/eu/kanade/tachiyomi/data/library/LibraryUpdateJob.kt

Lines changed: 2 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@ package eu.kanade.tachiyomi.data.library
33
import android.content.Context
44
import android.content.pm.ServiceInfo
55
import android.os.Build
6-
import androidx.core.text.isDigitsOnly
76
import androidx.work.Constraints
87
import androidx.work.CoroutineWorker
98
import androidx.work.Data
@@ -155,8 +154,6 @@ class LibraryUpdateJob(private val context: Context, workerParameters: WorkerPar
155154

156155
instance = WeakReference(this)
157156

158-
val selectedScheme = libraryPreferences.updatePrioritization().get()
159-
160157
val allLibraryManga = db.getLibraryMangaList().executeOnIO()
161158
val allTracks = db.getAllTracks().executeOnIO()
162159
val tracksByMangaId = allTracks.groupBy { it.manga_id }
@@ -183,16 +180,11 @@ class LibraryUpdateJob(private val context: Context, workerParameters: WorkerPar
183180
} else {
184181
allLibraryManga
185182
})
186-
.sortedWith(LibraryUpdateRanker.rankingScheme[selectedScheme])
187183

188184
val categoryId = inputData.getInt(KEY_CATEGORY, -1)
189185

190186
val mangaList =
191187
getAndFilterMangaToUpdate(mangaListToFilter, tracksByMangaId, categoryId)
192-
.sortedWith(
193-
LibraryUpdateRanker.rankingScheme[
194-
libraryPreferences.updatePrioritization().get()]
195-
)
196188

197189
return withIOContext {
198190
try {
@@ -801,10 +793,7 @@ class LibraryUpdateJob(private val context: Context, workerParameters: WorkerPar
801793
val tracksByMangaId = db.getAllTracks().executeOnIO().groupBy { it.manga_id }
802794
val mangaToAdd =
803795
getAndFilterMangaToUpdate(manga, tracksByMangaId = tracksByMangaId, categoryId = -1)
804-
.sortedWith(
805-
LibraryUpdateRanker.rankingScheme[
806-
libraryPreferences.updatePrioritization().get()]
807-
)
796+
808797

809798
addManga(mangaToAdd)
810799
}
@@ -820,10 +809,6 @@ class LibraryUpdateJob(private val context: Context, workerParameters: WorkerPar
820809
tracksByMangaId = tracksByMangaId,
821810
categoryId = categoryId,
822811
)
823-
.sortedWith(
824-
LibraryUpdateRanker.rankingScheme[
825-
libraryPreferences.updatePrioritization().get()]
826-
)
827812
addManga(mangaToAdd)
828813
}
829814
}
@@ -840,15 +825,7 @@ class LibraryUpdateJob(private val context: Context, workerParameters: WorkerPar
840825
distinctManga.map { manga ->
841826
async(Dispatchers.IO) {
842827
val shouldDownload = manga.shouldDownloadNewChapters(db, preferences)
843-
val hasDLs =
844-
if (MdUtil.getMangaUUID(manga.url).isDigitsOnly()) {
845-
TimberKt.w {
846-
"Manga : ${manga.title} is not migrated to v5 skipping"
847-
}
848-
false
849-
} else {
850-
updateMangaChapters(manga, shouldDownload)
851-
}
828+
val hasDLs = updateMangaChapters(manga, shouldDownload)
852829

853830
if (hasDLs && !hasDownloads) {
854831
hasDownloads = true

app/src/main/java/eu/kanade/tachiyomi/data/library/LibraryUpdateRanker.kt

Lines changed: 0 additions & 64 deletions
This file was deleted.

app/src/main/java/org/nekomanga/domain/library/LibraryPreferences.kt

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -58,8 +58,6 @@ class LibraryPreferences(private val preferenceStore: PreferenceStore) {
5858
fun whichCategoriesToExclude() =
5959
this.preferenceStore.getStringSet("library_update_categories_exclude")
6060

61-
fun updatePrioritization() = this.preferenceStore.getInt("library_update_prioritization")
62-
6361
fun layout() =
6462
this.preferenceStore.getObjectFromInt(
6563
key = "pref_display_library_layout",
@@ -114,8 +112,6 @@ class LibraryPreferences(private val preferenceStore: PreferenceStore) {
114112
deserializer = LibraryGroup::fromInt,
115113
)
116114

117-
fun showCategoryInTitle() = this.preferenceStore.getBoolean("category_in_title")
118-
119115
fun updateFaster() = this.preferenceStore.getBoolean("faster_library_updates")
120116

121117
fun updateCovers() = this.preferenceStore.getBoolean("refresh_covers_too", true)

app/src/main/java/org/nekomanga/presentation/screens/settings/screens/LibrarySettingsScreen.kt

Lines changed: 0 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -245,16 +245,6 @@ internal class LibrarySettingsScreen(
245245
pref = libraryPreferences.updateFaster(),
246246
title = stringResource(R.string.faster_library_update),
247247
),
248-
Preference.PreferenceItem.ListPreference(
249-
pref = libraryPreferences.updatePrioritization(),
250-
title = stringResource(R.string.library_update_order),
251-
entries =
252-
persistentMapOf(
253-
0 to stringResource(R.string.alphabetically),
254-
1 to stringResource(R.string.last_updated),
255-
2 to stringResource(R.string.next_updated),
256-
),
257-
),
258248
Preference.PreferenceItem.TextPreference(
259249
title = stringResource(R.string.categories),
260250
subtitle =
@@ -320,10 +310,6 @@ internal class LibrarySettingsScreen(
320310
title = stringResource(R.string.faster_library_update),
321311
group = stringResource(R.string.global_updates),
322312
),
323-
SearchTerm(
324-
title = stringResource(R.string.library_update_order),
325-
group = stringResource(R.string.global_updates),
326-
),
327313
SearchTerm(
328314
title = stringResource(R.string.categories),
329315
group = stringResource(R.string.global_updates),

constants/src/main/res/values/strings.xml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -307,7 +307,6 @@
307307

308308
<!-- Library settings -->
309309
<string name="library_update_frequency">Library update frequency</string>
310-
<string name="library_update_order">Library update order</string>
311310
<string name="library_update_device_restriction">Library device auto update restrictions</string>
312311
<string name="library_update__device_restriction_summary">Update only when the conditions are met</string>
313312
<string name="restrictions_">Restrictions: %1$s</string>

0 commit comments

Comments
 (0)