Add a fast path for original quality

This commit is contained in:
Zoe Roux 2024-01-19 17:44:14 +01:00
parent 2551d5071b
commit 750f9da9e8
No known key found for this signature in database

View File

@ -29,6 +29,13 @@ func NewDownloader() *Downloader {
}
func (d *Downloader) GetOffline(path string, quality Quality) (<-chan struct{}, string, error) {
if quality == Original {
// no need to do anything for original quality
done := make(chan struct{})
close(done)
return done, path, nil
}
key := Key{path, quality}
d.lock.Lock()
defer d.lock.Unlock()