Skip to content

[Bug]: Saving settings blocks while Jellyfin entire audio library is indexed #832

Description

@kaio-donadelli

Before submitting

  • I searched existing issues and did not find a duplicate.
  • I removed passwords, tokens, private URLs, and other secrets from the report.

Affected area

Lidarr or another integration

Steps to reproduce

  1. Configure Jellyfin as a playback integration in Aurral.

  2. Use a Jellyfin library with a relatively large music collection. Mine currently contains 19,579 audio items.

  3. Open any Settings page, for example Download Clients.

  4. Change an unrelated setting, such as the slskd or Deemix configuration.

  5. Save the settings.

  6. Observe that the request remains pending for a long time and eventually the UI reports:

    Failed to save settings: The operation was aborted.

  7. Reload the Settings page.

The changed setting is often already saved after reloading, even though the UI reported that saving failed.

Expected behavior

Saving settings should return quickly.

Refreshing or indexing the Jellyfin music library should either:

  • happen asynchronously after the settings response has been returned, or
  • only run when relevant Jellyfin/playback settings actually change.

Changing an unrelated setting such as slskd or Deemix should not require re-indexing the entire Jellyfin audio library before /api/settings responds.

Actual behavior

POST /api/settings saves the settings, but then waits for Jellyfin library indexing before sending the HTTP response.

With my library, this takes around 75–90 seconds, causing the frontend request to eventually abort even though the settings were already written.

This makes other integrations appear to have connectivity problems when they are actually working correctly.

Impact

Causes a major failure or frequent errors

Aurral version or image tag

latest (2.8.0 f3e33fa)

Environment

Docker on Unraid

Logs or stack traces

When saving settings, the frontend eventually reports:

Failed to save settings: The operation was aborted.


Direct testing showed that the delay is caused by Jellyfin library enumeration:

docker exec -i aurral node --input-type=module - <<'JS'
import { dbOps } from "/app/backend/db/helpers/index.js";
import { JellyfinClient } from "/app/backend/services/jellyfin.js";

const j = dbOps.getSettings().integrations.jellyfin;

for (const url of [j.url, "http://Jellyfin:8096"]) {
  const c = new JellyfinClient(url, j.apiKey, j.userId);

  console.log("\nTesting:", url);

  console.time("ping");
  try {
    await c.ping();
    console.timeEnd("ping");

    console.time("audio");
    const items = await c.getAudioItems();
    console.timeEnd("audio");

    console.log("Tracks:", items.length);
  } catch (e) {
    console.log("ERROR:", e.message);
  }
}
JS

Testing: http://jellyfin:8096
ping: 68.734ms
audio: 1:28.488 (m:ss.mmm)
Tracks: 19579

Testing: http://Jellyfin:8096
ping: 5.571ms
audio: 1:14.624 (m:ss.mmm)
Tracks: 19579

---

Other integration calls are fast:

slskd /api/v0/application: 200 in 49 ms
slskd /api/v0/options: 200 in 139 ms
Aurral slskd testDownloadClient(): ~173 ms
Lidarr getRootFolders(): ~162 ms

Screenshots or supporting files

No response

Workaround

A temporary workaround is to stop awaiting the Jellyfin playlist/library refresh in the settings POST handler.

In backend/routes/settings/handlers/general.js, changing:

await playlistManager.ensureSmartPlaylists();

to a non-blocking call:

playlistManager.ensureSmartPlaylists().catch((error) => {
  logger.warn("settings", "Failed to initialize playback playlists:", {
    message: error.message,
  });
});

allows the settings request to return without waiting for the full Jellyfin audio-library scan.

This is only a local container modification and will be lost when the image is recreated or updated.

Activity

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

Metadata

Metadata

Assignees

Labels

bugSomething is broken or behaving incorrectly.releasedIncluded in a stable release.

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions