tube/pkg/media/playlist.go
2019-06-28 22:50:59 -05:00

15 lines
237 B
Go

package media
type Playlist []*Video
func (p Playlist) Len() int {
return len(p)
}
func (p Playlist) Swap(i, j int) {
p[i], p[j] = p[j], p[i]
}
func (p Playlist) Less(i, j int) bool {
return p[i].Timestamp.After(p[j].Timestamp)
}