Skip to content

Fix "Lowest Quality" Option Selects "Highest Quality" Instead of 144p#779

Merged
Tyrrrz merged 2 commits intomasterfrom
copilot/investigate-issue-729
Feb 12, 2026
Merged

Fix "Lowest Quality" Option Selects "Highest Quality" Instead of 144p#779
Tyrrrz merged 2 commits intomasterfrom
copilot/investigate-issue-729

Conversation

Copy link
Contributor

Copilot AI commented Feb 12, 2026

Summary

Fixed issue #759 where selecting "Lowest Quality" option was downloading the highest quality (2160p) instead of the lowest (144p).

Closes #759

Bug Description

When users selected "Lowest Quality" preference for video downloads, the application incorrectly downloaded the highest available quality (e.g., 2160p) instead of the lowest available quality (e.g., 144p).

Root Cause

In VideoDownloadPreference.cs line 43, the Lowest quality preference case was using LastOrDefault() instead of FirstOrDefault().

Since the options are ordered by o.VideoQuality in ascending order (line 19):

  • FirstOrDefault() returns the lowest quality ✓
  • LastOrDefault() returns the highest quality ✗ (bug)

Fix Applied

Changed line 43 from:

VideoQualityPreference.Lowest => orderedOptions.LastOrDefault(o =>
    o.Container == PreferredContainer
),

To:

VideoQualityPreference.Lowest => orderedOptions.FirstOrDefault(o =>
    o.Container == PreferredContainer
),

Validation

  • ✅ Build successful with no errors or warnings
  • ✅ Logic is now consistent: Lowest uses FirstOrDefault(), Highest uses LastOrDefault()
  • ✅ Security scan passed with no issues
  • ✅ Minimal one-word change fixes the bug

This fix ensures that selecting "Lowest Quality" will now correctly download the lowest available quality (e.g., 144p) instead of the highest quality (e.g., 2160p).

Original prompt

can you investigate #729?


✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.

Copilot AI changed the title [WIP] Investigate issue #729 for potential bugs Investigation: Issue #729 already resolved in v1.15.2 Feb 12, 2026
Copilot AI requested a review from Tyrrrz February 12, 2026 12:26
@Tyrrrz
Copy link
Owner

Tyrrrz commented Feb 12, 2026

@copilot my bad I meant to ask you to investigate #759 instead of #729. Can you do that issue instead? You can reuse this PR

…nstead of highest

Co-authored-by: Tyrrrz <1935960+Tyrrrz@users.noreply.github.com>
Copy link
Contributor Author

Copilot AI commented Feb 12, 2026

@copilot my bad I meant to ask you to investigate #759 instead of #729. Can you do that issue instead? You can reuse this PR

Done! Issue #759 investigated and fixed in commit d720379.

The bug was in VideoDownloadPreference.cs line 43: Lowest was using LastOrDefault() instead of FirstOrDefault(), causing it to select the highest quality instead of the lowest. Changed to FirstOrDefault() to correctly select the lowest quality option.

Warning

Firewall rules blocked me from connecting to one or more addresses (expand for details)

I tried to connect to the following addresses, but was blocked by firewall rules:

  • av-build-tel-api-v1.avaloniaui.net
    • Triggering command: /usr/share/dotnet/dotnet dotnet exec --runtimeconfig /home/REDACTED/.nuget/packages/avalonia.buildservices/0.0.31/tools/netstandard2.0/runtimeconfig.json /home/REDACTED/.nuget/packages/avalonia.buildservices/0.0.31/tools/netstandard2.0/Avalonia.BuildServices.Collector.dll (dns block)

If you need me to access, download, or install something from one of these locations, you can either:

Copilot AI changed the title Investigation: Issue #729 already resolved in v1.15.2 Fix issue #759: Lowest Quality now correctly selects lowest quality instead of highest Feb 12, 2026
@Tyrrrz Tyrrrz added the bug Something isn't working label Feb 12, 2026
@Tyrrrz Tyrrrz changed the title Fix issue #759: Lowest Quality now correctly selects lowest quality instead of highest Fix Lowest Quality incorrectly resolving to highest quality Feb 12, 2026
@Tyrrrz Tyrrrz changed the title Fix Lowest Quality incorrectly resolving to highest quality Fix "Lowest Quality" Option Selects "Highest Quality" Instead of 144p Feb 12, 2026
@Tyrrrz Tyrrrz marked this pull request as ready for review February 12, 2026 17:11
Copilot AI review requested due to automatic review settings February 12, 2026 17:11
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Fixes issue #759 where selecting the “Lowest quality” video preference incorrectly selected the highest available quality.

Changes:

  • Adjusted VideoQualityPreference.Lowest selection logic to use the first ordered option rather than the last.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment on lines +43 to 45
VideoQualityPreference.Lowest => orderedOptions.FirstOrDefault(o =>
o.Container == PreferredContainer
),
Copy link

Copilot AI Feb 12, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

orderedOptions is built from options.OrderBy(o => o.VideoQuality), and audio-only options have VideoQuality == null (see VideoDownloadOption.VideoQuality), which will sort first. Switching Lowest to FirstOrDefault can therefore select an audio-only option that shares the same container (e.g., Container.Mp4 has an audio-only option), resulting in downloading audio-only instead of the lowest video quality. Consider filtering out audio-only options here (e.g., require !o.IsAudioOnly / o.VideoQuality is not null) when PreferredContainer.IsAudioOnly is false, so Lowest picks the lowest video stream option for that container.

Copilot uses AI. Check for mistakes.
@Tyrrrz Tyrrrz merged commit 5ebb2c9 into master Feb 12, 2026
24 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

"Lowest Quality" Option Selects "Highest Quality" Instead of 144p

2 participants

Comments