Skip to content

fix: round volume values, resolve GSettings schema warning and artwork caching#47

Merged
flexiondotorg merged 6 commits intomainfrom
fixes
Mar 25, 2026
Merged

fix: round volume values, resolve GSettings schema warning and artwork caching#47
flexiondotorg merged 6 commits intomainfrom
fixes

Conversation

@flexiondotorg
Copy link
Copy Markdown
Member

Summary

This PR fixes two issues affecting playback accuracy and system integration:

  1. Volume rounding: player log and MPRIS interface now display volume values rounded to 2 decimal places for clarity
  2. GSettings schema: added gsettings-desktop-schemas to Nix configuration to resolve GLib schema warnings when opening Electron file dialogs

Changes

  • fix(player): Round volume values to 2 decimal places in player log output
  • fix(integrations/mpris): Round MPRIS volume property to 2 decimal places
  • fix(nix): Add gsettings-desktop-schemas to devShell and FHS package environments to resolve GLib schema warnings

Testing

All existing tests pass. Changes verified to:

  • Correctly round volume values in both player logging and MPRIS D-Bus interface
  • Provide GSettings schema data required by Electron file dialogs on Linux systems

Related Issues

Closes #

- Round volume in player log output for clearer display
- Round volume in MPRIS interface getter, setter, and updateVolume
- Fixes floating-point precision issue (e.g. 0.11000000000000001
  displays as 0.11)

Signed-off-by: Martin Wimpress <code@wimpress.io>
- Add gsettings-desktop-schemas to linux.nix function args and libs list
- Export XDG_DATA_DIRS in flake.nix shellHook to include schema paths
- FHS environment automatically compiles schemas; GTK3 requires them on
  XDG_DATA_DIRS to prevent g_settings_schema_source_lookup assertion
  failure

Fixes the crash when GTK file dialogs are opened without compiled schema
database available.

Signed-off-by: Martin Wimpress <code@wimpress.io>
Copy link
Copy Markdown
Contributor

@cubic-dev-ai cubic-dev-ai bot left a comment

Choose a reason for hiding this comment

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

No issues found across 4 files

Requires human review: Modifies Nix configuration and environment variables (XDG_DATA_DIRS), which are categorized as infrastructure/config changes requiring human review.

Remove "//artifactName" comment from build.appImage object in
package.json. Electron-builder's strict schema validation rejects
unknown properties within typed sub-objects, even though the "//"
convention works at the npm top-level. This unblocks CI validation and
allows all 203 tests to pass.

Signed-off-by: Martin Wimpress <code@wimpress.io>
 #39

- Add artwork module with downloadArtwork() to cache remote HTTPS URLs
- Store artwork locally with content-addressable naming (SHA-256
  hashing)
- Emit file:// URIs from MPRIS integration (required for GNOME Shell)
- Provide local file paths to desktop notifications for display
- Implement automatic cache cleanup on app startup (7-day retention)
- Prevent unbounded cache growth in ~/.cache/sidra/artwork/

Signed-off-by: Martin Wimpress <code@wimpress.io>
Copy link
Copy Markdown
Contributor

@cubic-dev-ai cubic-dev-ai bot left a comment

Choose a reason for hiding this comment

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

2 issues found across 6 files (changes from recent commits).

Prompt for AI agents (unresolved issues)

Check if these issues are valid — if so, understand the root cause of each and fix them. If appropriate, use sub-agents to investigate and fix each issue separately.


<file name="src/artwork.ts">

<violation number="1" location="src/artwork.ts:33">
P1: Add a writable-stream error handler for artwork downloads to prevent unhandled stream errors on write failures.</violation>
</file>

<file name="src/integrations/mpris/index.ts">

<violation number="1" location="src/integrations/mpris/index.ts:280">
P2: The stale-artwork guard is not reliable when `trackId` is missing, so an older async download can overwrite the current track artwork.</violation>
</file>

Reply with feedback, questions, or to request a fix. Tag @cubic-dev-ai to re-run a review.

Add error handler for fs.createWriteStream() write errors (disk full,
permissions denied, etc.). Without a handler, write errors emit as
unhandled exceptions that crash the process. The fix logs a warning
and resolves with null, matching the existing pattern for HTTPS and
timeout errors.

Signed-off-by: Martin Wimpress <code@wimpress.io>
@flexiondotorg flexiondotorg changed the title fix: round volume values and resolve GSettings schema warning fix: round volume values, resolve GSettings schema warning and artwork caching Mar 25, 2026
Copy link
Copy Markdown
Contributor

@cubic-dev-ai cubic-dev-ai bot left a comment

Choose a reason for hiding this comment

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

1 issue found across 1 file (changes from recent commits).

Prompt for AI agents (unresolved issues)

Check if these issues are valid — if so, understand the root cause of each and fix them. If appropriate, use sub-agents to investigate and fix each issue separately.


<file name="src/artwork.ts">

<violation number="1" location="src/artwork.ts:34">
P2: Abort the HTTP request when the file stream errors; otherwise the download keeps running after the Promise has already been resolved.</violation>
</file>

Reply with feedback, questions, or to request a fix. Tag @cubic-dev-ai to re-run a review.

When file write fails (disk full, permissions, etc.), abort the HTTP
download immediately instead of continuing to stream data to a closed
file handle. Prevents bandwidth and memory waste during error
conditions.

Signed-off-by: Martin Wimpress <code@wimpress.io>
Copy link
Copy Markdown
Contributor

@cubic-dev-ai cubic-dev-ai bot left a comment

Choose a reason for hiding this comment

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

0 issues found across 1 file (changes from recent commits).

Requires human review: Refactors artwork downloading into a new shared utility with file system operations and introduces a new caching mechanism, which requires human verification of potential side effects.

@flexiondotorg flexiondotorg merged commit bdf92d7 into main Mar 25, 2026
12 checks passed
@flexiondotorg flexiondotorg deleted the fixes branch March 25, 2026 16:15
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