mirror of
https://github.com/aniyomiorg/aniyomi.git
synced 2024-11-22 12:48:15 +03:00
fix(tracker): Fix tracking for enhanced services (#1355)
This commit is contained in:
parent
c2ab0db7a2
commit
97467c84d3
3 changed files with 23 additions and 20 deletions
|
@ -30,9 +30,9 @@ class RefreshAnimeTracks(
|
|||
.map { (track, service) ->
|
||||
async {
|
||||
return@async try {
|
||||
val updatedTrack = service!!.animeService.refresh(track.toDbTrack())
|
||||
insertTrack.await(updatedTrack.toDomainTrack()!!)
|
||||
syncEpisodeProgressWithTrack.await(animeId, track, service.animeService)
|
||||
val updatedTrack = service!!.animeService.refresh(track.toDbTrack()).toDomainTrack()!!
|
||||
insertTrack.await(updatedTrack)
|
||||
syncEpisodeProgressWithTrack.await(animeId, updatedTrack, service.animeService)
|
||||
null
|
||||
} catch (e: Throwable) {
|
||||
service to e
|
||||
|
|
|
@ -30,9 +30,9 @@ class RefreshMangaTracks(
|
|||
.map { (track, service) ->
|
||||
async {
|
||||
return@async try {
|
||||
val updatedTrack = service!!.mangaService.refresh(track.toDbTrack())
|
||||
insertTrack.await(updatedTrack.toDomainTrack()!!)
|
||||
syncChapterProgressWithTrack.await(mangaId, track, service.mangaService)
|
||||
val updatedTrack = service!!.mangaService.refresh(track.toDbTrack()).toDomainTrack()!!
|
||||
insertTrack.await(updatedTrack)
|
||||
syncChapterProgressWithTrack.await(mangaId, updatedTrack, service.mangaService)
|
||||
null
|
||||
} catch (e: Throwable) {
|
||||
service to e
|
||||
|
|
|
@ -132,24 +132,27 @@ class JellyfinApi(
|
|||
.awaitSuccess()
|
||||
.parseAs<ItemsDto>()
|
||||
}.items
|
||||
episodes.first {
|
||||
|
||||
episodes.firstOrNull {
|
||||
it.indexNumber!!.equalsTo(track.last_episode_seen)
|
||||
}.id
|
||||
}?.id
|
||||
}
|
||||
|
||||
val time = SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ss.SSS'Z'").format(Date())
|
||||
val postUrl = httpUrl.newBuilder().apply {
|
||||
fragment(null)
|
||||
removePathSegment(3)
|
||||
removePathSegment(2)
|
||||
addPathSegment("PlayedItems")
|
||||
addPathSegment(itemId)
|
||||
addQueryParameter("DatePlayed", time)
|
||||
}.build().toString()
|
||||
if (itemId != null) {
|
||||
val time = SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ss.SSS'Z'").format(Date())
|
||||
val postUrl = httpUrl.newBuilder().apply {
|
||||
fragment(null)
|
||||
removePathSegment(3)
|
||||
removePathSegment(2)
|
||||
addPathSegment("PlayedItems")
|
||||
addPathSegment(itemId)
|
||||
addQueryParameter("DatePlayed", time)
|
||||
}.build().toString()
|
||||
|
||||
client.newCall(
|
||||
POST(postUrl),
|
||||
).awaitSuccess()
|
||||
client.newCall(
|
||||
POST(postUrl),
|
||||
).awaitSuccess()
|
||||
}
|
||||
|
||||
return getTrackSearch(track.tracking_url)
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue