@olegkoval/agent-skills 1.35.2 → 1.36.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (173) hide show
  1. package/.github/copilot-instructions.md +1 -0
  2. package/.github/prompts/music-to-plex.prompt.md +251 -0
  3. package/.kiro/steering/music-to-plex.md +250 -0
  4. package/.windsurf/rules/music-to-plex.md +249 -0
  5. package/README.md +3 -2
  6. package/adapters/claude/olko-creative/skills/music-to-plex/SKILL.md +255 -0
  7. package/adapters/claude/olko-creative/skills/music-to-plex/references/bandcamp-album-identification.md +29 -0
  8. package/adapters/claude/olko-creative/skills/music-to-plex/references/batch-import-staging.md +23 -0
  9. package/adapters/claude/olko-creative/skills/music-to-plex/references/canonical-artist-normalization.md +24 -0
  10. package/adapters/claude/olko-creative/skills/music-to-plex/references/cover-art-and-plexamp.md +22 -0
  11. package/adapters/claude/olko-creative/skills/music-to-plex/references/cover-art-repair-session.md +34 -0
  12. package/adapters/claude/olko-creative/skills/music-to-plex/references/cover-art-sourcing-session.md +23 -0
  13. package/adapters/claude/olko-creative/skills/music-to-plex/references/dj-tracklist-crate-ingest.md +184 -0
  14. package/adapters/claude/olko-creative/skills/music-to-plex/references/duplicate-torrent-handling.md +19 -0
  15. package/adapters/claude/olko-creative/skills/music-to-plex/references/fallback-audio-validation-and-nas-preflight.md +42 -0
  16. package/adapters/claude/olko-creative/skills/music-to-plex/references/gear-change-image-identification.md +35 -0
  17. package/adapters/claude/olko-creative/skills/music-to-plex/references/image-driven-identification-and-verification.md +19 -0
  18. package/adapters/claude/olko-creative/skills/music-to-plex/references/library-repair-folders.md +22 -0
  19. package/adapters/claude/olko-creative/skills/music-to-plex/references/malformed-flac-fallbacks.md +11 -0
  20. package/adapters/claude/olko-creative/skills/music-to-plex/references/manual-fallback-transfer-and-plex-verification.md +39 -0
  21. package/adapters/claude/olko-creative/skills/music-to-plex/references/mtp-bot-bulk-state-safety.md +21 -0
  22. package/adapters/claude/olko-creative/skills/music-to-plex/references/mtp-subprocess-wrapper.md +13 -0
  23. package/adapters/claude/olko-creative/skills/music-to-plex/references/music-note-blurb-order.md +38 -0
  24. package/adapters/claude/olko-creative/skills/music-to-plex/references/nas-import-and-refresh.md +16 -0
  25. package/adapters/claude/olko-creative/skills/music-to-plex/references/nas-library-layout-and-write-preflight.md +31 -0
  26. package/adapters/claude/olko-creative/skills/music-to-plex/references/nas-permissions-and-plex-traversal.md +26 -0
  27. package/adapters/claude/olko-creative/skills/music-to-plex/references/nas-routing-and-refresh.md +22 -0
  28. package/adapters/claude/olko-creative/skills/music-to-plex/references/no-result-album-fallback.md +28 -0
  29. package/adapters/claude/olko-creative/skills/music-to-plex/references/per-track-album-art-split.md +12 -0
  30. package/adapters/claude/olko-creative/skills/music-to-plex/references/plex-playlist-append-and-verify.md +18 -0
  31. package/adapters/claude/olko-creative/skills/music-to-plex/references/plex-playlist-creation.md +21 -0
  32. package/adapters/claude/olko-creative/skills/music-to-plex/references/plex-token-source.md +20 -0
  33. package/adapters/claude/olko-creative/skills/music-to-plex/references/plex-visibility-check.md +28 -0
  34. package/adapters/claude/olko-creative/skills/music-to-plex/references/practice-crate-playlist.md +18 -0
  35. package/adapters/claude/olko-creative/skills/music-to-plex/references/session-2026-06-17-synology-probe.md +13 -0
  36. package/adapters/claude/olko-creative/skills/music-to-plex/references/torrent-stall-fallback.md +62 -0
  37. package/adapters/claude/olko-creative/skills/music-to-plex/references/verification-and-pitfalls.md +17 -0
  38. package/adapters/claude/olko-creative/skills/music-to-plex/references/youtube-403-fallbacks.md +17 -0
  39. package/adapters/claude/olko-creative/skills/music-to-plex/references/youtube-full-album-fallback.md +34 -0
  40. package/adapters/claude/olko-creative/skills/music-to-plex/references/youtube-lineage-playlist-fallback.md +33 -0
  41. package/adapters/claude/olko-creative/skills/music-to-plex/references/youtube-playlist-import.md +50 -0
  42. package/adapters/claude/olko-creative/skills/music-to-plex/references/youtube-track-resolution-heuristics.md +23 -0
  43. package/adapters/claude/olko-creative/skills/music-to-plex/references/zero-track-playlist-recovery.md +21 -0
  44. package/adapters/codex/olko-creative/README.md +1 -0
  45. package/adapters/cursor/olko-creative/skills/music-to-plex/SKILL.md +255 -0
  46. package/adapters/cursor/olko-creative/skills/music-to-plex/references/bandcamp-album-identification.md +29 -0
  47. package/adapters/cursor/olko-creative/skills/music-to-plex/references/batch-import-staging.md +23 -0
  48. package/adapters/cursor/olko-creative/skills/music-to-plex/references/canonical-artist-normalization.md +24 -0
  49. package/adapters/cursor/olko-creative/skills/music-to-plex/references/cover-art-and-plexamp.md +22 -0
  50. package/adapters/cursor/olko-creative/skills/music-to-plex/references/cover-art-repair-session.md +34 -0
  51. package/adapters/cursor/olko-creative/skills/music-to-plex/references/cover-art-sourcing-session.md +23 -0
  52. package/adapters/cursor/olko-creative/skills/music-to-plex/references/dj-tracklist-crate-ingest.md +184 -0
  53. package/adapters/cursor/olko-creative/skills/music-to-plex/references/duplicate-torrent-handling.md +19 -0
  54. package/adapters/cursor/olko-creative/skills/music-to-plex/references/fallback-audio-validation-and-nas-preflight.md +42 -0
  55. package/adapters/cursor/olko-creative/skills/music-to-plex/references/gear-change-image-identification.md +35 -0
  56. package/adapters/cursor/olko-creative/skills/music-to-plex/references/image-driven-identification-and-verification.md +19 -0
  57. package/adapters/cursor/olko-creative/skills/music-to-plex/references/library-repair-folders.md +22 -0
  58. package/adapters/cursor/olko-creative/skills/music-to-plex/references/malformed-flac-fallbacks.md +11 -0
  59. package/adapters/cursor/olko-creative/skills/music-to-plex/references/manual-fallback-transfer-and-plex-verification.md +39 -0
  60. package/adapters/cursor/olko-creative/skills/music-to-plex/references/mtp-bot-bulk-state-safety.md +21 -0
  61. package/adapters/cursor/olko-creative/skills/music-to-plex/references/mtp-subprocess-wrapper.md +13 -0
  62. package/adapters/cursor/olko-creative/skills/music-to-plex/references/music-note-blurb-order.md +38 -0
  63. package/adapters/cursor/olko-creative/skills/music-to-plex/references/nas-import-and-refresh.md +16 -0
  64. package/adapters/cursor/olko-creative/skills/music-to-plex/references/nas-library-layout-and-write-preflight.md +31 -0
  65. package/adapters/cursor/olko-creative/skills/music-to-plex/references/nas-permissions-and-plex-traversal.md +26 -0
  66. package/adapters/cursor/olko-creative/skills/music-to-plex/references/nas-routing-and-refresh.md +22 -0
  67. package/adapters/cursor/olko-creative/skills/music-to-plex/references/no-result-album-fallback.md +28 -0
  68. package/adapters/cursor/olko-creative/skills/music-to-plex/references/per-track-album-art-split.md +12 -0
  69. package/adapters/cursor/olko-creative/skills/music-to-plex/references/plex-playlist-append-and-verify.md +18 -0
  70. package/adapters/cursor/olko-creative/skills/music-to-plex/references/plex-playlist-creation.md +21 -0
  71. package/adapters/cursor/olko-creative/skills/music-to-plex/references/plex-token-source.md +20 -0
  72. package/adapters/cursor/olko-creative/skills/music-to-plex/references/plex-visibility-check.md +28 -0
  73. package/adapters/cursor/olko-creative/skills/music-to-plex/references/practice-crate-playlist.md +18 -0
  74. package/adapters/cursor/olko-creative/skills/music-to-plex/references/session-2026-06-17-synology-probe.md +13 -0
  75. package/adapters/cursor/olko-creative/skills/music-to-plex/references/torrent-stall-fallback.md +62 -0
  76. package/adapters/cursor/olko-creative/skills/music-to-plex/references/verification-and-pitfalls.md +17 -0
  77. package/adapters/cursor/olko-creative/skills/music-to-plex/references/youtube-403-fallbacks.md +17 -0
  78. package/adapters/cursor/olko-creative/skills/music-to-plex/references/youtube-full-album-fallback.md +34 -0
  79. package/adapters/cursor/olko-creative/skills/music-to-plex/references/youtube-lineage-playlist-fallback.md +33 -0
  80. package/adapters/cursor/olko-creative/skills/music-to-plex/references/youtube-playlist-import.md +50 -0
  81. package/adapters/cursor/olko-creative/skills/music-to-plex/references/youtube-track-resolution-heuristics.md +23 -0
  82. package/adapters/cursor/olko-creative/skills/music-to-plex/references/zero-track-playlist-recovery.md +21 -0
  83. package/adapters/grok/olko-creative/skills/music-to-plex/SKILL.md +255 -0
  84. package/adapters/grok/olko-creative/skills/music-to-plex/references/bandcamp-album-identification.md +29 -0
  85. package/adapters/grok/olko-creative/skills/music-to-plex/references/batch-import-staging.md +23 -0
  86. package/adapters/grok/olko-creative/skills/music-to-plex/references/canonical-artist-normalization.md +24 -0
  87. package/adapters/grok/olko-creative/skills/music-to-plex/references/cover-art-and-plexamp.md +22 -0
  88. package/adapters/grok/olko-creative/skills/music-to-plex/references/cover-art-repair-session.md +34 -0
  89. package/adapters/grok/olko-creative/skills/music-to-plex/references/cover-art-sourcing-session.md +23 -0
  90. package/adapters/grok/olko-creative/skills/music-to-plex/references/dj-tracklist-crate-ingest.md +184 -0
  91. package/adapters/grok/olko-creative/skills/music-to-plex/references/duplicate-torrent-handling.md +19 -0
  92. package/adapters/grok/olko-creative/skills/music-to-plex/references/fallback-audio-validation-and-nas-preflight.md +42 -0
  93. package/adapters/grok/olko-creative/skills/music-to-plex/references/gear-change-image-identification.md +35 -0
  94. package/adapters/grok/olko-creative/skills/music-to-plex/references/image-driven-identification-and-verification.md +19 -0
  95. package/adapters/grok/olko-creative/skills/music-to-plex/references/library-repair-folders.md +22 -0
  96. package/adapters/grok/olko-creative/skills/music-to-plex/references/malformed-flac-fallbacks.md +11 -0
  97. package/adapters/grok/olko-creative/skills/music-to-plex/references/manual-fallback-transfer-and-plex-verification.md +39 -0
  98. package/adapters/grok/olko-creative/skills/music-to-plex/references/mtp-bot-bulk-state-safety.md +21 -0
  99. package/adapters/grok/olko-creative/skills/music-to-plex/references/mtp-subprocess-wrapper.md +13 -0
  100. package/adapters/grok/olko-creative/skills/music-to-plex/references/music-note-blurb-order.md +38 -0
  101. package/adapters/grok/olko-creative/skills/music-to-plex/references/nas-import-and-refresh.md +16 -0
  102. package/adapters/grok/olko-creative/skills/music-to-plex/references/nas-library-layout-and-write-preflight.md +31 -0
  103. package/adapters/grok/olko-creative/skills/music-to-plex/references/nas-permissions-and-plex-traversal.md +26 -0
  104. package/adapters/grok/olko-creative/skills/music-to-plex/references/nas-routing-and-refresh.md +22 -0
  105. package/adapters/grok/olko-creative/skills/music-to-plex/references/no-result-album-fallback.md +28 -0
  106. package/adapters/grok/olko-creative/skills/music-to-plex/references/per-track-album-art-split.md +12 -0
  107. package/adapters/grok/olko-creative/skills/music-to-plex/references/plex-playlist-append-and-verify.md +18 -0
  108. package/adapters/grok/olko-creative/skills/music-to-plex/references/plex-playlist-creation.md +21 -0
  109. package/adapters/grok/olko-creative/skills/music-to-plex/references/plex-token-source.md +20 -0
  110. package/adapters/grok/olko-creative/skills/music-to-plex/references/plex-visibility-check.md +28 -0
  111. package/adapters/grok/olko-creative/skills/music-to-plex/references/practice-crate-playlist.md +18 -0
  112. package/adapters/grok/olko-creative/skills/music-to-plex/references/session-2026-06-17-synology-probe.md +13 -0
  113. package/adapters/grok/olko-creative/skills/music-to-plex/references/torrent-stall-fallback.md +62 -0
  114. package/adapters/grok/olko-creative/skills/music-to-plex/references/verification-and-pitfalls.md +17 -0
  115. package/adapters/grok/olko-creative/skills/music-to-plex/references/youtube-403-fallbacks.md +17 -0
  116. package/adapters/grok/olko-creative/skills/music-to-plex/references/youtube-full-album-fallback.md +34 -0
  117. package/adapters/grok/olko-creative/skills/music-to-plex/references/youtube-lineage-playlist-fallback.md +33 -0
  118. package/adapters/grok/olko-creative/skills/music-to-plex/references/youtube-playlist-import.md +50 -0
  119. package/adapters/grok/olko-creative/skills/music-to-plex/references/youtube-track-resolution-heuristics.md +23 -0
  120. package/adapters/grok/olko-creative/skills/music-to-plex/references/zero-track-playlist-recovery.md +21 -0
  121. package/catalog/skills.json +33 -9
  122. package/docs/versioning.md +4 -2
  123. package/package.json +1 -1
  124. package/plugins/olko-apple-kit/.claude-plugin/plugin.json +1 -1
  125. package/plugins/olko-creative/.claude-plugin/plugin.json +1 -1
  126. package/plugins/olko-creative/skills/music-to-plex/SKILL.md +254 -0
  127. package/plugins/olko-creative/skills/music-to-plex/references/bandcamp-album-identification.md +29 -0
  128. package/plugins/olko-creative/skills/music-to-plex/references/batch-import-staging.md +23 -0
  129. package/plugins/olko-creative/skills/music-to-plex/references/canonical-artist-normalization.md +24 -0
  130. package/plugins/olko-creative/skills/music-to-plex/references/cover-art-and-plexamp.md +22 -0
  131. package/plugins/olko-creative/skills/music-to-plex/references/cover-art-repair-session.md +34 -0
  132. package/plugins/olko-creative/skills/music-to-plex/references/cover-art-sourcing-session.md +23 -0
  133. package/plugins/olko-creative/skills/music-to-plex/references/dj-tracklist-crate-ingest.md +184 -0
  134. package/plugins/olko-creative/skills/music-to-plex/references/duplicate-torrent-handling.md +19 -0
  135. package/plugins/olko-creative/skills/music-to-plex/references/fallback-audio-validation-and-nas-preflight.md +42 -0
  136. package/plugins/olko-creative/skills/music-to-plex/references/gear-change-image-identification.md +35 -0
  137. package/plugins/olko-creative/skills/music-to-plex/references/image-driven-identification-and-verification.md +19 -0
  138. package/plugins/olko-creative/skills/music-to-plex/references/library-repair-folders.md +22 -0
  139. package/plugins/olko-creative/skills/music-to-plex/references/malformed-flac-fallbacks.md +11 -0
  140. package/plugins/olko-creative/skills/music-to-plex/references/manual-fallback-transfer-and-plex-verification.md +39 -0
  141. package/plugins/olko-creative/skills/music-to-plex/references/mtp-bot-bulk-state-safety.md +21 -0
  142. package/plugins/olko-creative/skills/music-to-plex/references/mtp-subprocess-wrapper.md +13 -0
  143. package/plugins/olko-creative/skills/music-to-plex/references/music-note-blurb-order.md +38 -0
  144. package/plugins/olko-creative/skills/music-to-plex/references/nas-import-and-refresh.md +16 -0
  145. package/plugins/olko-creative/skills/music-to-plex/references/nas-library-layout-and-write-preflight.md +31 -0
  146. package/plugins/olko-creative/skills/music-to-plex/references/nas-permissions-and-plex-traversal.md +26 -0
  147. package/plugins/olko-creative/skills/music-to-plex/references/nas-routing-and-refresh.md +22 -0
  148. package/plugins/olko-creative/skills/music-to-plex/references/no-result-album-fallback.md +28 -0
  149. package/plugins/olko-creative/skills/music-to-plex/references/per-track-album-art-split.md +12 -0
  150. package/plugins/olko-creative/skills/music-to-plex/references/plex-playlist-append-and-verify.md +18 -0
  151. package/plugins/olko-creative/skills/music-to-plex/references/plex-playlist-creation.md +21 -0
  152. package/plugins/olko-creative/skills/music-to-plex/references/plex-token-source.md +20 -0
  153. package/plugins/olko-creative/skills/music-to-plex/references/plex-visibility-check.md +28 -0
  154. package/plugins/olko-creative/skills/music-to-plex/references/practice-crate-playlist.md +18 -0
  155. package/plugins/olko-creative/skills/music-to-plex/references/session-2026-06-17-synology-probe.md +13 -0
  156. package/plugins/olko-creative/skills/music-to-plex/references/torrent-stall-fallback.md +62 -0
  157. package/plugins/olko-creative/skills/music-to-plex/references/verification-and-pitfalls.md +17 -0
  158. package/plugins/olko-creative/skills/music-to-plex/references/youtube-403-fallbacks.md +17 -0
  159. package/plugins/olko-creative/skills/music-to-plex/references/youtube-full-album-fallback.md +34 -0
  160. package/plugins/olko-creative/skills/music-to-plex/references/youtube-lineage-playlist-fallback.md +33 -0
  161. package/plugins/olko-creative/skills/music-to-plex/references/youtube-playlist-import.md +50 -0
  162. package/plugins/olko-creative/skills/music-to-plex/references/youtube-track-resolution-heuristics.md +23 -0
  163. package/plugins/olko-creative/skills/music-to-plex/references/zero-track-playlist-recovery.md +21 -0
  164. package/plugins/olko-garmin-kit/.claude-plugin/plugin.json +1 -1
  165. package/plugins/olko-git-tools/.claude-plugin/plugin.json +1 -1
  166. package/plugins/olko-github-pr/.claude-plugin/plugin.json +1 -1
  167. package/plugins/olko-obsidian/.claude-plugin/plugin.json +1 -1
  168. package/plugins/olko-product/.claude-plugin/plugin.json +1 -1
  169. package/plugins/olko-reflection/.claude-plugin/plugin.json +1 -1
  170. package/plugins/olko-release/.claude-plugin/plugin.json +1 -1
  171. package/plugins/olko-skill-meta/.claude-plugin/plugin.json +1 -1
  172. package/plugins/olko-web-ops/.claude-plugin/plugin.json +1 -1
  173. package/scripts/lib/catalog.mjs +1 -1
@@ -0,0 +1,254 @@
1
+ ---
2
+ name: music-to-plex
3
+ description: "Acquire music and make it playable in Plex/Plexamp — single albums (via mtp-bot), DJ tracklists/crates, and YouTube playlists. Use ONLY when the user explicitly wants to ADD or DOWNLOAD music to Plex (e.g. 'add to Plex', 'get me this album', 'download this playlist', a timestamped DJ tracklist, or a plain 'Artist - Title' list). NOT for podcasts or non-music; for albums already on disk that won't show up, bulk library repair, or Plex scanner/DB problems, hand off to plex-music-ingest."
4
+ version: 3.0.0
5
+ platforms: [macos, linux]
6
+ metadata:
7
+ hermes:
8
+ tags: [music, plex, flac, nas, synology, album, playlist, plexamp]
9
+ related_skills: [plex-music-ingest, music-library-publishing, music-note-curation, podcast-monitoring]
10
+ ---
11
+
12
+ # Music to Plex
13
+
14
+ Acquire music and surface it in Plex/Plexamp. Three flows: **album** (one-shot
15
+ via `mtp-bot`), **DJ tracklist/crate**, and **YouTube playlist**. Pick the flow,
16
+ run it, verify, post notes.
17
+
18
+ ## Operating rules (non-negotiable)
19
+
20
+ - **One command per album.** For a single album/release, call `mtp-bot handle`
21
+ once and post its output. Do **not** run `mtp search`/`add`/`status` yourself,
22
+ do **not** pick a version (auto-pick is automatic), do **not** poll for
23
+ download status (the notifier streams it).
24
+ - **Serialize multi-album imports.** `mtp-bot` keeps a state machine per chat;
25
+ never dispatch album handler calls in parallel. Send one request, inspect its
26
+ reply, and proceed only after it has accepted the release or returned to idle.
27
+ If it opens a numbered picker, stop the batch and preserve that picker until
28
+ its owner chooses or explicitly authorizes cancellation. Do not send a bare
29
+ number, `cancel`, or a new request into an existing picker on behalf of a
30
+ different request. **Exception:** when the user explicitly says to ignore or
31
+ override an active download and names the replacement, treat that as direct
32
+ cancellation authority: dispatch the resolved replacement once, without a
33
+ redundant confirmation loop, and state that the earlier job may be abandoned.
34
+ - **Route by shape.** Album → `mtp-bot handle`. DJ tracklist/crate → the crate
35
+ ingest reference. YouTube playlist or plain track list → the YouTube flow.
36
+ Never pass a crate or multi-track prose to `mtp-bot handle` (album-shaped
37
+ parser; it will reply `⏭️ Not a music album request — skipped.`).
38
+ - **Cover-art requests need resolution before dispatch.** A bare `mtp` with an
39
+ album image is an explicit album request, but `mtp` alone is not handler-ready.
40
+ Transcribe/identify the cover, verify the canonical release and track count,
41
+ then proceed through the resolved-image continuation. Never expect the album
42
+ parser to infer a title from an image caption. When invoking `mtp-bot`, use the
43
+ **originating Telegram chat ID** from the inbound route; a group ID, user ID,
44
+ and configured home-chat ID are different things.
45
+ - **Never claim done without verification.** A "Downloading…" or a successful Plex refresh is a *start* signal, not proof. The album is done only when the files exist under the configured Plex library path **and** are visible in Plexamp. Read back playlist items before saying a playlist is updated.
46
+ - **Show the user the checklist.** For every album ingest, post/update this exact evidence-led checklist in order. Mark `✅` only after tool evidence; use `⏳` while active, `⚠️` for a verified blocker, and never silently omit a step:
47
+ ```text
48
+ ⏳ Canonical release metadata / tracklist verified
49
+ ⏳ Audio acquired and locally staged
50
+ ⏳ Track count, tags, embedded art, and file integrity verified
51
+ ⏳ NAS artist-path and write-permission preflight verified
52
+ ⏳ Files copied to the final Plex-scanned NAS folder
53
+ ⏳ NAS count/art/folder traversal verified; transfer sidecars cleaned
54
+ ⏳ Plex refresh triggered and album + full track count read back from Plex
55
+ ⏳ Obsidian note written: Artist note → Album note → DJ summary
56
+ ```
57
+ The final response must retain this checklist with concrete proof values (final path, counts, Plex result, and note path). If a fallback bypasses the normal handler, say so explicitly and still keep the checklist.
58
+ - **Never fabricate facts.** In DJ notes, if unsure of a musician/label/year, say less. Do not invent files, APIs, env vars, or NAS paths.
59
+ - **Obsidian note voice and substance.** Notes must use the full enrichment standard in `references/music-note-blurb-order.md`: original WFMU / LDBK / Radio Brussels / classic-underground-radio energy, vivid sensory language, and juicy source-backed facts that make listeners curious and emotionally engaged. Include verified recording/release context, label/year, collaborators/producers, samples or scene links, unusual backstory, cultural impact, and concrete listening cues when available. Never imitate a named presenter, write generic promo copy, or pad the note with unsourced trivia. Run the replaceability test before saving: if the note would mostly work after swapping the album name, rewrite it.
60
+ - **Obsidian vault path.** Write music notes to `/Users/olegkoval/Documents/opus/Music/`, the visible Music folder used by the existing notes (not `Documents/opus/Obsidian/Hermes/Music/`). Verify the exact note path by reading it back after writing.
61
+ - **Secrets live in `~/.config/music-to-plex/.env`** (loaded automatically by
62
+ `Config.load`), never in `config.toml`. If a check says "PLEX_TOKEN not set",
63
+ fix the `.env`. See `references/plex-token-source.md`.
64
+ - **Hand off repair.** Album on disk but not visible, wrong folder/tags after
65
+ the fact, bulk library cleanup, permission problems, or Plex scanner/DB
66
+ crashes → this is **plex-music-ingest**'s job, not this skill's.
67
+
68
+ ## One-shot album flow
69
+
70
+ The user posts once ("add <album>") and gets a status stream back. The mechanics
71
+ (auto-pick best version, download, organize, Plex refresh, staged status
72
+ messages) are handled by the tool chain. **Your only creative job is the DJ
73
+ blurb.**
74
+
75
+ ### Step 1 — Run the handler once
76
+
77
+ ```bash
78
+ mtp-bot handle "<exact user message>" --chat <chat_id>
79
+ ```
80
+
81
+ `<exact user message>` = what the user said; `<chat_id>` = the Telegram chat ID.
82
+ This auto-picks the highest-seed release, starts the download, and spawns a
83
+ background notifier. It returns:
84
+
85
+ ```
86
+ ✅ Accepted: <Artist> — <Album>
87
+ ⏳ Downloading [FORMAT] SIZE, N seeds — status updates to follow.
88
+ ```
89
+
90
+ Post that result as-is.
91
+
92
+ ### Step 2 — Write the notes in strict order
93
+
94
+ Immediately after posting "Accepted", while the download runs in the background,
95
+ write one enrichment package, in this order:
96
+
97
+ 1. **Artist note** — a specific, substantial paragraph in the original WFMU / LDBK / Radio Brussels / classic-underground-radio lane: the artist's broader sound, history, scene, collaborators, and lane. Include at least one verified fact that gives the listener a reason to care.
98
+ 2. **Album note** — a separate, juicy paragraph: year, label, recording/release context, key players, unusual backstory, samples or scene connections, cultural impact, and two or three concrete things to listen for. Use only facts verified from authoritative sources; turn them into a human invitation rather than a database dump.
99
+ 3. Optional one-line DJ summary or recommendation — tactile, specific, curious, and emotionally inviting.
100
+
101
+ Keep artist note first and album note second — never merge them into one generic promo paragraph. Sound like a great late-night radio host with a crate-digger’s memory, not a press release or a Wikipedia entry. See
102
+ `references/music-note-blurb-order.md`. Optional extras: 🎵 YouTube link,
103
+ `🎶 You might also like:` + 2 short recommendations.
104
+
105
+ ### Step 3 — Let the notifier stream the rest
106
+
107
+ The background notifier posts these on its own — **do not poll or re-run**:
108
+
109
+ ```
110
+ 📥 Downloaded → 📂 Moving to library folder → 🔄 Rescanning Plex → ✅ Ready in Plexamp
111
+ ```
112
+
113
+ After "Ready", mirror the notes into the canonical visible Music vault at
114
+ `/Users/olegkoval/Documents/opus/Music/` as a music note for that release
115
+ (append if it exists), artist note above album note, followed by DJ summary and
116
+ source links. Read the exact file back before reporting the note complete. If
117
+ the user asked for album art, save the release image as `cover.jpg` in the
118
+ artist/release folder and verify it exists. See
119
+ `references/cover-art-sourcing-session.md`.
120
+
121
+ ### Step 4 — Follow-up replies (stuck downloads)
122
+
123
+ If a download stalls, the notifier posts a "stuck" message with 4 numbered
124
+ options (wait 1h / wait N hours / next release / YouTube). When the user replies
125
+ — a bare number `1`–`4`, a count of hours, or "next" / "youtube" — **pass the
126
+ reply verbatim to `mtp-bot handle`**, exactly like an add request. Post whatever
127
+ it returns.
128
+
129
+ **YouTube handoff:** if `mtp-bot handle` returns a line starting with
130
+ `__YOUTUBE_FALLBACK__`, strip it and run the YouTube flow yourself (download
131
+ highest-quality audio with `yt-dlp`, fix tags, move into the library, refresh
132
+ Plex), then post the blurb. If `rsync` or `scp` is unsuitable for a release transfer, use the verified tar-over-SSH fallback, remove any macOS AppleDouble sidecars, and compare NAS/Plex track counts with canonical metadata. See `references/manual-fallback-transfer-and-plex-verification.md`, `references/youtube-403-fallbacks.md`, and `references/youtube-full-album-fallback.md`.
133
+
134
+ **No-result continuation:** if the bot returns an actual no-results outcome and
135
+ the user asks to continue, do not stop at a blocker report. Resolve canonical
136
+ MusicBrainz metadata, then run the fail-closed track-by-track YouTube fallback:
137
+ match each track by normalized title and duration, reject videos/remixes/live
138
+ versions unless canonical, tag and cover-embed every file, stage it, transfer,
139
+ and verify in Plex. A file's existence is not evidence it completed: fully decode
140
+ all staged files and compare each actual duration to canonical metadata before
141
+ NAS transfer; re-tag the full set after any interrupted run. Prefer separately
142
+ sourced tracks over slicing a continuous full-album upload; only split a full
143
+ upload using validated cues and boundary checks. Clearly distinguish local
144
+ staging, NAS transfer, and Plex visibility. See
145
+ `references/no-result-album-fallback.md` and
146
+ `references/fallback-audio-validation-and-nas-preflight.md`.
147
+
148
+ ### Manual-fallback NAS preflight
149
+
150
+ Resolve the canonical release first, then preflight the exact NAS destination
151
+ **in parallel with source selection and before substantial fallback downloading**.
152
+ Inspect the NAS layout and an existing album by the same artist. `nas_music` is a
153
+ storage root, not proof that a new artist directory is inside the Plex-scanned
154
+ library. Confirm the originating transfer account can write and traverse the
155
+ exact final parent; if a new artist directory is required, confirm it can create
156
+ that directory too. If the parent is root-owned or read-only, do not spend the
157
+ whole fallback download hoping the copy will work and do not invent an alternate
158
+ writable folder. Keep any already-staged release local and request an
159
+ album-scoped permission repair from the NAS owner.
160
+
161
+ **Durable access repair:** when the user explicitly wants future managed imports
162
+ to work, repair the *Plex library root* (for this setup,
163
+ `/volume1/music/library`) rather than recursively changing ownership of the
164
+ whole `/volume1/music` share. A safe target is managed-account ownership and
165
+ library-root group write (for example `beheerder:users`, `775`), then verify by
166
+ creating and removing a uniquely named probe directory over SSH. New artist and
167
+ album parents must still be Plex-traversable (`755`); an artist directory left
168
+ at `770` can block scanner traversal even when the release directory and FLACs
169
+ are readable. Never widen ownership/permissions above the Plex library root
170
+ without explicit user approval. See
171
+ `references/nas-library-layout-and-write-preflight.md`,
172
+ `references/fallback-audio-validation-and-nas-preflight.md`, and
173
+ `references/nas-permissions-and-plex-traversal.md`.
174
+
175
+ ## DJ tracklist / crate flow
176
+
177
+ A timestamped DJ set or a themed crate brief is **not** an album request. Parse
178
+ the list, find lawful sources, acquire audio when allowed, fix metadata/artwork,
179
+ store a separate DJ-friendly folder on NAS, and create/refresh a Plex playlist.
180
+ Creation is incomplete until Plex shows a visible playlist **and** the crate has
181
+ proper cover art. If the user says the set is for DJ practice, treat it as a
182
+ **practice crate**: rebuild/trim for mixability, don't just append tracks. Full
183
+ procedure: `references/dj-tracklist-crate-ingest.md`.
184
+
185
+ ## YouTube playlist flow
186
+
187
+ Use when the user wants a YouTube playlist (not a timestamped DJ set, not a
188
+ single album) turned into a normal Plex listening playlist. Two inputs: a
189
+ ready-made playlist URL, or a plain list of `Artist - Title` lines. Do not route
190
+ through `mtp-bot handle` or the crate flow. Full download/tagging/placement/
191
+ verification steps: `references/youtube-playlist-import.md`.
192
+
193
+ ## Verification pitfalls (hard-won)
194
+
195
+ - **File exists ≠ visible.** After refresh, if Plexamp shows nothing, re-verify
196
+ the album landed under the configured Plex-rooted library path (not a staging/
197
+ download dir or a bucket Plex doesn't scan). See `references/plex-visibility-check.md`.
198
+ - **Permissions.** Root-owned `700` directories are invisible to Plex traversal
199
+ even if the audio is readable. Verify the final folder is traversable and fix
200
+ to `755` before every refresh.
201
+ - **Refresh verb.** On this Plex install, `/library/sections/{id}/refresh` must
202
+ be **GET**; PUT returns 404, and a targeted `path=` refresh may also 404 - fall
203
+ back to a plain section refresh. Refresh only after files are in their final
204
+ NAS path; refresh again after any later tag/rename change.
205
+ - **Targeted refresh exists in the CLI.** `mtp refresh --path <final NAS path>`
206
+ is the preferred completion check when the release lands cleanly. Treat
207
+ `{"refreshed": true, "section_id": ...}` as a real success signal.
208
+
209
+ - **Target layout beats generic configuration.** Before creating a genre bucket, inspect where Plex stores an existing album from the same artist and confirm the transfer account can write that parent. Do not redirect a release to an unrelated writable folder or `unsorted` solely to make the copy succeed; repair access to the canonical target instead. See `references/nas-library-layout-and-write-preflight.md`.
210
+ - **Corrupt source ≠ Plex problem.** If a chapter-based rip yields a zero-byte or
211
+ corrupt final track, switch source first, then tag and move — don't just
212
+ re-refresh. See `references/malformed-flac-fallbacks.md`.
213
+ - **NAS codec tools may be unavailable.** Some NAS images ship neither `ffprobe`
214
+ nor an AAC decoder in `ffmpeg`. In that case, fully decode each staged source
215
+ locally before transfer, then use NAS file count/art/sidecar/traversal checks
216
+ plus Plex’s album-and-track read-back as the remote verification receipt. Do
217
+ not describe a remote decode as passed when the NAS tool cannot decode it.
218
+ - **Duplicate torrent.** On Synology `Duplicate torrent file`, do not retry
219
+ blindly — `list_tasks` first; repeated attempts stack failed tasks. Clean stale
220
+ tasks, then re-search with plain artist/album text (no magnet URLs in replies).
221
+ See `references/duplicate-torrent-handling.md`.
222
+ - **Image/typo identification.** If the user sends cover art or a misspelled/clip
223
+ title (`Single`, `Official clip`, `teaser`), use it as a *clue* — confirm the
224
+ real release name and track count on the store/release page before importing.
225
+ See `references/image-driven-identification-and-verification.md` and
226
+ `references/bandcamp-album-identification.md`.
227
+ - **Lesson (scanner health):** when an album repeatedly "won't ingest" after the
228
+ files are correctly placed, stop re-moving files. The cause is usually scanner/
229
+ DB state, not placement — a direct scanner probe can crash with `DB::Exception`
230
+ while a plain refresh succeeds. At that point the album is a **plex-music-ingest**
231
+ case: check scanner health, DB state, and crash cause before touching tags again.
232
+ (Real example: an album sat correctly at `/volume1/music/Various Artists/…`
233
+ yet stayed invisible; extra nested `library/pop` layers never helped.)
234
+
235
+ ## References
236
+
237
+ - Notes & enrichment: `music-note-blurb-order.md`, `cover-art-sourcing-session.md`
238
+ - Album ID & verification: `image-driven-identification-and-verification.md`,
239
+ `gear-change-image-identification.md`, `bandcamp-album-identification.md`,
240
+ `plex-visibility-check.md`, `verification-and-pitfalls.md`
241
+ - DJ crates: `dj-tracklist-crate-ingest.md`, `cover-art-repair-session.md`,
242
+ `per-track-album-art-split.md`, `youtube-lineage-playlist-fallback.md`
243
+ - YouTube: `youtube-playlist-import.md`, `youtube-403-fallbacks.md`,
244
+ `youtube-full-album-fallback.md`, `fallback-audio-validation-and-nas-preflight.md`
245
+ - Playlists: `plex-playlist-creation.md`, `plex-playlist-append-and-verify.md`,
246
+ `zero-track-playlist-recovery.md`
247
+ - Plex/NAS plumbing: `plex-token-source.md`, `nas-routing-and-refresh.md`,
248
+ `batch-import-staging.md`, `mtp-subprocess-wrapper.md`,
249
+ `mtp-bot-bulk-state-safety.md`, `session-2026-06-17-synology-probe.md`
250
+ - Repair/forensics (mostly owned by **plex-music-ingest**):
251
+ `library-repair-folders.md`, `canonical-artist-normalization.md`,
252
+ `cover-art-and-plexamp.md`
253
+
254
+ That is the skill. Pick the flow, run it, verify, post notes. Silence if no output.
@@ -0,0 +1,29 @@
1
+ # Bandcamp album identification when OCR/YouTube points at a single
2
+
3
+ Use this when cover art or a clip title points to a song, but the user actually wants the full release.
4
+
5
+ ## Pattern from this session
6
+
7
+ - Cover art text said `74 Miles Away - Gear Change`.
8
+ - A YouTube clip title looked like a single: `74 Miles Away - Gear Change // Single`.
9
+ - The Bandcamp release page was the source of truth:
10
+ - `https://74milesaway.bandcamp.com/album/gear-change`
11
+ - page title: `Gear Change | 74 Miles Away`
12
+ - tracklist: 8 tracks
13
+ - release date: `2013-05-16`
14
+ - `yt-dlp -J` on the Bandcamp album URL exposed the album metadata directly:
15
+ - `playlist_title = Gear Change`
16
+ - `playlist_count = 8`
17
+ - `album = Gear Change`
18
+ - `album_artist = 74 Miles Away`
19
+
20
+ ## Practical rule
21
+
22
+ If the clip title includes `Single`, `Official clip`, or another video-oriented label, do not treat it as the final release name. Check the Bandcamp album page (or equivalent store page) for the actual album title and track count before importing.
23
+
24
+ ## Verification
25
+
26
+ - Prefer the album page over a clip title.
27
+ - Use `yt-dlp -J <album-url>` to confirm the release title and track list.
28
+ - Import the full album folder, not the clip single, before refreshing Plex.
29
+ - Verify the album in Plex by searching the music section for the album title after refresh.
@@ -0,0 +1,23 @@
1
+ # Batch import staging and source validation
2
+
3
+ Use this pattern when importing multiple albums from downloaded source material into Plex.
4
+
5
+ ## Stage-first workflow
6
+
7
+ 1. Stage each album in a temp tree before touching the NAS library path.
8
+ 2. After staging, push the staged tree into the final NAS location in one shot.
9
+ 3. Normalize final permissions before refresh:
10
+ - album directories: `755`
11
+ - audio files and art: `644`
12
+ 4. Refresh Plex only after the final path and permissions are correct.
13
+ 5. Verify Plex search for album and at least one track after refresh.
14
+
15
+ ## Source validation for YouTube rips
16
+
17
+ - Prefer a source with reliable chapter metadata when the album is chapter-based.
18
+ - If the first candidate download produces a bad last track or an invalid MP3, do not keep tagging it. Treat that as a source problem and try an alternate full-album upload instead.
19
+ - Sanity-check extracted audio before tagging or moving it into the library. A quick `ffprobe` or `file` pass on each MP3 is enough to catch a corrupt final track.
20
+
21
+ ## Practical fallback
22
+
23
+ If the local machine cannot write to the NAS library path directly, keep the staging tree local and stream it to the NAS over SSH, then run the permission normalization and Plex refresh remotely.
@@ -0,0 +1,24 @@
1
+ # Canonical artist normalization
2
+
3
+ Session note for bulk metadata repair and folder convergence.
4
+
5
+ ## Rule
6
+ When multiple artist spellings refer to one real artist, normalize them to a single canonical display name before writing tags or deciding folder placement.
7
+
8
+ Example from this session:
9
+ - Canonical display name: `Godspeed You! Black Emperor`
10
+ - Collapsed variants included punctuation/no-punctuation spellings such as `godspeedyoublackemperor`, `Godspeed You Black Emperor!`, and `Godspeed You! Black Emperor`
11
+
12
+ ## Practical pattern
13
+ - Normalize artist strings by stripping non-alphanumerics for lookup.
14
+ - Apply the canonical mapping in two places:
15
+ - when choosing the dominant artist for a directory or album batch
16
+ - when comparing existing tags before deciding whether to rewrite them
17
+ - If the normalized value differs from the current tag, treat it as drift and rewrite the tag so the library converges.
18
+
19
+ ## Why this matters
20
+ - Plex can surface the same artist multiple times when tags disagree on punctuation or spacing.
21
+ - Folder names and tags need to converge on the same canonical form or future refreshes keep re-splitting the library.
22
+
23
+ ## Implementation note
24
+ If the normalizer is generated inside an outer f-string, escape literal braces in embedded dicts with `{{ ... }}` so the generator does not try to interpret the mapping as formatting syntax.
@@ -0,0 +1,22 @@
1
+ # Cover art and PlexAmp visibility
2
+
3
+ Session note: when a music release is imported from a chapter-split source or a plain audio rip, the album may index in Plex with no artwork because there is no local cover image and Plex cannot reliably match the release online.
4
+
5
+ ## Practical rule
6
+
7
+ If PlexAmp shows the album but the tile is blank or generic:
8
+ 1. Check the final album folder for a local image first (`cover.jpg`, `folder.jpg`, `front.jpg`, or `*.png`).
9
+ 2. If none exists, fetch the real release art from Discogs or another authoritative release listing and place it in the album folder as `cover.jpg`.
10
+ 3. Prefer the exact release art over YouTube thumbnails, generic web images, or a random match.
11
+ 4. Refresh the Plex music section again after the art file is in place.
12
+ 5. Prefer folder art for compilation releases and niche albums that Plex metadata matching may not recognize.
13
+
14
+ ## Useful note
15
+
16
+ A clean import can still be missing art. That is not the same failure as library ingest. Treat artwork as a separate visibility layer from track indexing.
17
+
18
+ ## Discogs workflow
19
+
20
+ - Search Discogs by the exact album title and year.
21
+ - Open the release page or API record, then use the release image for the final folder art.
22
+ - Verify the art file on disk after copy, then refresh Plex and re-check PlexAmp.
@@ -0,0 +1,34 @@
1
+ # Embedded cover-art repair session notes
2
+
3
+ Use this when a DJ crate or playlist already exists on the NAS and Plexamp shows the gray "no album art" thumbnail on every track.
4
+
5
+ ## What worked
6
+
7
+ - The set was `Deep Lineage Set` and the source folder was:
8
+ `/volume1/video/plex-imports/deep-lineage-set`
9
+ - The tracklist came from a screenshot, so the first pass was image-assisted identification of the set name and sequence.
10
+ - The fixed files were FLACs, so `mutagen.flac.FLAC` was enough to rewrite embedded artwork in place.
11
+ - Each file ended up with exactly one embedded picture after the rewrite.
12
+ - Plex was refreshed with `GET /library/sections/{id}/refresh` on the NAS, not a UI click.
13
+
14
+ ## Practical pattern
15
+
16
+ 1. Identify the exact release for each track before writing tags.
17
+ 2. Pull the release art from Cover Art Archive or another authoritative source.
18
+ 3. Rewrite embedded art in the track files themselves.
19
+ 4. Verify the resulting files have `1` picture each.
20
+ 5. Refresh Plex only after the files are in final NAS path.
21
+
22
+ ## Pitfalls
23
+
24
+ - Folder-level artwork is not enough if the tracks themselves have missing embedded art and Plexamp is reading track thumbnails.
25
+ - Do not assume the Spotify-looking playlist title is the actual release title. Screenshot tracklists often mix track names, artists, and playlist labels.
26
+ - When a release has similarly named variants, resolve by artist + release group, not title alone.
27
+
28
+ ## Verification
29
+
30
+ Check both:
31
+ - file-level art count in each FLAC/MP3
32
+ - Plex refresh on the target section
33
+
34
+ If both are true, the playlist should render with original cover art in Plexamp.
@@ -0,0 +1,23 @@
1
+ # Cover art sourcing session note
2
+
3
+ Use this when the user wants music notes plus actual album art, not just text notes.
4
+
5
+ ## Pattern that worked
6
+ - Create the release note as usual, but do not stop there.
7
+ - Find a reliable source image for the release cover.
8
+ - Prefer an image URL already exposed by the page's image inventory over scraping HTML manually.
9
+ - If Bandcamp page image is available, use that for direct art.
10
+ - If Bandcamp does not expose the needed cover clearly, fall back to a verified artwork image from Wikipedia or another canonical release page.
11
+ - Save the image locally as `cover.jpg` in the artist or release folder.
12
+ - Verify with a filesystem search, not by assuming the download worked.
13
+
14
+ ## Session outcome
15
+ - Fred Everything - Mercyless: cover saved as `cover.jpg` in the artist folder.
16
+ - Ron Trent - Altered States: cover saved as `cover.jpg`.
17
+ - Chez Damier & Ron Trent, M.D. - Hip To Be Disillusioned Vol. 1: cover saved as `cover.jpg`.
18
+ - St Germain - Tourist: cover saved as `cover.jpg`.
19
+ - Larry Heard - Can You Feel It: cover saved as `cover.jpg`.
20
+
21
+ ## Pitfall
22
+ - Do not answer with notes-only completion if the user asked for album art. That is partial work.
23
+ - Treat art placement as part of the deliverable for music-library curation.
@@ -0,0 +1,184 @@
1
+ # DJ tracklist crate ingest to NAS + Plex
2
+
3
+ Use when the user posts a timestamped DJ set tracklist and wants it turned into a DJ-usable folder and Plex/Plexamp listening playlist.
4
+
5
+ ## Scope and legality
6
+
7
+ - Prefer legal/owned sources: Bandcamp, Qobuz, Beatport, Juno Download, artist/label stores, existing NAS library, or user-provided files.
8
+ - YouTube is allowed only for lawful sources: official uploads, artist/label uploads, Creative Commons, public-domain material, or user-confirmed personal-use fallback where local law/account terms permit it.
9
+ - Do not present piracy as the default path. If a track is commercially available, prefer purchase/store source over a random YouTube rip.
10
+ - If source rights are unclear, stage it as `needs_source_confirmation` and ask before download.
11
+
12
+ ## Input format
13
+
14
+ Accept lines like:
15
+
16
+ ```text
17
+ 00:00 Intro - Marc Bianco
18
+ 02:30 Ghetto Opera (Loft Mix) - Nicholas featuring Nikki-O
19
+ 1:19:17 Under The Sun - Fred Everything
20
+ ```
21
+
22
+ Parse into:
23
+
24
+ - original timestamp
25
+ - title
26
+ - mix/version
27
+ - artist(s)
28
+ - original line
29
+ - confidence
30
+ - source URL(s)
31
+ - final file path
32
+ - metadata status
33
+ - Plex ratingKey if indexed
34
+
35
+ ## Target folder structure
36
+
37
+ Create a dedicated crate separate from normal album folders so it is DJ-friendly and easy to copy to Rekordbox/USB later:
38
+
39
+ ```text
40
+ <NAS_MUSIC_ROOT>/DJ Crates/<YYYY-MM-DD> - <Set Name>/
41
+ 00_PLAYLIST.m3u8
42
+ 00_TRACKLIST.md
43
+ 00_MANIFEST.json
44
+ artwork/
45
+ folder.jpg
46
+ 01 - Artist - Title.jpg
47
+ audio/
48
+ 01 - Artist - Title (Version).flac
49
+ 02 - Artist - Title.mp3
50
+ ```
51
+
52
+ Naming rules:
53
+
54
+ - Prefix files with set order: `01`, `02`, `03`.
55
+ - Use `Artist - Title (Mix)` after the prefix.
56
+ - Sanitize `/`, `:`, shell metacharacters, and weird whitespace.
57
+ - Preserve original timestamp in tags/comments and manifest, not in filename.
58
+ - Keep source quality in manifest. Do not put `[YouTube]` in the DJ filename unless quality/source ambiguity matters.
59
+
60
+ ## Acquisition order
61
+
62
+ For each track:
63
+
64
+ 1. Search existing NAS/Plex library first. Reuse existing clean file if present.
65
+ 2. Search official stores/catalog pages for metadata confirmation.
66
+ 3. Search YouTube only after metadata is clear or when no store source exists.
67
+ 4. Prefer official artist/label uploads over user rips.
68
+ 5. Download best audio only when lawful/approved.
69
+ 6. If the track cannot be sourced confidently, create a manifest row with `status=missing` and continue.
70
+
71
+ ## Tool routing pitfall
72
+
73
+ `mtp-bot handle` is for one album/release at a time. Do not feed it a DJ playlist, crate brief, or natural-language list of artists. It can correctly classify that as not an album request and skip it.
74
+
75
+ For crates, parse the tracklist yourself into a manifest, then run per-track acquisition and verification. If you use the plain `mtp` album search path for a release, inspect ranking before adding: the one-shot album auto-pick historically ranked by seeds, not by archival quality. When the user asks for "biggest quality" or "FLAC as possible", prefer this order explicitly: true lossless format (`FLAC`, `WAV`, `ALAC`, `APE`, `WavPack`, `TTA`), then larger release size when it matches the release, then seeds/availability. Never present a lossy YouTube-to-FLAC conversion as real lossless.
76
+
77
+ ## YouTube search and download pattern
78
+
79
+ Use exact queries first:
80
+
81
+ ```bash
82
+ yt-dlp "ytsearch5:<artist> <title> <mix/version>" --dump-json --flat-playlist
83
+ ```
84
+
85
+ Pick using this priority:
86
+
87
+ 1. exact artist + exact title + exact mix/version
88
+ 2. official channel / label channel
89
+ 3. duration close to expected release duration, not the DJ-set timestamp segment
90
+ 4. audio quality / stable upload
91
+ 5. avoid live rips, radio rips, sped-up/slowed/reverb, AI covers, compilations, and low-effort reposts
92
+
93
+ Download pattern:
94
+
95
+ ```bash
96
+ yt-dlp -x --audio-format flac --audio-quality 0 \
97
+ --embed-thumbnail --convert-thumbnails jpg \
98
+ --add-metadata \
99
+ -o "staging/%(title).200B.%(ext)s" "<url>"
100
+ ```
101
+
102
+ If FLAC conversion is wasteful because source is lossy, keep high-quality MP3/M4A and record `source_lossy=true` in manifest. Do not pretend a YouTube FLAC is lossless.
103
+
104
+ ## Metadata repair
105
+
106
+ After every download, rewrite tags from the parsed/canonical metadata, not from uploader title:
107
+
108
+ Required tags:
109
+
110
+ - title
111
+ - artist
112
+ - albumartist = `Various Artists`
113
+ - album = `<Set Name>`
114
+ - tracknumber / tracktotal
115
+ - date/year if known
116
+ - genre = best broad crate genre, e.g. `Deep House`, `Disco House`, `Balearic`
117
+ - comment = `Crate: <Set Name>; Original timestamp: <timestamp>; Source: <url>`
118
+ - compilation = 1 where supported
119
+
120
+ Recommended DJ tags if tools are available:
121
+
122
+ - BPM
123
+ - initial key / Camelot key
124
+ - replaygain / loudness normalization metadata
125
+
126
+ Use `mutagen` for tag writes. Use `ffmpeg` only for conversion/extraction. Validate tags with `ffprobe` or `mutagen` before moving to NAS.
127
+
128
+ ## Cover art
129
+
130
+ Cover hierarchy:
131
+
132
+ 1. official release cover from MusicBrainz/Discogs/Bandcamp/store page
133
+ 2. label/artist upload thumbnail if official
134
+ 3. YouTube thumbnail only as fallback
135
+ 4. crate-level generated or neutral cover if no per-track cover exists
136
+
137
+ Save:
138
+
139
+ - embedded art in each audio file when format supports it
140
+ - `artwork/<track>.jpg`
141
+ - `folder.jpg` for the crate
142
+
143
+ ## Plex integration
144
+
145
+ After final files are copied to the NAS path:
146
+
147
+ 1. Fix permissions so Plex can traverse directories.
148
+ 2. Refresh the relevant Plex music section.
149
+ 3. Search Plex for every imported track and capture ratingKeys.
150
+ 4. Create a Plex audio playlist named `<Set Name> - DJ crate` using ratingKeys in set order.
151
+ 5. Verify playlist item count and order by reading back `/playlists/<id>/items`.
152
+ 6. Report missing/unmatched tracks separately. Do not call the crate done if Plex indexed only part of it.
153
+
154
+ Use `references/plex-playlist-creation.md` for the exact Plex API sequence.
155
+
156
+ ## Outputs to user
157
+
158
+ Return concise status:
159
+
160
+ - crate folder path
161
+ - Plex playlist name / ID
162
+ - total tracks requested
163
+ - imported count
164
+ - Plex-visible count
165
+ - missing/problem tracks
166
+ - source quality warning if any tracks came from lossy YouTube audio
167
+
168
+ Example:
169
+
170
+ ```text
171
+ Crate built: /volume1/music/DJ Crates/2026-07-04 - Deep House Set/audio
172
+ Plex playlist: Deep House Set - DJ crate, 27 tracks
173
+ Imported: 25/27
174
+ Plex visible: 25/25
175
+ Missing: 2 - exact source not found
176
+ Warning: 8 tracks came from YouTube lossy sources; fine for listening/practice, not archival.
177
+ ```
178
+
179
+ ## Verification rules
180
+
181
+ - A downloaded file is not enough. Verify tags, path, Plex visibility, and playlist order.
182
+ - A Plex refresh response is not enough. Read back playlist items.
183
+ - Do not overwrite existing clean library files. Copy/link them into the crate or reference them in M3U.
184
+ - Keep the manifest. It is the audit trail for where each track came from and why a track is missing.
@@ -0,0 +1,19 @@
1
+ # Duplicate torrent handling
2
+
3
+ Session note:
4
+ - The same magnet (`41bfeae4e4edb72b0e4acc1f816cf4c4914965f2`) was submitted repeatedly for The Chemical Brothers - *Push the Button*.
5
+ - Synology Download Station replied with `Duplicate torrent file`.
6
+ - Three task IDs showed the same failed magnet in `list_tasks`: `dbid_807`, `dbid_808`, `dbid_809`.
7
+
8
+ Retry-safe sequence:
9
+ 1. Call `list_tasks` first.
10
+ 2. Search by magnet hash / title.
11
+ 3. If the task already exists, do not add another copy.
12
+ 4. If the task is failed and duplicated, clean the stale entries before trying a fresh add.
13
+ 5. Re-run search with plain artist/album text only. Do not expose magnet URLs back to the user.
14
+
15
+ Session outcome:
16
+ - After cleanup, the only RuTracker hit for this album was topic `3296838`.
17
+ - There was no alternate source in the current index, so the retry used the same text-only release rather than inventing a fallback.
18
+
19
+ This is a Download Station state issue, not a Plex ingest issue.