Fix updating remote status, allow editing MdList tracking
This commit is contained in:
parent
e62de734aa
commit
84a1da2952
@ -48,7 +48,6 @@ class MdList(private val context: Context, id: Int) : TrackService(id) {
|
|||||||
override suspend fun add(track: Track): Track = update(track)
|
override suspend fun add(track: Track): Track = update(track)
|
||||||
|
|
||||||
override suspend fun update(track: Track): Track {
|
override suspend fun update(track: Track): Track {
|
||||||
throw Exception("Mangadex api is read-only")
|
|
||||||
return withIOContext {
|
return withIOContext {
|
||||||
val mdex = mdex ?: throw MangaDexNotFoundException()
|
val mdex = mdex ?: throw MangaDexNotFoundException()
|
||||||
|
|
||||||
@ -58,11 +57,12 @@ class MdList(private val context: Context, id: Int) : TrackService(id) {
|
|||||||
// this updates the follow status in the metadata
|
// this updates the follow status in the metadata
|
||||||
// allow follow status to update
|
// allow follow status to update
|
||||||
if (remoteTrack.status != followStatus.int) {
|
if (remoteTrack.status != followStatus.int) {
|
||||||
mdex.updateFollowStatus(MdUtil.getMangaId(track.tracking_url), followStatus)
|
if (mdex.updateFollowStatus(MdUtil.getMangaId(track.tracking_url), followStatus)) {
|
||||||
remoteTrack.status = followStatus.int
|
remoteTrack.status = followStatus.int
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
if (track.score.toInt() > 0) {
|
/*if (track.score.toInt() > 0) {
|
||||||
mdex.updateRating(track)
|
mdex.updateRating(track)
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -84,7 +84,7 @@ class MdList(private val context: Context, id: Int) : TrackService(id) {
|
|||||||
} else if (track.last_chapter_read != 0) {
|
} else if (track.last_chapter_read != 0) {
|
||||||
// When followStatus has been changed to unfollowed 0 out read chapters since dex does
|
// When followStatus has been changed to unfollowed 0 out read chapters since dex does
|
||||||
track.last_chapter_read = 0
|
track.last_chapter_read = 0
|
||||||
}
|
}*/
|
||||||
track
|
track
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -78,5 +78,5 @@ data class AuthorAttributes(
|
|||||||
|
|
||||||
@Serializable
|
@Serializable
|
||||||
data class UpdateReadingStatus(
|
data class UpdateReadingStatus(
|
||||||
val id: String?
|
val status: String?
|
||||||
)
|
)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user