Skip to content
This repository has been archived by the owner on Dec 4, 2024. It is now read-only.

Commit

Permalink
fix: subtitles not being selected
Browse files Browse the repository at this point in the history
  • Loading branch information
ErrorErrorError committed Dec 28, 2023
1 parent 8d384b7 commit 27b58ce
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 13 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,6 @@ public struct MediaSelectionGroup: Hashable, Sendable {
}

public func hash(into hasher: inout Hasher) {
hasher.combine(_ref)
hasher.combine(displayName)
hasher.combine(selected)
hasher.combine(options)
Expand All @@ -59,12 +58,11 @@ public struct MediaSelectionGroup: Hashable, Sendable {
}

public static func == (lhs: Self, rhs: Self) -> Bool {
lhs._ref.isEqual(rhs._ref) &&
lhs.displayName == rhs.displayName &&
lhs.selected == rhs.selected &&
lhs.options == rhs.options &&
lhs.defaultOption == rhs.defaultOption &&
lhs.allowsEmptySelection == rhs.allowsEmptySelection
lhs.displayName == rhs.displayName &&
lhs.selected == rhs.selected &&

Check warning on line 62 in Sources/Clients/PlayerClient/Extension/AVMediaSelectionGroup+Struct.swift

View workflow job for this annotation

GitHub Actions / run-swiftformat

Indent code in accordance with the scope level. (indent)
lhs.options == rhs.options &&

Check warning on line 63 in Sources/Clients/PlayerClient/Extension/AVMediaSelectionGroup+Struct.swift

View workflow job for this annotation

GitHub Actions / run-swiftformat

Indent code in accordance with the scope level. (indent)
lhs.defaultOption == rhs.defaultOption &&

Check warning on line 64 in Sources/Clients/PlayerClient/Extension/AVMediaSelectionGroup+Struct.swift

View workflow job for this annotation

GitHub Actions / run-swiftformat

Indent code in accordance with the scope level. (indent)
lhs.allowsEmptySelection == rhs.allowsEmptySelection

Check warning on line 65 in Sources/Clients/PlayerClient/Extension/AVMediaSelectionGroup+Struct.swift

View workflow job for this annotation

GitHub Actions / run-swiftformat

Indent code in accordance with the scope level. (indent)
}
}

Expand Down Expand Up @@ -96,15 +94,14 @@ public struct MediaSelectionOption: Hashable, Sendable {
}

public func hash(into hasher: inout Hasher) {
hasher.combine(_ref)
hasher.combine(mediaType)
hasher.combine(displayName)
hasher.combine(isPlayable)
}

public static func == (lhs: Self, rhs: Self) -> Bool {
lhs._ref.isEqual(rhs._ref) &&
lhs.mediaType == rhs.mediaType &&
lhs.displayName == rhs.displayName &&
lhs.isPlayable == rhs.isPlayable
lhs.mediaType == rhs.mediaType &&
lhs.displayName == rhs.displayName &&

Check warning on line 104 in Sources/Clients/PlayerClient/Extension/AVMediaSelectionGroup+Struct.swift

View workflow job for this annotation

GitHub Actions / run-swiftformat

Indent code in accordance with the scope level. (indent)
lhs.isPlayable == rhs.isPlayable

Check warning on line 105 in Sources/Clients/PlayerClient/Extension/AVMediaSelectionGroup+Struct.swift

View workflow job for this annotation

GitHub Actions / run-swiftformat

Indent code in accordance with the scope level. (indent)
}
}
3 changes: 2 additions & 1 deletion Sources/Features/VideoPlayer/VideoPlayerFeature+View.swift
Original file line number Diff line number Diff line change
Expand Up @@ -674,7 +674,7 @@ extension VideoPlayerFeature.View {
ForEach(viewStore.state ?? [], id: \.`self`) { group in
MoreListingRow(
title: group.displayName,
selected: { $0 == group.selected || $0 == group.defaultOption },
selected: { $0 == group.selected },
items: group.options,
itemTitle: \.displayName,
noneCallback: !group.allowsEmptySelection ? nil : {
Expand All @@ -684,6 +684,7 @@ extension VideoPlayerFeature.View {
viewStore.send(.view(.didTapGroupOption(option, for: group)))
}
)
.animation(.easeInOut, value: group.selected)
}
}
}
Expand Down

0 comments on commit 27b58ce

Please sign in to comment.