Skip to content

fix(post-process): name each corrupt file and its decoder error in the failure message - #258

Merged
chodeus merged 3 commits into
mainfrom
fix/corruption-failure-message
Nov 17, 2026
Merged

chodeus merged 3 commits into
mainfrom
fix/corruption-failure-message

Conversation

@chodeus

@chodeus chodeus commented Nov 17, 2026 •

Copy link
Copy Markdown
Owner
  • The Lidarr failure message (History, Blocklist, notifications) named only the first reason, as ffmpeg's follow-on lines. It now lists each failed file by name with the decoder's own error, up to 1,000 characters (Pushover's limit is 1,024, Discord's 2,000), then "+N more (see the Lidarr log)".
  • File names keep their disc folder (CD2/01 ...). Slskd strikes said "(unmapped)" when the file did not match its transfer; the name now comes from the file on disk.
  • Wording follows what ffmpeg did: "Audio won't decode", "Audio has decode errors" (it decoded to the end), or "Damaged tag or cover art". m4a/ALAC lines lose their [mov,mp4,...] prefix; old ffmpeg's "Error while decoding stream" is a follow-on line.
  • The shared corruption handler logs every failed file at Warn; the Debug log keeps the first 20 lines of ffmpeg stderr.

Summary by CodeRabbit

  • Bug Fixes
    • Corruption reports now include readable file labels and clear reasons, including for files without a mapped transfer.
    • FFmpeg errors are better distinguished between audio decoding and tag or cover-art issues. Failure messages are limited in length, with a count of files omitted.
    • Logging captures every corrupted file, while detailed error excerpts are kept concise.

…e failure message

- The Lidarr message listed only the first reason, as ~350 characters of ffmpeg's
  follow-on lines; it now names each failed file with the decoder's own error, up to
  1,000 characters (Pushover's limit is 1,024, Discord's 2,000), then "+N more".
- Files keep their disc folder (CD2/01 ...). Slskd strikes showed "(unmapped)" whenever
  the file did not match its transfer; the name now comes from the file on disk.
- A file ffmpeg stopped on only for a damaged tag or cover art says so, not
  "Audio won't decode".
- The first 20 lines of ffmpeg stderr go to the Debug log; the Slskd per-file line is a
  Warn like the store clients'.
…upt file once

- m4a/ALAC lines lose their "[mov,mp4,... @ 0x...]" prefix like the others.
- "Audio has decode errors" when ffmpeg decoded to the end; cover-art decoder lines
  (mjpeg, png, ...) read as "Damaged tag or cover art", not as the audio's failure.
- The message lists files by name, and its cut never splits a surrogate pair.
- The shared handler logs every failed file, so "+N more (see the Lidarr log)" holds
  for each client; one spelling for a missing reason.
@chodeus chodeus added the release:patch Merge to main → patch release label Nov 17, 2026
@coderabbitai

coderabbitai Bot commented Nov 17, 2026 •

Copy link
Copy Markdown

Explain Change →

No actionable comments were generated in the recent review.

Walkthrough

The change updates FFmpeg error classification and logging, adds shared formatting for corruption reports and file labels, and carries those labels through post-processing and Soulseek handling. Tests cover report limits, decode reasons, and mapped and unmapped strikes.

Changes: Corruption reporting and diagnostics

Layer / File(s) Summary
FFmpeg failure interpretation
src/Sleezer/Core/PostProcessing/FfmpegErrorFormatter.cs, src/Sleezer/Core/PostProcessing/CorruptionScanner.cs, tests/Sleezer.Tests/FfmpegErrorFormatterTests.cs
FFmpeg errors are normalized and deduplicated by line. The formatter selects primary errors, classifies decode failures, and limits stderr excerpts to 20 lines. The scanner uses the formatter for failure reasons and log excerpts. Tests cover error selection, classification, and excerpt limits.
Shared failure reports and post-processing
src/Sleezer/Core/PostProcessing/CorruptionReport.cs, src/Sleezer/Core/PostProcessing/CorruptionFailureHandler.cs, src/Sleezer/Core/PostProcessing/PostProcessRunner.cs, tests/Sleezer.Tests/Corruption*Tests.cs, tests/Sleezer.Tests/Fakes/LidarrServiceFakes.cs, tests/Sleezer.Tests/AlbumWideFailureTests.cs, tests/Sleezer.Tests/Sleezer.Tests.csproj
CorruptionReport sorts and formats file descriptions within a 1,000-character limit, and provides relative file labels. The failure handler logs each strike and uses the shared report in the failure event. Post-processing supplies relative labels. Tests cover report formatting and per-strike logging; shared test fakes replace local event-capture code.
Soulseek strike file labels
src/Sleezer/Download/Clients/Soulseek/SlskdCorruptionHandler.cs, src/Sleezer/Download/Clients/Soulseek/SlskdDownloadManager.cs, tests/Sleezer.Tests/SlskdCorruptionMessageTests.cs, tests/Sleezer.Tests/SlskdRemovedGrabTests.cs
SlskdCorruptionStrike now requires a file label, which the download manager derives relative to the download folder. The handler passes that label to the shared failure handler and no longer logs individual strikes. Tests cover mapped and unmapped strikes and use the shared log-capture helper.

Estimated code review effort: 3 (Moderate) | ~25 minutes

Possibly related PRs

  • chodeus/sleezer#238: Changes Slskd remote-path mapping used to associate corrupt files with transfers, which is also involved in constructing file labels for corruption reports.
Merge Risk: Minimal · up to 552a4

This change makes corruption-failure messages name each failed file with its decoder error, bounded to 1,000 characters, and logs every failed file. No concrete merge-blocking risk was found. The change only affects diagnostic messages and logs.

Pre-merge checks: Passed 4

Check name Status Explanation
Description Check Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check Passed The title names the main change: the Lidarr failure message now lists each corrupt file with its decoder error. The raw summary confirms this, since CorruptionReport.FailureMessage sorts strikes, list…
Linked Issues check Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check Passed Check skipped because no linked issues were found for this pull request.
Full details: Title check

Explanation

The title names the main change: the Lidarr failure message now lists each corrupt file with its decoder error. The raw summary confirms this, since CorruptionReport.FailureMessage sorts strikes, lists each file description up to a 1,000-character limit, and reports omitted files. The title is specific and matches the changeset. The conventional-commit prefix 'fix(post-process)' matches the PostProcessing area touched by the change.

Finishing Touches

Generate unit tests (beta)

  • Commit to this branch
  • Create a new PR
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts
Recent review info

Run configuration

Commits

Reviewing files that changed from the base of the PR and between 31dd585 and 552a41e.

Files selected for processing: 15

  • src/Sleezer/Core/PostProcessing/CorruptionFailureHandler.cs
  • src/Sleezer/Core/PostProcessing/CorruptionReport.cs
  • src/Sleezer/Core/PostProcessing/CorruptionScanner.cs
  • src/Sleezer/Core/PostProcessing/FfmpegErrorFormatter.cs
  • src/Sleezer/Core/PostProcessing/PostProcessRunner.cs
  • src/Sleezer/Download/Clients/Soulseek/SlskdCorruptionHandler.cs
  • src/Sleezer/Download/Clients/Soulseek/SlskdDownloadManager.cs
  • tests/Sleezer.Tests/AlbumWideFailureTests.cs
  • tests/Sleezer.Tests/CorruptionFailureHandlerTests.cs
  • tests/Sleezer.Tests/CorruptionReportTests.cs
  • tests/Sleezer.Tests/Fakes/LidarrServiceFakes.cs
  • tests/Sleezer.Tests/FfmpegErrorFormatterTests.cs
  • tests/Sleezer.Tests/Sleezer.Tests.csproj
  • tests/Sleezer.Tests/SlskdCorruptionMessageTests.cs
  • tests/Sleezer.Tests/SlskdRemovedGrabTests.cs

Included review availability: This review used your included allowance. 0 included reviews remain after this review. Your included PR review attempts over the past 7 days set your current allowance at 1 review per hour.

@chodeus

chodeus commented Nov 17, 2026

Copy link
Copy Markdown
Owner Author

@coderabbitai full review

@chodeus
chodeus merged commit d55405e into main Nov 17, 2026
4 checks passed
@chodeus
chodeus deleted the fix/corruption-failure-message branch November 17, 2026 03:11
@coderabbitai

coderabbitai Bot commented Nov 17, 2026 •

Copy link
Copy Markdown
Action not completed

Pull request is closed.


Your included review limit is currently reached under our Fair Usage Limits Policy. Your current included review allowance is based on your included PR review attempts over the past 7 days. This review may still proceed through usage-based billing if eligible. Your next included review will be available in 50 minutes.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

release:patch Merge to main → patch release

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant