Skip to content

fix: Added missing display profiles#341

Merged
PartyDonut merged 1 commit into
developfrom
fix/Correctly-display-some-HDR-types
May 17, 2025
Merged

fix: Added missing display profiles#341
PartyDonut merged 1 commit into
developfrom
fix/Correctly-display-some-HDR-types

Conversation

@PartyDonut

Copy link
Copy Markdown
Collaborator

Pull Request Description

Add missing video profile types

Resolves #313

@PartyDonut PartyDonut added the bug Something isn't working label May 17, 2025
@sourcery-ai

sourcery-ai Bot commented May 17, 2025

Copy link
Copy Markdown
Contributor

Reviewer's Guide

This PR reorganizes import statements, extends the DisplayProfile enum with missing HDR10+ and Dolby Vision HLG profiles, and refactors the fromVideoStream method to use a switch expression covering all VideoRangeType cases.

Updated Class Diagram for DisplayProfile Enum

classDiagram
  class DisplayProfile {
    <<Enumeration>>
    sdr
    hdr
    hdr10
    hdr10Plus
    dolbyVision
    dolbyVisionHdr10
    dolbyVisionHlg
    hlg
    +value: String
    +getResolution(): Resolution
    +getProfile(): DisplayProfile
    +fromVideoStream(stream: VideoStreamModel): DisplayProfile
  }
  note for DisplayProfile "New enum members: hdr10Plus, dolbyVisionHlg.\nThe fromVideoStream() method logic has been updated to use a switch expression, covering more VideoRangeType cases."
Loading

Flow Diagram for Updated fromVideoStream Method Logic

flowchart TD
    A[Input: stream.videoRangeType] --> B{Switch on videoRangeType};
    B -- dto.VideoRangeType.doviwithsdr --> C[DisplayProfile.dolbyVisionHlg];
    B -- dto.VideoRangeType.doviwithhdr10 --> D[DisplayProfile.dolbyVisionHdr10];
    B -- dto.VideoRangeType.dovi --> E[DisplayProfile.dolbyVision];
    B -- dto.VideoRangeType.hlg --> F[DisplayProfile.hlg];
    B -- dto.VideoRangeType.hdr10 --> G[DisplayProfile.hdr10];
    B -- dto.VideoRangeType.doviwithhlg --> H[DisplayProfile.dolbyVisionHlg];
    B -- dto.VideoRangeType.hdr10plus --> I[DisplayProfile.hdr10Plus];
    B -- _ (default) --> J[DisplayProfile.sdr];
    C --> K[Output: DisplayProfile];
    D --> K;
    E --> K;
    F --> K;
    G --> K;
    H --> K;
    I --> K;
    J --> K;
Loading

File-Level Changes

Change Details Files
Consolidated and de-duplicated imports
  • Added top-level imports for flutter/material, collection, and flutter_riverpod
  • Removed duplicate imports moved earlier in the file
lib/util/video_properties.dart
Extended DisplayProfile enum with missing profiles
  • Added enum values hdr10Plus and dolbyVisionHlg
lib/util/video_properties.dart
Refactored fromVideoStream mapping to exhaustive switch
  • Replaced simple switch with Dart switch expression
  • Mapped new dto.VideoRangeType cases for doviwithsdr, doviwithhdr10, dovi, doviwithhlg, hdr10plus
  • Retained default fallback to SDR
lib/util/video_properties.dart

Assessment against linked issues

Issue Objective Addressed Explanation
#313 The application incorrectly displays HDR media with a VideoRangeType other than hdr10 or hlg as SDR.
#313 Specifically, DoVi with HDR10 is displayed as SDR.

Tips and commands

Interacting with Sourcery

  • Trigger a new review: Comment @sourcery-ai review on the pull request.
  • Continue discussions: Reply directly to Sourcery's review comments.
  • Generate a GitHub issue from a review comment: Ask Sourcery to create an
    issue from a review comment by replying to it. You can also reply to a
    review comment with @sourcery-ai issue to create an issue from it.
  • Generate a pull request title: Write @sourcery-ai anywhere in the pull
    request title to generate a title at any time. You can also comment
    @sourcery-ai title on the pull request to (re-)generate the title at any time.
  • Generate a pull request summary: Write @sourcery-ai summary anywhere in
    the pull request body to generate a PR summary at any time exactly where you
    want it. You can also comment @sourcery-ai summary on the pull request to
    (re-)generate the summary at any time.
  • Generate reviewer's guide: Comment @sourcery-ai guide on the pull
    request to (re-)generate the reviewer's guide at any time.
  • Resolve all Sourcery comments: Comment @sourcery-ai resolve on the
    pull request to resolve all Sourcery comments. Useful if you've already
    addressed all the comments and don't want to see them anymore.
  • Dismiss all Sourcery reviews: Comment @sourcery-ai dismiss on the pull
    request to dismiss all existing Sourcery reviews. Especially useful if you
    want to start fresh with a new review - don't forget to comment
    @sourcery-ai review to trigger a new review!

Customizing Your Experience

Access your dashboard to:

  • Enable or disable review features such as the Sourcery-generated pull request
    summary, the reviewer's guide, and others.
  • Change the review language.
  • Add, remove or edit custom review instructions.
  • Adjust other review settings.

Getting Help

@sourcery-ai sourcery-ai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Hey @PartyDonut - I've reviewed your changes and they look great!

Here's what I looked at during the review
  • 🟡 General issues: 1 issue found
  • 🟢 Review instructions: all looks good
  • 🟢 Testing: all looks good
  • 🟢 Complexity: all looks good
  • 🟢 Documentation: all looks good

Sourcery is free for open source - if you like our reviews please consider sharing them ✨
Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.

default:
return DisplayProfile.sdr;
}
return switch (stream.videoRangeType) {

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

issue: Null videoRangeType now maps to SDR instead of HLG

To preserve the old HLG mapping for null, add a case null => DisplayProfile.hlg before the other cases or adjust the default branch.

@PartyDonut PartyDonut merged commit da7ad3c into develop May 17, 2025
1 check passed
@PartyDonut PartyDonut deleted the fix/Correctly-display-some-HDR-types branch May 17, 2025 11:40
@github-project-automation github-project-automation Bot moved this to Done in Fladder May 17, 2025
Julien9969 pushed a commit to Julien9969/Fladder that referenced this pull request May 20, 2025
Co-authored-by: PartyDonut <PartyDonut@users.noreply.github.com>
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

Status: Done

Development

Successfully merging this pull request may close these issues.

🐛 Some HDR types are displayed as SDR

1 participant