Minor cleanup
(cherry picked from commit 87661eb85a54fc938defe4f5e1d046b34585f08b) # Conflicts: # app/src/main/java/eu/kanade/tachiyomi/source/LocalSource.kt
This commit is contained in:
parent
6fd79f4838
commit
c4dfbd4768
@ -12,7 +12,8 @@ data class BackupTracking(
|
|||||||
@ProtoNumber(1) var syncId: Int,
|
@ProtoNumber(1) var syncId: Int,
|
||||||
// LibraryId is not null in 1.x
|
// LibraryId is not null in 1.x
|
||||||
@ProtoNumber(2) var libraryId: Long,
|
@ProtoNumber(2) var libraryId: Long,
|
||||||
@Deprecated("Use mediaId instead", level = DeprecationLevel.WARNING) @ProtoNumber(3) var mediaIdInt: Int = 0,
|
@Deprecated("Use mediaId instead", level = DeprecationLevel.WARNING) @ProtoNumber(3)
|
||||||
|
var mediaIdInt: Int = 0,
|
||||||
// trackingUrl is called mediaUrl in 1.x
|
// trackingUrl is called mediaUrl in 1.x
|
||||||
@ProtoNumber(4) var trackingUrl: String = "",
|
@ProtoNumber(4) var trackingUrl: String = "",
|
||||||
@ProtoNumber(5) var title: String = "",
|
@ProtoNumber(5) var title: String = "",
|
||||||
|
@ -30,19 +30,21 @@ class TrackImpl : Track {
|
|||||||
|
|
||||||
override fun equals(other: Any?): Boolean {
|
override fun equals(other: Any?): Boolean {
|
||||||
if (this === other) return true
|
if (this === other) return true
|
||||||
if (other == null || javaClass != other.javaClass) return false
|
if (javaClass != other?.javaClass) return false
|
||||||
|
|
||||||
other as Track
|
other as TrackImpl
|
||||||
|
|
||||||
if (manga_id != other.manga_id) return false
|
if (manga_id != other.manga_id) return false
|
||||||
if (sync_id != other.sync_id) return false
|
if (sync_id != other.sync_id) return false
|
||||||
return media_id == other.media_id
|
if (media_id != other.media_id) return false
|
||||||
|
|
||||||
|
return true
|
||||||
}
|
}
|
||||||
|
|
||||||
override fun hashCode(): Int {
|
override fun hashCode(): Int {
|
||||||
var result = (manga_id xor manga_id.ushr(32)).toInt()
|
var result = manga_id.hashCode()
|
||||||
result = 31 * result + sync_id
|
result = 31 * result + sync_id
|
||||||
result = 31 * result + media_id.toInt()
|
result = 31 * result + media_id.hashCode()
|
||||||
return result
|
return result
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -34,11 +34,11 @@ class MangaUpdatesApi(
|
|||||||
interceptor: MangaUpdatesInterceptor,
|
interceptor: MangaUpdatesInterceptor,
|
||||||
private val client: OkHttpClient,
|
private val client: OkHttpClient,
|
||||||
) {
|
) {
|
||||||
|
private val json: Json by injectLazy()
|
||||||
|
|
||||||
private val baseUrl = "https://api.mangaupdates.com"
|
private val baseUrl = "https://api.mangaupdates.com"
|
||||||
private val contentType = "application/vnd.api+json".toMediaType()
|
private val contentType = "application/vnd.api+json".toMediaType()
|
||||||
|
|
||||||
private val json by injectLazy<Json>()
|
|
||||||
|
|
||||||
private val authClient by lazy {
|
private val authClient by lazy {
|
||||||
client.newBuilder()
|
client.newBuilder()
|
||||||
.addInterceptor(interceptor)
|
.addInterceptor(interceptor)
|
||||||
|
@ -42,19 +42,21 @@ class TrackSearch : Track {
|
|||||||
|
|
||||||
override fun equals(other: Any?): Boolean {
|
override fun equals(other: Any?): Boolean {
|
||||||
if (this === other) return true
|
if (this === other) return true
|
||||||
if (other == null || javaClass != other.javaClass) return false
|
if (javaClass != other?.javaClass) return false
|
||||||
|
|
||||||
other as Track
|
other as TrackSearch
|
||||||
|
|
||||||
if (manga_id != other.manga_id) return false
|
if (manga_id != other.manga_id) return false
|
||||||
if (sync_id != other.sync_id) return false
|
if (sync_id != other.sync_id) return false
|
||||||
return media_id == other.media_id
|
if (media_id != other.media_id) return false
|
||||||
|
|
||||||
|
return true
|
||||||
}
|
}
|
||||||
|
|
||||||
override fun hashCode(): Int {
|
override fun hashCode(): Int {
|
||||||
var result = (manga_id xor manga_id.ushr(32)).toInt()
|
var result = manga_id.hashCode()
|
||||||
result = 31 * result + sync_id
|
result = 31 * result + sync_id
|
||||||
result = 31 * result + media_id.toInt()
|
result = 31 * result + media_id.hashCode()
|
||||||
return result
|
return result
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user