fix(playlists): item writes lock the list first; one bulk pull per user; the claim on its own connection

- Every playlist item write (add, remove, move, reorder, rename; Plex remove and remove-bulk) row-locks
  the playlist before it touches an item, a move both lists in id order: remove beside reorder was a
  deadlock, and two adds of one video a unique-key 500.
- The scheduled mirror refresh re-reads dirty under that lock, so an edit made during its YouTube calls
  is not replaced by YouTube's order.
- A user's bulk pull holds a per-user advisory claim: two at once created duplicate mirrors. The manual
  sync answers 409 sync_all_busy instead of '0 synced', and like the re-pull spends its cooldown only
  on a pull that runs.
- Deleted mirrors are committed at once, not only when a later list commits.
- The claims open an unpooled connection of their own instead of a third pooled one per push.
This commit is contained in:
2026-09-27 19:42:53 +02:00
parent 52fb999af6
commit b7ce1d467c
11 changed files with 346 additions and 71 deletions
+2 -1
View File
@@ -87,7 +87,8 @@
"watch_later_undeletable": "The Watch later list can't be deleted",
"youtube_editing_off": "Enable YouTube editing in Settings first",
"quota_exceeded": "Not enough YouTube quota left today for this sync",
"sync_busy": "This playlist is already syncing with YouTube — try again when it finishes"
"sync_busy": "This playlist is already syncing with YouTube — try again when it finishes",
"sync_all_busy": "Your playlists are already syncing with YouTube — try again when it finishes"
},
"moveErrors": {
"not_in_playlist": "That video isn't in this playlist any more — it changed somewhere else",
+2 -1
View File
@@ -87,7 +87,8 @@
"watch_later_undeletable": "A „Megnézem később” lista nem törölhető",
"youtube_editing_off": "Előbb engedélyezd a YouTube-szerkesztést a Beállításokban",
"quota_exceeded": "Mára nem maradt elég YouTube-keret ehhez a szinkronhoz",
"sync_busy": "Ez a lista épp szinkronizál a YouTube-bal — próbáld újra, ha végzett"
"sync_busy": "Ez a lista épp szinkronizál a YouTube-bal — próbáld újra, ha végzett",
"sync_all_busy": "A listáid épp szinkronizálnak a YouTube-bal — próbáld újra, ha végzett"
},
"moveErrors": {
"not_in_playlist": "Ez a videó már nincs ebben a listában — időközben máshol megváltozott",