diff --git a/songqueue.go b/songqueue.go index 67db542..cc773c1 100644 --- a/songqueue.go +++ b/songqueue.go @@ -30,6 +30,12 @@ func (q *SongQueue) AddSong(s Song) error { beforeLen := q.Len() q.queue = append(q.queue, s) if len(q.queue) == beforeLen+1 { + + // Caching as added to queue + if dj.conf.Cache.Enabled && c.GetCurrentTotalFileSize() > (dj.conf.Cache.MaximumSize*1048576) { + s.Download() + } + return nil } return errors.New("Could not add Song to the SongQueue.")