|
@@ -25,12 +25,8 @@ interface Manga : SManga {
|
|
|
|
|
|
var cover_last_modified: Long
|
|
|
|
|
|
- fun setChapterOrder(order: Int) {
|
|
|
- setChapterFlags(order, CHAPTER_SORT_MASK)
|
|
|
- }
|
|
|
-
|
|
|
fun sortDescending(): Boolean {
|
|
|
- return chapter_flags and CHAPTER_SORT_MASK == CHAPTER_SORT_DESC
|
|
|
+ return chapter_flags and DomainManga.CHAPTER_SORT_DIR_MASK.toInt() == DomainManga.CHAPTER_SORT_DESC.toInt()
|
|
|
}
|
|
|
|
|
|
fun getGenres(): List<String>? {
|
|
@@ -48,24 +44,24 @@ interface Manga : SManga {
|
|
|
|
|
|
// Used to display the chapter's title one way or another
|
|
|
var displayMode: Int
|
|
|
- get() = chapter_flags and CHAPTER_DISPLAY_MASK
|
|
|
- set(mode) = setChapterFlags(mode, CHAPTER_DISPLAY_MASK)
|
|
|
+ get() = chapter_flags and DomainManga.CHAPTER_DISPLAY_MASK.toInt()
|
|
|
+ set(mode) = setChapterFlags(mode, DomainManga.CHAPTER_DISPLAY_MASK.toInt())
|
|
|
|
|
|
var readFilter: Int
|
|
|
- get() = chapter_flags and CHAPTER_READ_MASK
|
|
|
- set(filter) = setChapterFlags(filter, CHAPTER_READ_MASK)
|
|
|
+ get() = chapter_flags and DomainManga.CHAPTER_UNREAD_MASK.toInt()
|
|
|
+ set(filter) = setChapterFlags(filter, DomainManga.CHAPTER_UNREAD_MASK.toInt())
|
|
|
|
|
|
var downloadedFilter: Int
|
|
|
- get() = chapter_flags and CHAPTER_DOWNLOADED_MASK
|
|
|
- set(filter) = setChapterFlags(filter, CHAPTER_DOWNLOADED_MASK)
|
|
|
+ get() = chapter_flags and DomainManga.CHAPTER_DOWNLOADED_MASK.toInt()
|
|
|
+ set(filter) = setChapterFlags(filter, DomainManga.CHAPTER_DOWNLOADED_MASK.toInt())
|
|
|
|
|
|
var bookmarkedFilter: Int
|
|
|
- get() = chapter_flags and CHAPTER_BOOKMARKED_MASK
|
|
|
- set(filter) = setChapterFlags(filter, CHAPTER_BOOKMARKED_MASK)
|
|
|
+ get() = chapter_flags and DomainManga.CHAPTER_BOOKMARKED_MASK.toInt()
|
|
|
+ set(filter) = setChapterFlags(filter, DomainManga.CHAPTER_BOOKMARKED_MASK.toInt())
|
|
|
|
|
|
var sorting: Int
|
|
|
- get() = chapter_flags and CHAPTER_SORTING_MASK
|
|
|
- set(sort) = setChapterFlags(sort, CHAPTER_SORTING_MASK)
|
|
|
+ get() = chapter_flags and DomainManga.CHAPTER_SORTING_MASK.toInt()
|
|
|
+ set(sort) = setChapterFlags(sort, DomainManga.CHAPTER_SORTING_MASK.toInt())
|
|
|
|
|
|
var readingModeType: Int
|
|
|
get() = viewer_flags and ReadingModeType.MASK
|
|
@@ -76,39 +72,6 @@ interface Manga : SManga {
|
|
|
set(rotationType) = setViewerFlags(rotationType, OrientationType.MASK)
|
|
|
|
|
|
companion object {
|
|
|
-
|
|
|
- // Generic filter that does not filter anything
|
|
|
- const val SHOW_ALL = 0x00000000
|
|
|
-
|
|
|
- const val CHAPTER_SORT_DESC = 0x00000000
|
|
|
- const val CHAPTER_SORT_ASC = 0x00000001
|
|
|
- const val CHAPTER_SORT_MASK = 0x00000001
|
|
|
-
|
|
|
- const val CHAPTER_SHOW_UNREAD = 0x00000002
|
|
|
- const val CHAPTER_SHOW_READ = 0x00000004
|
|
|
- const val CHAPTER_READ_MASK = 0x00000006
|
|
|
-
|
|
|
- const val CHAPTER_SHOW_DOWNLOADED = 0x00000008
|
|
|
- const val CHAPTER_SHOW_NOT_DOWNLOADED = 0x00000010
|
|
|
- const val CHAPTER_DOWNLOADED_MASK = 0x00000018
|
|
|
-
|
|
|
- const val CHAPTER_SHOW_BOOKMARKED = 0x00000020
|
|
|
- const val CHAPTER_SHOW_NOT_BOOKMARKED = 0x00000040
|
|
|
- const val CHAPTER_BOOKMARKED_MASK = 0x00000060
|
|
|
-
|
|
|
- const val CHAPTER_SORTING_SOURCE = 0x00000000
|
|
|
- const val CHAPTER_SORTING_NUMBER = 0x00000100
|
|
|
- const val CHAPTER_SORTING_UPLOAD_DATE = 0x00000200
|
|
|
- const val CHAPTER_SORTING_MASK = 0x00000300
|
|
|
-
|
|
|
- const val CHAPTER_DISPLAY_NAME = 0x00000000
|
|
|
- const val CHAPTER_DISPLAY_NUMBER = 0x00100000
|
|
|
- const val CHAPTER_DISPLAY_MASK = 0x00100000
|
|
|
-
|
|
|
- fun create(source: Long): Manga = MangaImpl().apply {
|
|
|
- this.source = source
|
|
|
- }
|
|
|
-
|
|
|
fun create(pathUrl: String, title: String, source: Long = 0): Manga = MangaImpl().apply {
|
|
|
url = pathUrl
|
|
|
this.title = title
|