This commit is contained in:
Jobobby04 2020-12-12 12:36:29 -05:00
parent 134f776a86
commit 6f712c7f17
28 changed files with 49 additions and 8 deletions

View File

@ -17,6 +17,7 @@ object Backup {
const val EXTENSIONS = "extensions" const val EXTENSIONS = "extensions"
const val HISTORY = "history" const val HISTORY = "history"
const val VERSION = "version" const val VERSION = "version"
// SY --> // SY -->
const val SAVEDSEARCHES = "savedsearches" const val SAVEDSEARCHES = "savedsearches"
const val MERGEDMANGAREFERENCES = "mergedmangareferences" const val MERGEDMANGAREFERENCES = "mergedmangareferences"

View File

@ -25,6 +25,7 @@ object CategoryTable {
$COL_FLAGS INTEGER NOT NULL, $COL_FLAGS INTEGER NOT NULL,
$COL_MANGA_ORDER TEXT NOT NULL $COL_MANGA_ORDER TEXT NOT NULL
)""" )"""
// SY --> // SY -->
val addMangaOrder: String val addMangaOrder: String
get() = "ALTER TABLE $TABLE ADD COLUMN $COL_MANGA_ORDER TEXT" get() = "ALTER TABLE $TABLE ADD COLUMN $COL_MANGA_ORDER TEXT"

View File

@ -29,8 +29,10 @@ object PreferenceValues {
enum class DisplayMode { enum class DisplayMode {
COMPACT_GRID, COMPACT_GRID,
COMFORTABLE_GRID, COMFORTABLE_GRID,
// SY --> // SY -->
NO_TITLE_GRID, NO_TITLE_GRID,
// SY <-- // SY <--
LIST, LIST,
} }

View File

@ -16,7 +16,6 @@ import eu.kanade.tachiyomi.util.lang.compareToCaseInsensitiveNaturalOrder
import eu.kanade.tachiyomi.util.storage.DiskUtil import eu.kanade.tachiyomi.util.storage.DiskUtil
import eu.kanade.tachiyomi.util.storage.EpubFile import eu.kanade.tachiyomi.util.storage.EpubFile
import eu.kanade.tachiyomi.util.system.ImageUtil import eu.kanade.tachiyomi.util.system.ImageUtil
import junrar.rarfile.FileHeader
import kotlinx.serialization.Serializable import kotlinx.serialization.Serializable
import kotlinx.serialization.encodeToString import kotlinx.serialization.encodeToString
import kotlinx.serialization.json.Json import kotlinx.serialization.json.Json

View File

@ -76,6 +76,7 @@ interface SManga : Serializable {
const val ONGOING = 1 const val ONGOING = 1
const val COMPLETED = 2 const val COMPLETED = 2
const val LICENSED = 3 const val LICENSED = 3
// SY --> Mangadex specific statuses // SY --> Mangadex specific statuses
const val PUBLICATION_COMPLETE = 61 const val PUBLICATION_COMPLETE = 61
const val CANCELLED = 62 const val CANCELLED = 62

View File

@ -30,6 +30,7 @@ class HentaiCafe(delegate: HttpSource, val context: Context) :
* An ISO 639-1 compliant language code (two letters in lower case). * An ISO 639-1 compliant language code (two letters in lower case).
*/ */
override val lang = "en" override val lang = "en"
/** /**
* The class of the metadata used by this source * The class of the metadata used by this source
*/ */

View File

@ -33,6 +33,7 @@ class Pururin(delegate: HttpSource, val context: Context) :
* An ISO 639-1 compliant language code (two letters in lower case). * An ISO 639-1 compliant language code (two letters in lower case).
*/ */
override val lang = "en" override val lang = "en"
/** /**
* The class of the metadata used by this source * The class of the metadata used by this source
*/ */

View File

@ -162,6 +162,7 @@ class BrowseController :
const val TO_EXTENSIONS_EXTRA = "to_extensions" const val TO_EXTENSIONS_EXTRA = "to_extensions"
const val SOURCES_CONTROLLER = 0 const val SOURCES_CONTROLLER = 0
// SY --> // SY -->
const val LATEST_CONTROLLER = 1 const val LATEST_CONTROLLER = 1
const val EXTENSIONS_CONTROLLER = 2 const val EXTENSIONS_CONTROLLER = 2

View File

@ -373,6 +373,7 @@ class LibraryCategoryView @JvmOverloads constructor(context: Context, attrs: Att
} }
lastClickPosition = position lastClickPosition = position
} }
// SY --> // SY -->
private fun getGroupExtra() = when (controller.presenter.groupType) { private fun getGroupExtra() = when (controller.presenter.groupType) {
LibraryGroup.BY_DEFAULT -> null LibraryGroup.BY_DEFAULT -> null

View File

@ -144,8 +144,10 @@ class LibraryController(
// --> EH // --> EH
// Sync dialog // Sync dialog
private var favSyncDialog: MaterialDialog? = null private var favSyncDialog: MaterialDialog? = null
// Old sync status // Old sync status
private var oldSyncStatus: FavoritesSyncStatus? = null private var oldSyncStatus: FavoritesSyncStatus? = null
// Favorites // Favorites
private var favoritesSyncJob: Job? = null private var favoritesSyncJob: Job? = null
val loaderManager = LoaderManager() val loaderManager = LoaderManager()

View File

@ -33,6 +33,7 @@ class LibraryItem(val manga: LibraryManga, private val libraryDisplayMode: Prefe
AbstractFlexibleItem<LibraryHolder<*>>(), IFilterable<Pair<String, Boolean>> { AbstractFlexibleItem<LibraryHolder<*>>(), IFilterable<Pair<String, Boolean>> {
private val sourceManager: SourceManager = Injekt.get() private val sourceManager: SourceManager = Injekt.get()
// SY --> // SY -->
private val trackManager: TrackManager = Injekt.get() private val trackManager: TrackManager = Injekt.get()
private val db: DatabaseHelper = Injekt.get() private val db: DatabaseHelper = Injekt.get()

View File

@ -87,6 +87,7 @@ class LibrarySettingsSheet(
private val lewd = Item.TriStateGroup(R.string.lewd, this) private val lewd = Item.TriStateGroup(R.string.lewd, this)
override val header = null override val header = null
// SY --> // SY -->
override val items = ( override val items = (
if (Injekt.get<TrackManager>().hasLoggedServices()) { if (Injekt.get<TrackManager>().hasLoggedServices()) {
@ -95,6 +96,7 @@ class LibrarySettingsSheet(
listOf(downloaded, unread, completed, started, lewd) listOf(downloaded, unread, completed, started, lewd)
} }
) )
// SY <-- // SY <--
override val footer = null override val footer = null
@ -166,12 +168,14 @@ class LibrarySettingsSheet(
private val unread = Item.MultiSort(R.string.action_filter_unread, this) private val unread = Item.MultiSort(R.string.action_filter_unread, this)
private val latestChapter = Item.MultiSort(R.string.action_sort_latest_chapter, this) private val latestChapter = Item.MultiSort(R.string.action_sort_latest_chapter, this)
private val dateAdded = Item.MultiSort(R.string.action_sort_date_added, this) private val dateAdded = Item.MultiSort(R.string.action_sort_date_added, this)
// SY --> // SY -->
private val dragAndDrop = Item.MultiSort(R.string.action_sort_drag_and_drop, this) private val dragAndDrop = Item.MultiSort(R.string.action_sort_drag_and_drop, this)
private val tagList = Item.MultiSort(R.string.tag_sorting, this) private val tagList = Item.MultiSort(R.string.tag_sorting, this)
// SY <-- // SY <--
override val header = null override val header = null
override val items = override val items =
listOf(alphabetically, lastRead, lastChecked, unread, total, latestChapter, dateAdded /* SY --> */, dragAndDrop) + if (preferences.sortTagsForLibrary().get().isNotEmpty()) listOf(tagList) else emptyList() /* SY <-- */ listOf(alphabetically, lastRead, lastChecked, unread, total, latestChapter, dateAdded /* SY --> */, dragAndDrop) + if (preferences.sortTagsForLibrary().get().isNotEmpty()) listOf(tagList) else emptyList() /* SY <-- */
override val footer = null override val footer = null
@ -266,8 +270,10 @@ class LibrarySettingsSheet(
private val compactGrid = Item.Radio(R.string.action_display_grid, this) private val compactGrid = Item.Radio(R.string.action_display_grid, this)
private val comfortableGrid = Item.Radio(R.string.action_display_comfortable_grid, this) private val comfortableGrid = Item.Radio(R.string.action_display_comfortable_grid, this)
// SY --> // SY -->
private val noTitleGrid = Item.Radio(R.string.action_display_no_title_grid, this) private val noTitleGrid = Item.Radio(R.string.action_display_no_title_grid, this)
// SY <-- // SY <--
private val list = Item.Radio(R.string.action_display_list, this) private val list = Item.Radio(R.string.action_display_list, this)

View File

@ -9,6 +9,7 @@ object LibrarySort {
const val TOTAL = 4 const val TOTAL = 4
const val LATEST_CHAPTER = 6 const val LATEST_CHAPTER = 6
const val DATE_ADDED = 8 const val DATE_ADDED = 8
// SY --> // SY -->
const val DRAG_AND_DROP = 7 const val DRAG_AND_DROP = 7
const val TAG_LIST = 9 const val TAG_LIST = 9

View File

@ -182,10 +182,12 @@ class MangaController :
private val toolbarTextColor by lazy { view!!.context.getResourceColor(R.attr.colorOnPrimary) } private val toolbarTextColor by lazy { view!!.context.getResourceColor(R.attr.colorOnPrimary) }
private var mangaInfoAdapter: MangaInfoHeaderAdapter? = null private var mangaInfoAdapter: MangaInfoHeaderAdapter? = null
// SY >-- // SY >--
private var mangaInfoItemAdapter: MangaInfoItemAdapter? = null private var mangaInfoItemAdapter: MangaInfoItemAdapter? = null
private var mangaInfoButtonsAdapter: MangaInfoButtonsAdapter? = null private var mangaInfoButtonsAdapter: MangaInfoButtonsAdapter? = null
private var mangaMetaInfoAdapter: RecyclerView.Adapter<*>? = null private var mangaMetaInfoAdapter: RecyclerView.Adapter<*>? = null
// SY <-- // SY <--
private var chaptersHeaderAdapter: MangaChaptersHeaderAdapter? = null private var chaptersHeaderAdapter: MangaChaptersHeaderAdapter? = null
private var chaptersAdapter: ChaptersAdapter? = null private var chaptersAdapter: ChaptersAdapter? = null

View File

@ -41,6 +41,7 @@ class MangaInfoHeaderAdapter(
RecyclerView.Adapter<MangaInfoHeaderAdapter.HeaderViewHolder>() { RecyclerView.Adapter<MangaInfoHeaderAdapter.HeaderViewHolder>() {
private val trackManager: TrackManager by injectLazy() private val trackManager: TrackManager by injectLazy()
// SY --> // SY -->
private val db: DatabaseHelper by injectLazy() private val db: DatabaseHelper by injectLazy()
private val sourceManager: SourceManager by injectLazy() private val sourceManager: SourceManager by injectLazy()

View File

@ -20,6 +20,7 @@ class WebtoonConfig(preferences: PreferencesHelper = Injekt.get()) : ViewerConfi
var enableZoomOut = false var enableZoomOut = false
private set private set
var zoomPropertyChangedListener: ((Boolean) -> Unit)? = null var zoomPropertyChangedListener: ((Boolean) -> Unit)? = null
// SY <-- // SY <--
init { init {
preferences.cropBordersWebtoon() preferences.cropBordersWebtoon()

View File

@ -33,6 +33,7 @@ open class WebtoonRecyclerView @JvmOverloads constructor(
private var firstVisibleItemPosition = 0 private var firstVisibleItemPosition = 0
private var lastVisibleItemPosition = 0 private var lastVisibleItemPosition = 0
private var currentScale = DEFAULT_RATE private var currentScale = DEFAULT_RATE
// SY --> // SY -->
var canZoomOut = false var canZoomOut = false
set(value) { set(value) {

View File

@ -7,12 +7,16 @@ import java.util.Locale
enum class DebugToggles(val default: Boolean) { enum class DebugToggles(val default: Boolean) {
// Redirect to master version of gallery when encountering a gallery that has a parent/child that is already in the library // Redirect to master version of gallery when encountering a gallery that has a parent/child that is already in the library
ENABLE_EXH_ROOT_REDIRECT(true), ENABLE_EXH_ROOT_REDIRECT(true),
// Enable debug overlay (only available in debug builds) // Enable debug overlay (only available in debug builds)
ENABLE_DEBUG_OVERLAY(true), ENABLE_DEBUG_OVERLAY(true),
// Convert non-root galleries into root galleries when loading them // Convert non-root galleries into root galleries when loading them
PULL_TO_ROOT_WHEN_LOADING_EXH_MANGA_DETAILS(true), PULL_TO_ROOT_WHEN_LOADING_EXH_MANGA_DETAILS(true),
// Do not update the same gallery too often // Do not update the same gallery too often
RESTRICT_EXH_GALLERY_UPDATE_CHECK_FREQUENCY(true), RESTRICT_EXH_GALLERY_UPDATE_CHECK_FREQUENCY(true),
// Pretend that all galleries only have a single version // Pretend that all galleries only have a single version
INCLUDE_ONLY_ROOT_WHEN_LOADING_EXH_VERSIONS(false); INCLUDE_ONLY_ROOT_WHEN_LOADING_EXH_VERSIONS(false);

View File

@ -266,6 +266,7 @@ class EHentaiUpdateWorker : JobService(), CoroutineScope {
db.insertManga(manga).await() db.insertManga(manga).await()
val newChapters = source.fetchChapterList(manga).awaitSingle() val newChapters = source.fetchChapterList(manga).awaitSingle()
val (new, _) = syncChaptersWithSource(db, newChapters, manga, source) // Not suspending, but does block, maybe fix this? val (new, _) = syncChaptersWithSource(db, newChapters, manga, source) // Not suspending, but does block, maybe fix this?
return new to db.getChapters(manga).await() return new to db.getChapters(manga).await()
} catch (t: Throwable) { } catch (t: Throwable) {
@ -386,6 +387,7 @@ data class UpdateEntry(val manga: Manga, val meta: EHentaiSearchMetadata, val ro
object EHentaiUpdateWorkerConstants { object EHentaiUpdateWorkerConstants {
const val UPDATES_PER_ITERATION = 50 const val UPDATES_PER_ITERATION = 50
@OptIn(ExperimentalTime::class) @OptIn(ExperimentalTime::class)
val GALLERY_AGE_TIME = 365.days.toLongMilliseconds() val GALLERY_AGE_TIME = 365.days.toLongMilliseconds()
} }

View File

@ -52,6 +52,7 @@ class MemAutoFlushingLookupTable<T>(
// Used to debounce // Used to debounce
@Volatile @Volatile
private var writeCounter = Long.MIN_VALUE private var writeCounter = Long.MIN_VALUE
@Volatile @Volatile
private var flushed = true private var flushed = true

View File

@ -31,6 +31,7 @@ class ApiMangaParser(private val langs: List<String>) {
val db: DatabaseHelper get() = Injekt.get() val db: DatabaseHelper get() = Injekt.get()
val metaClass = MangaDexSearchMetadata::class val metaClass = MangaDexSearchMetadata::class
/** /**
* Use reflection to create a new instance of metadata * Use reflection to create a new instance of metadata
*/ */
@ -38,6 +39,7 @@ class ApiMangaParser(private val langs: List<String>) {
it.parameters.isEmpty() it.parameters.isEmpty()
}?.call() }?.call()
?: error("Could not find no-args constructor for meta class: ${metaClass.qualifiedName}!") ?: error("Could not find no-args constructor for meta class: ${metaClass.qualifiedName}!")
/** /**
* Parses metadata from the input and then copies it into the manga * Parses metadata from the input and then copies it into the manga
* *

View File

@ -71,8 +71,8 @@ class FollowsHandler(val client: OkHttpClient, val headers: Headers, val prefere
return MetadataMangasPage(result.map { it.first }, false, result.map { it.second }) return MetadataMangasPage(result.map { it.first }, false, result.map { it.second })
} }
/**fetch follow status used when fetching status for 1 manga /**
* * fetch follow status used when fetching status for 1 manga
*/ */
private fun followStatusParse(response: Response): Track { private fun followStatusParse(response: Response): Track {
@ -99,8 +99,8 @@ class FollowsHandler(val client: OkHttpClient, val headers: Headers, val prefere
return track return track
} }
/**build Request for follows page /**
* * build Request for follows page
*/ */
private fun followsListRequest(): Request { private fun followsListRequest(): Request {
return GET("${MdUtil.baseUrl}${MdUtil.followsAllApi}", headers, CacheControl.FORCE_NETWORK) return GET("${MdUtil.baseUrl}${MdUtil.followsAllApi}", headers, CacheControl.FORCE_NETWORK)

View File

@ -29,6 +29,7 @@ class EHentaiSearchMetadata : RaisedSearchMetadata() {
var datePosted: Long? = null var datePosted: Long? = null
var parent: String? = null var parent: String? = null
var visible: String? = null // Not a boolean var visible: String? = null // Not a boolean
var language: String? = null var language: String? = null
var translated: Boolean? = null var translated: Boolean? = null

View File

@ -108,6 +108,7 @@ abstract class DelegatedHttpSource(val delegate: HttpSource) : HttpSource() {
* Whether the source has support for latest updates. * Whether the source has support for latest updates.
*/ */
override val supportsLatest get() = delegate.supportsLatest override val supportsLatest get() = delegate.supportsLatest
/** /**
* Name of the source. * Name of the source.
*/ */
@ -121,6 +122,7 @@ abstract class DelegatedHttpSource(val delegate: HttpSource) : HttpSource() {
* Note the generated id sets the sign bit to 0. * Note the generated id sets the sign bit to 0.
*/ */
override val id get() = delegate.id override val id get() = delegate.id
/** /**
* Default network client for doing requests. * Default network client for doing requests.
*/ */

View File

@ -113,6 +113,7 @@ class EnhancedHttpSource(
* Whether the source has support for latest updates. * Whether the source has support for latest updates.
*/ */
override val supportsLatest get() = source().supportsLatest override val supportsLatest get() = source().supportsLatest
/** /**
* Name of the source. * Name of the source.
*/ */
@ -131,6 +132,7 @@ class EnhancedHttpSource(
* Note the generated id sets the sign bit to 0. * Note the generated id sets the sign bit to 0.
*/ */
override val id get() = source().id override val id get() = source().id
/** /**
* Default network client for doing requests. * Default network client for doing requests.
*/ */

View File

@ -158,6 +158,7 @@ class EHConfigurator(val context: Context) {
companion object { companion object {
private const val PROFILE_NAME = "TachiyomiEH App" private const val PROFILE_NAME = "TachiyomiEH App"
private const val UCONFIG_URL = "/uconfig.php" private const val UCONFIG_URL = "/uconfig.php"
// Always use E-H here as EXH does not have a perks page // Always use E-H here as EXH does not have a perks page
private const val HATH_PERKS_URL = "https://e-hentai.org/hathperks.php" private const val HATH_PERKS_URL = "https://e-hentai.org/hathperks.php"
private const val PROFILE_SELECTOR = "[name=profile_set] > option" private const val PROFILE_SELECTOR = "[name=profile_set] > option"

View File

@ -131,6 +131,7 @@ private inline class EntryShim<K, V>(private val entry: Map.Entry<K, V>) : FakeM
*/ */
override val key: K override val key: K
get() = entry.key get() = entry.key
/** /**
* Returns the value of this key/value pair. * Returns the value of this key/value pair.
*/ */
@ -143,6 +144,7 @@ private inline class PairShim<K, V>(private val pair: Pair<K, V>) : FakeMutableE
* Returns the key of this key/value pair. * Returns the key of this key/value pair.
*/ */
override val key: K get() = pair.first override val key: K get() = pair.first
/** /**
* Returns the value of this key/value pair. * Returns the value of this key/value pair.
*/ */
@ -164,6 +166,7 @@ interface FakeMutableEntry<K, V> : MutableMap.MutableEntry<K, V> {
* Returns the key of this key/value pair. * Returns the key of this key/value pair.
*/ */
override val key: K = key override val key: K = key
/** /**
* Returns the value of this key/value pair. * Returns the value of this key/value pair.
*/ */