Item lists don't update when a move finishes #1

Closed
opened 2026-11-06 16:02:29 +01:00 by Claude · 1 comment

What happens

After a move completes, the item still shows in the source server's list and doesn't appear in the destination's list until the page is refreshed. Even after a refresh it can take a few minutes.

Seen on the first real move (U1 → X1, started from X1, v0.1.1).

Why

There are two separate causes:

  1. The UI never reloads after a job. ui/src/lib/Library.svelte fetches a library's items only when the library or search text changes. It doesn't listen for job updates, even though Jobs.svelte already gets them from /api/events. The destination's Jellyfin had already indexed the item when the job finished (the runner confirms this before TargetScanned), so a reload at that moment would show it.
  2. The source Jellyfin is slow to drop the item. It only removes the old item after its own rescan of the trashed folder, which waits for LibraryMonitorDelay (60 s by default). A reload straight after the move can still show the item on the source.

Suggested fix

  • When a job reaches Done, reload the item lists for both servers.
  • Reload the source list once more about 90 s later, or keep polling it briefly until the item is gone.
  • Optionally, hide or mark the moved item on the source straight away, so it can't be picked again while Jellyfin catches up.

Done when

After a move, the item appears on the destination without a manual refresh, and disappears from the source within about two minutes.

## What happens After a move completes, the item still shows in the source server's list and doesn't appear in the destination's list until the page is refreshed. Even after a refresh it can take a few minutes. Seen on the first real move (U1 → X1, started from X1, v0.1.1). ## Why There are two separate causes: 1. **The UI never reloads after a job.** `ui/src/lib/Library.svelte` fetches a library's items only when the library or search text changes. It doesn't listen for job updates, even though `Jobs.svelte` already gets them from `/api/events`. The destination's Jellyfin had already indexed the item when the job finished (the runner confirms this before `TargetScanned`), so a reload at that moment would show it. 2. **The source Jellyfin is slow to drop the item.** It only removes the old item after its own rescan of the trashed folder, which waits for `LibraryMonitorDelay` (60 s by default). A reload straight after the move can still show the item on the source. ## Suggested fix - When a job reaches `Done`, reload the item lists for both servers. - Reload the source list once more about 90 s later, or keep polling it briefly until the item is gone. - Optionally, hide or mark the moved item on the source straight away, so it can't be picked again while Jellyfin catches up. ## Done when After a move, the item appears on the destination without a manual refresh, and disappears from the source within about two minutes.
Claude Bot added this to the v0.2.0 milestone 2026-11-06 16:04:59 +01:00
Claude Bot added the Kind/Bug
Reviewed
Confirmed
1
Priority
Medium
3
labels 2026-11-06 16:05:00 +01:00

Done in 2bd4489b1a on develop, for v0.2.0.

  • Reloads on its own: the Library now follows moves on both servers through an app-wide move store (live events for local jobs, polling for the peer's). When a move finishes, the list reloads, so the item appears on the destination without a manual refresh.
  • Source side: an item shows "Moving to …" while it moves and "Moved to …" until the source's Jellyfin drops it after its delayed rescan. The list checks again every 20 s for up to 4 minutes. Moved items aren't counted in totals or shown as "measuring…".
  • Seasons: open season lists reload too, and moving or moved seasons are marked.
  • Sizes: cached folder sizes are forgotten when a move touches the folder, so a show's size is right straight after a season moves.
  • Behaviour change: starting a move now keeps you in the Library rather than switching to Moves.
  • Also fixed: an empty list after switching servers when both libraries share an ID.
Done in 2bd4489b1acbbbba87d49c5a6dda8322f7f5a25d on `develop`, for v0.2.0. - **Reloads on its own:** the Library now follows moves on both servers through an app-wide move store (live events for local jobs, polling for the peer's). When a move finishes, the list reloads, so the item appears on the destination without a manual refresh. - **Source side:** an item shows "Moving to …" while it moves and "Moved to …" until the source's Jellyfin drops it after its delayed rescan. The list checks again every 20 s for up to 4 minutes. Moved items aren't counted in totals or shown as "measuring…". - **Seasons:** open season lists reload too, and moving or moved seasons are marked. - **Sizes:** cached folder sizes are forgotten when a move touches the folder, so a show's size is right straight after a season moves. - **Behaviour change:** starting a move now keeps you in the Library rather than switching to Moves. - **Also fixed:** an empty list after switching servers when both libraries share an ID.
Claude Bot closed this issue 2026-11-06 18:22:40 +01:00
Sign in to join this conversation.