mirror of
https://github.com/yattee/yattee.git
synced 2024-11-10 00:08:21 +00:00
Add toggle for dislikes
This commit is contained in:
parent
b6a7f3886d
commit
180bace38c
@ -226,6 +226,10 @@ final class PlayerModel: ObservableObject {
|
||||
}
|
||||
}
|
||||
|
||||
guard Defaults[.enableReturnYouTubeDislike] else {
|
||||
return
|
||||
}
|
||||
|
||||
self?.returnYouTubeDislike.loadDislikes(videoID: video.videoID) { [weak self] dislikes in
|
||||
self?.currentItem?.video?.dislikes = dislikes
|
||||
}
|
||||
|
@ -23,6 +23,8 @@ extension Defaults.Keys {
|
||||
static let sponsorBlockInstance = Key<String>("sponsorBlockInstance", default: "https://sponsor.ajay.app")
|
||||
static let sponsorBlockCategories = Key<Set<String>>("sponsorBlockCategories", default: Set(SponsorBlockAPI.categories))
|
||||
|
||||
static let enableReturnYouTubeDislike = Key<Bool>("enableReturnYouTubeDislike", default: false)
|
||||
|
||||
static let favorites = Key<[FavoriteItem]>("favorites", default: [
|
||||
.init(section: .trending("US", "default")),
|
||||
.init(section: .trending("GB", "default")),
|
||||
|
@ -27,6 +27,8 @@ struct PlayerSettings: View {
|
||||
@Default(.closePiPAndOpenPlayerOnEnteringForeground) private var closePiPAndOpenPlayerOnEnteringForeground
|
||||
#endif
|
||||
|
||||
@Default(.enableReturnYouTubeDislike) private var enableReturnYouTubeDislike
|
||||
|
||||
#if os(iOS)
|
||||
private var idiom: UIUserInterfaceIdiom {
|
||||
UIDevice.current.userInterfaceIdiom
|
||||
@ -82,6 +84,7 @@ struct PlayerSettings: View {
|
||||
|
||||
keywordsToggle
|
||||
showHistoryToggle
|
||||
returnYouTubeDislikeToggle
|
||||
}
|
||||
|
||||
Section(header: SettingsHeader(text: "Picture in Picture")) {
|
||||
@ -194,6 +197,10 @@ struct PlayerSettings: View {
|
||||
Toggle("Show history", isOn: $showHistory)
|
||||
}
|
||||
|
||||
private var returnYouTubeDislikeToggle: some View {
|
||||
Toggle("Enable Return YouTube Dislike", isOn: $enableReturnYouTubeDislike)
|
||||
}
|
||||
|
||||
private var pauseOnHidingPlayerToggle: some View {
|
||||
Toggle("Pause when player is closed", isOn: $pauseOnHidingPlayer)
|
||||
}
|
||||
|
@ -179,7 +179,7 @@ struct SettingsView: View {
|
||||
case .browsing:
|
||||
return 350
|
||||
case .player:
|
||||
return 450
|
||||
return 470
|
||||
case .history:
|
||||
return 480
|
||||
case .sponsorBlock:
|
||||
|
@ -23,6 +23,8 @@ import SwiftUI
|
||||
@EnvironmentObject<PlayerModel> private var player
|
||||
|
||||
func makeNSView(context _: Context) -> some NSView {
|
||||
player.mpvBackend.client = client
|
||||
|
||||
client.layer = layer
|
||||
layer.client = client
|
||||
|
||||
@ -31,8 +33,6 @@ import SwiftUI
|
||||
view.layer = client.layer
|
||||
view.wantsLayer = true
|
||||
|
||||
player.mpvBackend.client = client
|
||||
|
||||
return view
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user