Skip to content

Stream track downloads and fix cover art, year, and disc tags - #5

Merged
jasonpatrickellykrause merged 3 commits into
mainfrom
fix/download-timeouts-and-tags
Nov 16, 2026
Merged

jasonpatrickellykrause merged 3 commits into
mainfrom
fix/download-timeouts-and-tags

Conversation

@jasonpatrickellykrause

Copy link
Copy Markdown
Collaborator

Stacked on #4 so this pull request's checks build and test it. Merge #4 first, then retarget this to main.

Fixes

  • Downloads timing out. GetEncryptedTrackData used the default ResponseContentRead, so the whole encrypted track was buffered before decryption started and HttpClient.Timeout (100 seconds) covered the entire download. Large FLACs on slow connections failed, and GetRawTrackStream held the track in memory twice. Downloads now use ResponseHeadersRead and the new Decryption.DecodeTrackStreamAsync. Because HttpClient.Timeout no longer covers the body, a per-read idle timeout (Downloader.ReadTimeout, 60 seconds) throws TimeoutException when the connection stalls. It is a TimeoutException rather than a cancellation, so callers that ignore cancellations still see a failure.
  • Error pages embedded as cover art. GetArtBytes only threw on 401; any other error response was returned and embedded. It now throws UnavailableArtException for any unsuccessful response or an empty art ID. Existing callers already catch it.
  • Untagged tracks. DateTime.Parse threw on Deezer's 0000-00-00 release dates before Save(). The year now falls back to the album's dates or is left out.
  • Identical tags across discs. The disc number is now written. Track count and disc count are per disc when the album's song list is complete and has disc numbers; otherwise the album total is kept as before.

Bumps the version to 1.2.4 and adds the changelog entry.

Tests

  • Async decode round trip and short reads, matching the existing sync tests.
  • A stalled stream throws TimeoutException; a cancelled token throws a cancellation, not a timeout.
  • ParseYear for valid, zero, empty, and malformed dates.

Not compiled locally; this pull request's build is the first compile.

🤖 Generated with Claude Code

- Download tracks with ResponseHeadersRead and decode asynchronously.
  HttpClient.Timeout no longer covers the whole download, so large
  FLACs on slow connections stop timing out, and the track is no longer
  held in memory twice. A per-read idle timeout (Downloader.ReadTimeout,
  60 seconds) throws TimeoutException when the connection stalls.
- GetArtBytes throws UnavailableArtException for any unsuccessful CDN
  response or an empty art ID instead of returning the error page,
  which was embedded as cover art.
- A 0000-00-00 release date no longer fails the whole tag write; the
  year falls back to the album's dates or is left out.
- Write the disc number, and per-disc track count and disc count when
  Deezer returns the full track list.
- Bump to 1.2.4.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Clears the CS1573 warnings the new method added.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Base automatically changed from ci/build-and-security-scanning to main November 16, 2026 20:43
@jasonpatrickellykrause
jasonpatrickellykrause merged commit 82bf9a6 into main Nov 16, 2026
8 of 9 checks passed
@jasonpatrickellykrause
jasonpatrickellykrause deleted the fix/download-timeouts-and-tags branch November 16, 2026 20:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant