harden search parsing and qobuz refresh validation

This commit is contained in:
2026-04-21 19:04:33 +02:00
parent de4e561377
commit c67be72869
5 changed files with 86 additions and 2 deletions

View File

@@ -147,6 +147,9 @@ func (d *Downloader) FileDeezerEncrypted(ctx context.Context, sourceURL, outputP
if resp.ContentLength > 0 && totalRead != resp.ContentLength {
return io.ErrUnexpectedEOF
}
if err = out.Sync(); err != nil {
return err
}
success = true
return nil
}
@@ -229,6 +232,9 @@ func (d *Downloader) file(ctx context.Context, sourceURL, outputPath string, all
if resp.ContentLength > 0 && totalWritten != resp.ContentLength {
return io.ErrUnexpectedEOF
}
if err = out.Sync(); err != nil {
return err
}
} else {
written, copyErr := io.Copy(out, reader)
if copyErr != nil {