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 HISTORY = "history"
const val VERSION = "version"
// SY -->
const val SAVEDSEARCHES = "savedsearches"
const val MERGEDMANGAREFERENCES = "mergedmangareferences"

View File

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

View File

@ -91,12 +91,12 @@ class LibraryUpdateService(
CHAPTERS, // Manga chapters
COVERS, // Manga covers
TRACKING, // Tracking metadata
// SY -->
SYNC_FOLLOWS, // MangaDex specific, pull mangadex manga in reading, rereading
PUSH_FAVORITES // MangaDex specific, push mangadex manga to mangadex
// SY <--
}

View File

@ -29,8 +29,10 @@ object PreferenceValues {
enum class DisplayMode {
COMPACT_GRID,
COMFORTABLE_GRID,
// SY -->
NO_TITLE_GRID,
// SY <--
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.EpubFile
import eu.kanade.tachiyomi.util.system.ImageUtil
import junrar.rarfile.FileHeader
import kotlinx.serialization.Serializable
import kotlinx.serialization.encodeToString
import kotlinx.serialization.json.Json

View File

@ -76,6 +76,7 @@ interface SManga : Serializable {
const val ONGOING = 1
const val COMPLETED = 2
const val LICENSED = 3
// SY --> Mangadex specific statuses
const val PUBLICATION_COMPLETE = 61
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).
*/
override val lang = "en"
/**
* 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).
*/
override val lang = "en"
/**
* 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 SOURCES_CONTROLLER = 0
// SY -->
const val LATEST_CONTROLLER = 1
const val EXTENSIONS_CONTROLLER = 2

View File

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

View File

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

View File

@ -33,6 +33,7 @@ class LibraryItem(val manga: LibraryManga, private val libraryDisplayMode: Prefe
AbstractFlexibleItem<LibraryHolder<*>>(), IFilterable<Pair<String, Boolean>> {
private val sourceManager: SourceManager = Injekt.get()
// SY -->
private val trackManager: TrackManager = 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)
override val header = null
// SY -->
override val items = (
if (Injekt.get<TrackManager>().hasLoggedServices()) {
@ -95,6 +96,7 @@ class LibrarySettingsSheet(
listOf(downloaded, unread, completed, started, lewd)
}
)
// SY <--
override val footer = null
@ -166,12 +168,14 @@ class LibrarySettingsSheet(
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 dateAdded = Item.MultiSort(R.string.action_sort_date_added, this)
// SY -->
private val dragAndDrop = Item.MultiSort(R.string.action_sort_drag_and_drop, this)
private val tagList = Item.MultiSort(R.string.tag_sorting, this)
// SY <--
override val header = null
override val items =
listOf(alphabetically, lastRead, lastChecked, unread, total, latestChapter, dateAdded /* SY --> */, dragAndDrop) + if (preferences.sortTagsForLibrary().get().isNotEmpty()) listOf(tagList) else emptyList() /* SY <-- */
override val footer = null
@ -266,8 +270,10 @@ class LibrarySettingsSheet(
private val compactGrid = Item.Radio(R.string.action_display_grid, this)
private val comfortableGrid = Item.Radio(R.string.action_display_comfortable_grid, this)
// SY -->
private val noTitleGrid = Item.Radio(R.string.action_display_no_title_grid, this)
// SY <--
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 LATEST_CHAPTER = 6
const val DATE_ADDED = 8
// SY -->
const val DRAG_AND_DROP = 7
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 var mangaInfoAdapter: MangaInfoHeaderAdapter? = null
// SY >--
private var mangaInfoItemAdapter: MangaInfoItemAdapter? = null
private var mangaInfoButtonsAdapter: MangaInfoButtonsAdapter? = null
private var mangaMetaInfoAdapter: RecyclerView.Adapter<*>? = null
// SY <--
private var chaptersHeaderAdapter: MangaChaptersHeaderAdapter? = null
private var chaptersAdapter: ChaptersAdapter? = null

View File

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

View File

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

View File

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

View File

@ -7,12 +7,16 @@ import java.util.Locale
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
ENABLE_EXH_ROOT_REDIRECT(true),
// Enable debug overlay (only available in debug builds)
ENABLE_DEBUG_OVERLAY(true),
// Convert non-root galleries into root galleries when loading them
PULL_TO_ROOT_WHEN_LOADING_EXH_MANGA_DETAILS(true),
// Do not update the same gallery too often
RESTRICT_EXH_GALLERY_UPDATE_CHECK_FREQUENCY(true),
// Pretend that all galleries only have a single version
INCLUDE_ONLY_ROOT_WHEN_LOADING_EXH_VERSIONS(false);

View File

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

View File

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

View File

@ -31,6 +31,7 @@ class ApiMangaParser(private val langs: List<String>) {
val db: DatabaseHelper get() = Injekt.get()
val metaClass = MangaDexSearchMetadata::class
/**
* Use reflection to create a new instance of metadata
*/
@ -38,6 +39,7 @@ class ApiMangaParser(private val langs: List<String>) {
it.parameters.isEmpty()
}?.call()
?: error("Could not find no-args constructor for meta class: ${metaClass.qualifiedName}!")
/**
* 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 })
}
/**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 {
@ -99,8 +99,8 @@ class FollowsHandler(val client: OkHttpClient, val headers: Headers, val prefere
return track
}
/**build Request for follows page
*
/**
* build Request for follows page
*/
private fun followsListRequest(): Request {
return GET("${MdUtil.baseUrl}${MdUtil.followsAllApi}", headers, CacheControl.FORCE_NETWORK)

View File

@ -29,6 +29,7 @@ class EHentaiSearchMetadata : RaisedSearchMetadata() {
var datePosted: Long? = null
var parent: String? = null
var visible: String? = null // Not a boolean
var language: String? = 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.
*/
override val supportsLatest get() = delegate.supportsLatest
/**
* 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.
*/
override val id get() = delegate.id
/**
* Default network client for doing requests.
*/

View File

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

View File

@ -158,6 +158,7 @@ class EHConfigurator(val context: Context) {
companion object {
private const val PROFILE_NAME = "TachiyomiEH App"
private const val UCONFIG_URL = "/uconfig.php"
// 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 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
get() = entry.key
/**
* 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.
*/
override val key: K get() = pair.first
/**
* 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.
*/
override val key: K = key
/**
* Returns the value of this key/value pair.
*/