mirror of
https://github.com/tachiyomiorg/tachiyomi.git
synced 2024-12-23 12:41:50 +01:00
New chapters notification now always says "mark as read"
Sorting manga now ignores articles such as "a" "an" and "the"
This commit is contained in:
parent
18c8c6049c
commit
ef54c61876
@ -479,9 +479,7 @@ class LibraryUpdateService(
|
||||
this@LibraryUpdateService, manga, chapters.first()
|
||||
)
|
||||
)
|
||||
addAction(R.drawable.ic_glasses_black_24dp, getString(
|
||||
if (chapters.size > 1) R.string.action_mark_all_as_read else R.string
|
||||
.action_mark_as_read),
|
||||
addAction(R.drawable.ic_glasses_black_24dp, getString(R.string.action_mark_as_read),
|
||||
NotificationReceiver.markAsReadPendingBroadcast(this@LibraryUpdateService,
|
||||
manga, chapters, Notifications.GROUP_NEW_CHAPTERS))
|
||||
addAction(R.drawable.ic_book_white_24dp, getString(R.string.action_view_chapters),
|
||||
|
@ -190,7 +190,7 @@ class LibraryPresenter(
|
||||
|
||||
val sortFn: (LibraryItem, LibraryItem) -> Int = { i1, i2 ->
|
||||
when (sortingMode) {
|
||||
LibrarySort.ALPHA -> i1.manga.title.compareTo(i2.manga.title, true)
|
||||
LibrarySort.ALPHA -> i1.manga.title.removeArticles().compareTo(i2.manga.title.removeArticles(), true)
|
||||
LibrarySort.LAST_READ -> {
|
||||
// Get index of manga, set equal to list if size unknown.
|
||||
val manga1LastRead = lastReadManga[i1.manga.id!!] ?: lastReadManga.size
|
||||
@ -221,6 +221,10 @@ class LibraryPresenter(
|
||||
return map.mapValues { entry -> entry.value.sortedWith(comparator) }
|
||||
}
|
||||
|
||||
fun String.removeArticles(): String {
|
||||
return this.replace(Regex("^(an|a|the) ", RegexOption.IGNORE_CASE), "")
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the categories and all its manga from the database.
|
||||
*
|
||||
|
@ -45,7 +45,6 @@
|
||||
<string name="action_global_search">Global search</string>
|
||||
<string name="action_select_all">Select all</string>
|
||||
<string name="action_mark_as_read">Mark as read</string>
|
||||
<string name="action_mark_all_as_read">Mark all as read</string>
|
||||
<string name="action_mark_as_unread">Mark as unread</string>
|
||||
<string name="action_mark_previous_as_read">Mark previous as read</string>
|
||||
<string name="action_download">Download</string>
|
||||
|
Loading…
Reference in New Issue
Block a user