mirror of
https://github.com/aniyomiorg/aniyomi.git
synced 2024-11-29 17:49:03 +03:00
Merge remote-tracking branch 'upstream/master'
This commit is contained in:
commit
a730056500
4 changed files with 10 additions and 6 deletions
|
@ -104,6 +104,7 @@ internal class AnimeDownloadNotifier(private val context: Context) {
|
||||||
|
|
||||||
if (preferences.hideNotificationContent()) {
|
if (preferences.hideNotificationContent()) {
|
||||||
setContentTitle(downloadingProgressText)
|
setContentTitle(downloadingProgressText)
|
||||||
|
setContentText(null)
|
||||||
} else {
|
} else {
|
||||||
val title = download.anime.title.chop(15)
|
val title = download.anime.title.chop(15)
|
||||||
val quotedTitle = Pattern.quote(title)
|
val quotedTitle = Pattern.quote(title)
|
||||||
|
|
|
@ -105,6 +105,7 @@ internal class DownloadNotifier(private val context: Context) {
|
||||||
|
|
||||||
if (preferences.hideNotificationContent()) {
|
if (preferences.hideNotificationContent()) {
|
||||||
setContentTitle(downloadingProgressText)
|
setContentTitle(downloadingProgressText)
|
||||||
|
setContentText(null)
|
||||||
} else {
|
} else {
|
||||||
val title = download.manga.title.chop(15)
|
val title = download.manga.title.chop(15)
|
||||||
val quotedTitle = Pattern.quote(title)
|
val quotedTitle = Pattern.quote(title)
|
||||||
|
|
|
@ -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.Chapter
|
||||||
import eu.kanade.tachiyomi.data.database.models.Manga
|
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 {
|
fun getChapterSort(manga: Manga, sortDescending: Boolean = manga.sortDescending()): (Chapter, Chapter) -> Int {
|
||||||
return when (manga.sorting) {
|
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) }
|
false -> { c1, c2 -> c2.source_order.compareTo(c1.source_order) }
|
||||||
}
|
}
|
||||||
Manga.CHAPTER_SORTING_NUMBER -> when (sortDescending) {
|
Manga.CHAPTER_SORTING_NUMBER -> when (sortDescending) {
|
||||||
true -> { c1, c2 -> c2.chapter_number.compareTo(c1.chapter_number) }
|
true -> { c1, c2 -> c2.chapter_number.toString().compareToCaseInsensitiveNaturalOrder(c1.chapter_number.toString()) }
|
||||||
false -> { c1, c2 -> c1.chapter_number.compareTo(c2.chapter_number) }
|
false -> { c1, c2 -> c1.chapter_number.toString().compareToCaseInsensitiveNaturalOrder(c2.chapter_number.toString()) }
|
||||||
}
|
}
|
||||||
Manga.CHAPTER_SORTING_UPLOAD_DATE -> when (sortDescending) {
|
Manga.CHAPTER_SORTING_UPLOAD_DATE -> when (sortDescending) {
|
||||||
true -> { c1, c2 -> c2.date_upload.compareTo(c1.date_upload) }
|
true -> { c1, c2 -> c2.date_upload.compareTo(c1.date_upload) }
|
||||||
|
|
|
@ -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.Anime
|
||||||
import eu.kanade.tachiyomi.data.database.models.Episode
|
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 {
|
fun getEpisodeSort(anime: Anime, sortDescending: Boolean = anime.sortDescending()): (Episode, Episode) -> Int {
|
||||||
return when (anime.sorting) {
|
return when (anime.sorting) {
|
||||||
Anime.EPISODE_SORTING_SOURCE -> when (sortDescending) {
|
Anime.EPISODE_SORTING_SOURCE -> when (sortDescending) {
|
||||||
true -> { c1, c2 -> c1.source_order.compareTo(c2.source_order) }
|
true -> { e1, e2 -> e1.source_order.compareTo(e2.source_order) }
|
||||||
false -> { c1, c2 -> c2.source_order.compareTo(c1.source_order) }
|
false -> { e1, e2 -> e2.source_order.compareTo(e1.source_order) }
|
||||||
}
|
}
|
||||||
Anime.EPISODE_SORTING_NUMBER -> when (sortDescending) {
|
Anime.EPISODE_SORTING_NUMBER -> when (sortDescending) {
|
||||||
true -> { e1, e2 -> e2.episode_number.compareTo(e1.episode_number) }
|
true -> { e1, e2 -> e2.episode_number.toString().compareToCaseInsensitiveNaturalOrder(e1.episode_number.toString()) }
|
||||||
false -> { e1, e2 -> e1.episode_number.compareTo(e2.episode_number) }
|
false -> { e1, e2 -> e1.episode_number.toString().compareToCaseInsensitiveNaturalOrder(e2.episode_number.toString()) }
|
||||||
}
|
}
|
||||||
Anime.EPISODE_SORTING_UPLOAD_DATE -> when (sortDescending) {
|
Anime.EPISODE_SORTING_UPLOAD_DATE -> when (sortDescending) {
|
||||||
true -> { e1, e2 -> e2.date_upload.compareTo(e1.date_upload) }
|
true -> { e1, e2 -> e2.date_upload.compareTo(e1.date_upload) }
|
||||||
|
|
Loading…
Reference in a new issue