Add option to show/hide history of videos in player queue view

This commit is contained in:
Arkadiusz Fal
2022-01-02 20:36:18 +01:00
parent 9ede4b9b1f
commit 117057dd0e
4 changed files with 17 additions and 2 deletions

View File

@@ -13,6 +13,7 @@ struct PlayerQueueView: View {
@EnvironmentObject<PlayerModel> private var player
@Default(.saveHistory) private var saveHistory
@Default(.showHistoryInPlayer) private var showHistoryInPlayer
var body: some View {
List {
@@ -21,7 +22,7 @@ struct PlayerQueueView: View {
if sidebarQueue {
related
}
if saveHistory {
if saveHistory, showHistoryInPlayer {
playedPreviously
}
}

View File

@@ -66,9 +66,15 @@ final class PlayerViewController: UIViewController {
if CommentsModel.enabled {
infoViewControllers.append(infoViewController([.comments], title: "Comments"))
}
var queueSections = [NowPlayingView.ViewSection.playingNext]
if Defaults[.showHistoryInPlayer] {
queueSections.append(.playedPreviously)
}
infoViewControllers.append(contentsOf: [
infoViewController([.related], title: "Related"),
infoViewController([.playingNext, .playedPreviously], title: "Playing Next")
infoViewController(queueSections, title: "Queue")
])
playerView.customInfoViewControllers = infoViewControllers