Documentation
¶
Index ¶
- Constants
- Variables
- func Dialog(message string, confirm func(), cancel func()) *tview.Modal
- func Modal(p tview.Primitive, onCancel func(), width, height int) tview.Primitive
- type App
- type Help
- type HelpModal
- type Keybindings
- type Playlist
- type PlaylistForm
- type SelectPlaylist
- type SelectedPlaylistListener
- type Video
Constants ¶
const APP_NAME = "yt-playlists"
Variables ¶
var ( COLOR_HIGHLIGHT = tcell.NewRGBColor(45, 49, 57) COLOR_BACKGROUND = tcell.NewRGBColor(40, 44, 52) )
Functions ¶
Types ¶
type App ¶
type App struct { *tview.Application // contains filtered or unexported fields }
func (*App) CloseModal ¶
func (*App) ModalActive ¶
func (*App) SetHelpText ¶
type HelpModal ¶
type HelpModal struct {
// contains filtered or unexported fields
}
func NewHelpModal ¶
type Keybindings ¶
type Keybindings struct {
// contains filtered or unexported fields
}
type Playlist ¶
type Playlist struct {
// contains filtered or unexported fields
}
Component to display playlists
func NewPlaylists ¶
func NewPlaylists(a *App, p *controllers.PlaylistsController) *Playlist
Creates a new Playlist component
func (*Playlist) AddListener ¶
func (p *Playlist) AddListener(listener SelectedPlaylistListener)
Adds a new listener
func (*Playlist) NotifySelected ¶
func (p *Playlist) NotifySelected(playlist *youtube.Playlist)
Notifie listeners when playlist was selected
func (*Playlist) SetPlaylists ¶
func (p *Playlist) SetPlaylists()
Updates the view with updated set of playlists. The selected playlist will be displayed in green text and all the other unselected ones will be displayed in white text.
type PlaylistForm ¶
type PlaylistForm struct {
// contains filtered or unexported fields
}
Form component for creating a new playlist. Contains a input field for the name, a dropdown to choose the privacy status and a text area to fill out the description.
func NewPlaylistForm ¶
func NewPlaylistForm(app *App) *PlaylistForm
Creates a new playlist form component. Accepts an instance of the app and a function 'onSubmit' to be called when form was submitted.
func (*PlaylistForm) SetAfterSubmitFunc ¶
func (p *PlaylistForm) SetAfterSubmitFunc(afterSubmit func(error)) *PlaylistForm
func (*PlaylistForm) Submit ¶
func (p *PlaylistForm) Submit() error
Submits the form and creates the playlist with the current form data.
type SelectPlaylist ¶
type SelectPlaylist struct {
// contains filtered or unexported fields
}
func NewSelectPlaylist ¶
func NewSelectPlaylist(a *App, name string, playlists []*youtube.Playlist, selected func(*youtube.Playlist)) *SelectPlaylist
type SelectedPlaylistListener ¶
type SelectedPlaylistListener interface {
PlaylistSelected(*youtube.Playlist)
}
Listen for playlist being selected
type Video ¶
type Video struct {
// contains filtered or unexported fields
}
Component to display videos of a playlist
func NewVideos ¶
func NewVideos(a *App, controller *controllers.VideosController) *Video
Creates a new Video component
func (*Video) AddVideos ¶
Adds the selected videos from current playlist to one specified by 'playlistId'. Redraws the screen right after in case of modifications to the list of videos.
func (*Video) ClearSelectedUI ¶
func (v *Video) ClearSelectedUI()
Removes all selected videos, additionally unselects all the selected videos displayed.
func (*Video) DeleteVideos ¶
func (v *Video) DeleteVideos()
Deletes the selected videos in the current playlist, redraws the screen right after in case of modifications to the list of videos.
func (*Video) MoveVideos ¶
Moves the selected videos from current playlist to one specified by 'playlistId'. The selected videos will be removed from the current playlist and will be added to the new playlist. Redraws the screen right after in case of modifications to the list of videos.
func (*Video) OpenInBrowser ¶
func (v *Video) OpenInBrowser()
func (*Video) PlaylistSelected ¶
func (v *Video) PlaylistSelected(playlist *youtube.Playlist)
Callback when playlist was selected, implements the SelectedPlaylistListener interface.
func (*Video) ToggleSelected ¶
Toggles selection status of video in the list. Selected videos will be in green text and unselected videos will be in white text.