Documentation ¶
Index ¶
- type History
- func (h *History) AddPlaybackAllStats(guildID, ytid string, duration float64) error
- func (h *History) AddPlaybackCountStats(guildID, ytid string) error
- func (h *History) AddPlaybackDurationStats(guildID, ytid string, duration float64) error
- func (h *History) AddTrackToHistory(guildID string, song *Song) error
- func (h *History) GetHistory(guildID string, sortBy string) ([]HistoryTrackInfo, error)
- func (h *History) GetTrackFromHistory(guildID string, trackID uint) (db.Track, error)
- type HistoryTrackInfo
- type IHistory
- type Song
- type Thumbnail
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type History ¶
type History struct{}
History manages the history of songs played in the application.
func (*History) AddPlaybackAllStats ¶
AddPlaybackStats updates all playback statistics (duration and count) for a track.
func (*History) AddPlaybackCountStats ¶
AddPlaybackCountStats updates playback count statistics for a track.
func (*History) AddPlaybackDurationStats ¶
AddPlaybackDurationStats updates playback duration statistics for a track.
func (*History) AddTrackToHistory ¶
AddTrackToHistory adds a song to the application's play history.
func (*History) GetHistory ¶
func (h *History) GetHistory(guildID string, sortBy string) ([]HistoryTrackInfo, error)
GetHistory retrieves the play history for a guild, sorted by the specified criteria.
type HistoryTrackInfo ¶
HistoryTrackInfo contains information about a history entry and its associated track.
type IHistory ¶
type IHistory interface { AddTrackToHistory(guildID string, song *Song) error AddPlaybackAllStats(guildID, ytid string, duration float64) error AddPlaybackCountStats(guildID, ytid string) error AddPlaybackDurationStats(guildID, ytid string, duration float64) error GetHistory(guildID string, sortBy string) ([]HistoryTrackInfo, error) GetTrackFromHistory(guildID string, trackID uint) (db.Track, error) }
IHistory defines the interface for managing the application's play history.
type Song ¶
type Song struct { Name string // Name of the song UserURL string // URL provided by the user DownloadURL string // URL for downloading the song Thumbnail Thumbnail // Thumbnail image for the song Duration time.Duration // Duration of the song ID string // Unique ID for the song }
Song represents a song with relevant information.