diff --git a/Model/Player/PlayerModel.swift b/Model/Player/PlayerModel.swift index f0d2b74f..c0dad52b 100644 --- a/Model/Player/PlayerModel.swift +++ b/Model/Player/PlayerModel.swift @@ -388,7 +388,7 @@ final class PlayerModel: ObservableObject { if !upgrading, !video.isLocal { resetSegments() - DispatchQueue.global(qos: .userInitiated).async { [weak self] in + DispatchQueue.main.async { [weak self] in self?.sponsorBlock.loadSegments( videoID: video.videoID, categories: Defaults[.sponsorBlockCategories] @@ -408,23 +408,19 @@ final class PlayerModel: ObservableObject { resetSegments() } - DispatchQueue.global(qos: .userInitiated).asyncAfter(deadline: .now() + 0.25) { - (withBackend ?? self.backend).playStream( - stream, - of: video, - preservingTime: preservingTime, - upgrading: upgrading - ) - } + (withBackend ?? backend).playStream( + stream, + of: video, + preservingTime: preservingTime, + upgrading: upgrading + ) DispatchQueue.main.async { self.forceBackendOnPlay = nil } if !upgrading { - DispatchQueue.global(qos: .userInitiated).asyncAfter(deadline: .now() + 0.5) { - self.updateCurrentArtwork() - } + updateCurrentArtwork() } } diff --git a/Model/SponsorBlock/SponsorBlockAPI.swift b/Model/SponsorBlock/SponsorBlockAPI.swift index 8dec2e68..971d8683 100644 --- a/Model/SponsorBlock/SponsorBlockAPI.swift +++ b/Model/SponsorBlock/SponsorBlockAPI.swift @@ -75,7 +75,7 @@ final class SponsorBlockAPI: ObservableObject { self.videoID = videoID - DispatchQueue.global(qos: .userInitiated).async { [weak self] in + DispatchQueue.main.async { [weak self] in self?.requestSegments(categories: categories, completionHandler: completionHandler) } }