mirror of
https://github.com/Suwayomi/Suwayomi-Server.git
synced 2026-07-12 15:24:33 -05:00
Add mutation to fetch the latest track data from the tracker (#920)
* Add mutation to fetch the latest track data from the tracker * Update Track.kt --------- Co-authored-by: Mitchell Syer <Syer10@users.noreply.github.com>
This commit is contained in:
@@ -187,6 +187,19 @@ object Track {
|
||||
}
|
||||
}
|
||||
|
||||
suspend fun refresh(recordId: Int) {
|
||||
val recordDb =
|
||||
transaction {
|
||||
TrackRecordTable.select { TrackRecordTable.id eq recordId }.first()
|
||||
}
|
||||
|
||||
val tracker = TrackerManager.getTracker(recordDb[TrackRecordTable.trackerId])!!
|
||||
|
||||
val track = recordDb.toTrack()
|
||||
tracker.refresh(track)
|
||||
upsertTrackRecord(track)
|
||||
}
|
||||
|
||||
suspend fun unbind(
|
||||
recordId: Int,
|
||||
deleteRemoteTrack: Boolean? = false,
|
||||
|
||||
Reference in New Issue
Block a user