Merge remote-tracking branch 'upstream/master'

This commit is contained in:
jmir1 2021-10-17 21:53:10 +02:00
commit a730056500
4 changed files with 10 additions and 6 deletions

View file

@ -104,6 +104,7 @@ internal class AnimeDownloadNotifier(private val context: Context) {
if (preferences.hideNotificationContent()) {
setContentTitle(downloadingProgressText)
setContentText(null)
} else {
val title = download.anime.title.chop(15)
val quotedTitle = Pattern.quote(title)

View file

@ -105,6 +105,7 @@ internal class DownloadNotifier(private val context: Context) {
if (preferences.hideNotificationContent()) {
setContentTitle(downloadingProgressText)
setContentText(null)
} else {
val title = download.manga.title.chop(15)
val quotedTitle = Pattern.quote(title)

View file

@ -2,6 +2,7 @@ package eu.kanade.tachiyomi.util.chapter
import eu.kanade.tachiyomi.data.database.models.Chapter
import eu.kanade.tachiyomi.data.database.models.Manga
import eu.kanade.tachiyomi.util.lang.compareToCaseInsensitiveNaturalOrder
fun getChapterSort(manga: Manga, sortDescending: Boolean = manga.sortDescending()): (Chapter, Chapter) -> Int {
return when (manga.sorting) {
@ -10,8 +11,8 @@ fun getChapterSort(manga: Manga, sortDescending: Boolean = manga.sortDescending(
false -> { c1, c2 -> c2.source_order.compareTo(c1.source_order) }
}
Manga.CHAPTER_SORTING_NUMBER -> when (sortDescending) {
true -> { c1, c2 -> c2.chapter_number.compareTo(c1.chapter_number) }
false -> { c1, c2 -> c1.chapter_number.compareTo(c2.chapter_number) }
true -> { c1, c2 -> c2.chapter_number.toString().compareToCaseInsensitiveNaturalOrder(c1.chapter_number.toString()) }
false -> { c1, c2 -> c1.chapter_number.toString().compareToCaseInsensitiveNaturalOrder(c2.chapter_number.toString()) }
}
Manga.CHAPTER_SORTING_UPLOAD_DATE -> when (sortDescending) {
true -> { c1, c2 -> c2.date_upload.compareTo(c1.date_upload) }

View file

@ -2,16 +2,17 @@ package eu.kanade.tachiyomi.util.episode
import eu.kanade.tachiyomi.data.database.models.Anime
import eu.kanade.tachiyomi.data.database.models.Episode
import eu.kanade.tachiyomi.util.lang.compareToCaseInsensitiveNaturalOrder
fun getEpisodeSort(anime: Anime, sortDescending: Boolean = anime.sortDescending()): (Episode, Episode) -> Int {
return when (anime.sorting) {
Anime.EPISODE_SORTING_SOURCE -> when (sortDescending) {
true -> { c1, c2 -> c1.source_order.compareTo(c2.source_order) }
false -> { c1, c2 -> c2.source_order.compareTo(c1.source_order) }
true -> { e1, e2 -> e1.source_order.compareTo(e2.source_order) }
false -> { e1, e2 -> e2.source_order.compareTo(e1.source_order) }
}
Anime.EPISODE_SORTING_NUMBER -> when (sortDescending) {
true -> { e1, e2 -> e2.episode_number.compareTo(e1.episode_number) }
false -> { e1, e2 -> e1.episode_number.compareTo(e2.episode_number) }
true -> { e1, e2 -> e2.episode_number.toString().compareToCaseInsensitiveNaturalOrder(e1.episode_number.toString()) }
false -> { e1, e2 -> e1.episode_number.toString().compareToCaseInsensitiveNaturalOrder(e2.episode_number.toString()) }
}
Anime.EPISODE_SORTING_UPLOAD_DATE -> when (sortDescending) {
true -> { e1, e2 -> e2.date_upload.compareTo(e1.date_upload) }