Skip to content

Commit 2c215fa

Browse files
committed
i swear to god i hate MainActor
1 parent 518b8e6 commit 2c215fa

File tree

1 file changed

+12
-8
lines changed

1 file changed

+12
-8
lines changed

Luna/Tracking/Progress/ProgressManager.swift

Lines changed: 12 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -163,7 +163,9 @@ final class ProgressManager {
163163
debouncedSave()
164164

165165
let progress = min(currentTime / totalDuration, 1.0)
166-
ProgressSyncManager.shared.pushMovieProgress(tmdbId: movieId, title: title, progress: progress)
166+
Task { @MainActor in
167+
ProgressSyncManager.shared.pushMovieProgress(tmdbId: movieId, title: title, progress: progress)
168+
}
167169
}
168170

169171
func getMovieProgress(movieId: Int, title: String) -> Double {
@@ -249,13 +251,15 @@ final class ProgressManager {
249251
debouncedSave()
250252

251253
let progress = min(currentTime / totalDuration, 1.0)
252-
ProgressSyncManager.shared.pushEpisodeProgress(
253-
showId: showId,
254-
showTitle: showTitle,
255-
seasonNumber: seasonNumber,
256-
episodeNumber: episodeNumber,
257-
progress: progress
258-
)
254+
Task { @MainActor in
255+
ProgressSyncManager.shared.pushEpisodeProgress(
256+
showId: showId,
257+
showTitle: showTitle,
258+
seasonNumber: seasonNumber,
259+
episodeNumber: episodeNumber,
260+
progress: progress
261+
)
262+
}
259263
}
260264

261265
func getEpisodeProgress(showId: Int, seasonNumber: Int, episodeNumber: Int) -> Double {

0 commit comments

Comments
 (0)