Fix/prevent intentional conversions from creating false quality upgrades - #1191
Open
nick2000713 wants to merge 8 commits into
Open
Fix/prevent intentional conversions from creating false quality upgrades#1191nick2000713 wants to merge 8 commits into
nick2000713 wants to merge 8 commits into
Conversation
added 8 commits
August 26, 2026 18:36
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
These fixes also came up while I was working on the Library Overhaul. During that work I noticed that lossy copies, downsampling, and the actual quality of a download were being treated like the same thing in several places. I moved these changes into their own dev compatible commits because the problem already exists on dev and the solution makes sense there as well.
The issue that started the initial investigation was an intentionally converted song being classified as upgradeable later. The Quality Profile allowed upgrades, while the output settings downsampled the downloaded file. The quality scan then looked only at the downsampled result and created a Quality Finding for the exact transformation SoulSync had been configured to perform.
This could create a loop. SoulSync could find and download a better source, downsample it again, and then report the converted result as upgradeable again. The download itself had already satisfied the Quality Profile. The lower stored quality was intentional and came from the configured output processing.
For example, a Hi Res FLAC can be downloaded at 24 bit and 96 kHz and then converted to 16 bit and 44.1 kHz because the downsampling option is enabled. SoulSync previously only saw the final stored file after that conversion. It no longer knew that the requested source quality had already been acquired.
There is a similar problem with lossy copies. When SoulSync intentionally creates an Opus or MP3 copy next to a FLAC and keeps the original, the additional file can later be treated like a normal duplicate. It is not an accidental duplicate. It is an intentional version of the same track.
What this PR changes
The quality of the downloaded source and the quality of the final stored file are now handled separately.
SoulSync records the quality that was originally acquired and the processing that happened afterwards. This includes lossy copy conversion, Hi Res downsampling, and whether the original source was replaced by the processed output.
When the original is kept, it remains the relevant file for quality evaluation. The additional lossy copy is recognized as an intentional companion version and is no longer removed by the Duplicate Cleaner as a normal duplicate.
When the original is intentionally replaced, the stored file still reports its real measured quality. The upgrade decision can also use the original acquisition quality. This only happens when SoulSync has clear provenance showing that the source was replaced by a configured processing step. A genuinely low quality download will therefore not be treated as a high quality download by mistake.
The duplicate rules are also shared in one place now. The Duplicate Cleaner and Duplicate Detector use the same decision, so they no longer disagree about cross format files.
Example with Downsample Hi Res FLAC to CD quality
A track is downloaded as FLAC at 24 bit and 96 kHz.
The enabled setting converts it to FLAC at 16 bit and 44.1 kHz.
The file on disk still correctly shows 16 bit and 44.1 kHz.
The upgrade check also knows that the acquired source was 24 bit and 96 kHz.
The track is therefore not offered as an upgrade again and no false Quality Finding is created only because SoulSync produced the configured output itself.
Settings and UI
The text in the Quality Profile settings now explains more clearly that the profile describes the quality SoulSync should acquire. Lossy Copy and downsampling describe what should be retained or generated afterwards.
This also makes it clearer why a generated lossy copy does not need its own Quality Profile. It still belongs to the same track and is an intentional output format, not a separate download with another quality target.