Skip to content

Commit

Permalink
Applied PR suggestions
Browse files Browse the repository at this point in the history
  • Loading branch information
asendra committed Nov 5, 2024
1 parent fdffacd commit 3c0ab1e
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions Sources/Player/PlaybackEngine/Internal/PlayerItemLoader.swift
Original file line number Diff line number Diff line change
Expand Up @@ -50,14 +50,14 @@ final class PlayerItemLoader {

private extension PlayerItemLoader {
func load(_ mediaProduct: MediaProduct, with streamingSessionId: String) async throws -> (Metadata, Asset) {
let offlinePlaybackAllowed = offlinePlaybackPrivilegeCheck?() ?? true
if let storedMediaProduct = mediaProduct as? StoredMediaProduct, offlinePlaybackAllowed {
let offlinePlaybackAllowed = offlinePlaybackPrivilegeCheck?() ?? false
if offlinePlaybackAllowed, let storedMediaProduct = mediaProduct as? StoredMediaProduct {
return try await (metadata(of: storedMediaProduct), playerLoader.load(storedMediaProduct))
}

if let offlineEntry = try? offlineStorage?.get(key: mediaProduct.productId),
let offlinedMediaProduct = PlayableOfflinedMediaProduct(from: offlineEntry),
offlinePlaybackAllowed
if offlinePlaybackAllowed,
let offlineEntry = try? offlineStorage?.get(key: mediaProduct.productId),
let offlinedMediaProduct = PlayableOfflinedMediaProduct(from: offlineEntry)
{
return try await (metadata(of: offlinedMediaProduct), playerLoader.load(offlinedMediaProduct))
}
Expand Down

0 comments on commit 3c0ab1e

Please sign in to comment.