mirror of
				https://github.com/mihonapp/mihon.git
				synced 2025-11-03 23:58:55 +01:00 
			
		
		
		
	Move empty-chapterlist manga to end of Latest Chapter sort in Library view
This commit is contained in:
		@@ -93,7 +93,7 @@ fun getLastReadMangaQuery() = """
 | 
			
		||||
    ORDER BY max DESC
 | 
			
		||||
"""
 | 
			
		||||
 | 
			
		||||
fun getTotalChapterMangaQuery()= """
 | 
			
		||||
fun getTotalChapterMangaQuery() = """
 | 
			
		||||
    SELECT ${Manga.TABLE}.*
 | 
			
		||||
    FROM ${Manga.TABLE}
 | 
			
		||||
    JOIN ${Chapter.TABLE}
 | 
			
		||||
@@ -102,7 +102,7 @@ fun getTotalChapterMangaQuery()= """
 | 
			
		||||
    ORDER by COUNT(*)
 | 
			
		||||
"""
 | 
			
		||||
 | 
			
		||||
fun getLatestChapterMangaQuery()= """
 | 
			
		||||
fun getLatestChapterMangaQuery() = """
 | 
			
		||||
    SELECT ${Manga.TABLE}.*, MAX(${Chapter.TABLE}.${Chapter.COL_DATE_UPLOAD}) AS max
 | 
			
		||||
    FROM ${Manga.TABLE}
 | 
			
		||||
    JOIN ${Chapter.TABLE}
 | 
			
		||||
 
 | 
			
		||||
@@ -207,8 +207,10 @@ class LibraryPresenter(
 | 
			
		||||
                    manga1TotalChapter.compareTo(mange2TotalChapter)
 | 
			
		||||
                }
 | 
			
		||||
                LibrarySort.LATEST_CHAPTER -> {
 | 
			
		||||
                    val manga1latestChapter = latestChapterManga[i1.manga.id!!] ?: 0
 | 
			
		||||
                    val manga2latestChapter = latestChapterManga[i2.manga.id!!] ?: 0
 | 
			
		||||
                    val manga1latestChapter = latestChapterManga[i1.manga.id!!]
 | 
			
		||||
                            ?: latestChapterManga.size
 | 
			
		||||
                    val manga2latestChapter = latestChapterManga[i2.manga.id!!]
 | 
			
		||||
                            ?: latestChapterManga.size
 | 
			
		||||
                    manga1latestChapter.compareTo(manga2latestChapter)
 | 
			
		||||
                }
 | 
			
		||||
                else -> throw Exception("Unknown sorting mode")
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user