mirror of
https://github.com/yattee/yattee.git
synced 2024-12-14 14:20:32 +05:30
Add playlists actions to related view
This commit is contained in:
parent
b6a157eda9
commit
72ec6094bc
@ -10,6 +10,8 @@ struct PlayerQueueView: View {
|
|||||||
var watches: FetchedResults<Watch>
|
var watches: FetchedResults<Watch>
|
||||||
|
|
||||||
@EnvironmentObject<AccountsModel> private var accounts
|
@EnvironmentObject<AccountsModel> private var accounts
|
||||||
|
@EnvironmentObject<NavigationModel> private var navigation
|
||||||
|
@EnvironmentObject<PlaylistsModel> private var playlists
|
||||||
@EnvironmentObject<PlayerModel> private var player
|
@EnvironmentObject<PlayerModel> private var player
|
||||||
|
|
||||||
@Default(.saveHistory) private var saveHistory
|
@Default(.saveHistory) private var saveHistory
|
||||||
@ -105,6 +107,24 @@ struct PlayerQueueView: View {
|
|||||||
} label: {
|
} label: {
|
||||||
Label("Play Last", systemImage: "text.append")
|
Label("Play Last", systemImage: "text.append")
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if accounts.app.supportsUserPlaylists && accounts.signedIn {
|
||||||
|
Section {
|
||||||
|
Button {
|
||||||
|
navigation.presentAddToPlaylist(video)
|
||||||
|
} label: {
|
||||||
|
Label("Add to playlist...", systemImage: "text.badge.plus")
|
||||||
|
}
|
||||||
|
|
||||||
|
if let playlist = playlists.lastUsed {
|
||||||
|
Button {
|
||||||
|
playlists.addVideo(playlistID: playlist.id, videoID: video.videoID, navigation: navigation)
|
||||||
|
} label: {
|
||||||
|
Label("Add to \(playlist.title)", systemImage: "text.badge.star")
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user