@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,42 @@
1
+ # Manual album fallback: validation and NAS preflight
2
+
3
+ Use this only after the normal `mtp-bot` path has returned a real no-result/fallback outcome, or the user explicitly authorizes a manual recovery path.
4
+
5
+ ## 1. Derive the request and route correctly
6
+
7
+ - A bare `mtp` accompanying cover art is an album request. Read the cover, then confirm the canonical artist, release title, year, official track count, and expected track durations before acquiring anything.
8
+ - `mtp-bot handle` must receive the **originating Telegram chat ID**. For a group, that is the negative group ID from the inbound route, not the user ID and not the configured home-DM ID.
9
+ - Do not call `mtp-bot` with a naked image caption such as `mtp`; it has no album text to parse. After identification, use a clear album-shaped add request only if the workflow permits a resolved-image continuation.
10
+
11
+ ## 2. Preflight NAS while metadata is being confirmed
12
+
13
+ Read-only inspect the exact final parent path first. Verify:
14
+
15
+ ```bash
16
+ ssh <user>@<nas> "test -d '<final-parent>' && test -w '<final-parent>' && test -x '<final-parent>'"
17
+ ```
18
+
19
+ If the artist directory does not exist, verify the transfer account can create it **before** downloading the whole album. A read-only library is a blocker, not a signal to choose an arbitrary alternate directory. Ask the NAS owner for an album-scoped directory plus write/traverse access.
20
+
21
+ ## 3. Track-by-track YouTube staging
22
+
23
+ For every canonical track:
24
+
25
+ 1. Search separately; prefer an official audio upload.
26
+ 2. Reject live, remix, edit, video, and compilation variants unless the canonical release requires one.
27
+ 3. Check normalized title and source duration against the canonical duration before download.
28
+ 4. Tag *every* FLAC and embed the same verified cover art. Never skip tagging merely because a filename already exists—the process may have timed out between conversion and tagging.
29
+
30
+ ## 4. Decode and duration validation are mandatory
31
+
32
+ A successfully created `.flac` may still be truncated after a timeout/interruption. Before NAS transfer:
33
+
34
+ - decode every FLAC to null with FFmpeg (or use another installed lossless decoder);
35
+ - check exact file count, canonical tags, track numbering, and an embedded front-cover picture;
36
+ - compare each decoded duration with MusicBrainz/canonical duration using a tolerance appropriate to the source (normally ±12%; use a tighter bound when directly matching an official upload).
37
+
38
+ If any duration is implausibly short, replace that track from a verified source, re-tag it, and repeat the full per-track check. Do **not** transfer or refresh Plex until all tracks pass.
39
+
40
+ ## 5. Resume safely after interruption
41
+
42
+ Treat a process timeout as an incomplete transaction. Enumerate staged FLACs and validate their tags/art/durations, rather than treating `EXISTS` as success. Re-run idempotent tagging over the complete track set, then validate again.
@@ -0,0 +1,35 @@
1
+ # Cover-art driven identification and verification
2
+
3
+ Use this pattern when the user sends an image instead of a clean text release name.
4
+
5
+ ## What worked in this session
6
+
7
+ - The image was a viewer screenshot, not just artwork.
8
+ - Vision identified the release from cover text: `74 Miles Away - Gear Change`.
9
+ - The tracker exact search did not return a hit for the release title.
10
+ - `yt-dlp` search found the exact YouTube upload:
11
+ - `https://www.youtube.com/watch?v=KDwMTXynA4w`
12
+ - title: `74 Miles Away - Gear Change // Single`
13
+ - The shorter official clip also existed, but the longer `// Single` upload was the better audio source.
14
+
15
+ ## Verification sequence
16
+
17
+ 1. Use the image as primary evidence for the release name.
18
+ 2. Try tracker search on artist and title.
19
+ 3. If tracker search returns nothing, search YouTube exact title.
20
+ 4. Prefer the cleanest full upload over a short clip when both exist.
21
+ 5. Download audio, tag it, write cover art, copy to NAS, then refresh Plex.
22
+ 6. Verify in Plex with the music section search endpoint, not the generic search endpoint.
23
+
24
+ ## Plex check that succeeded
25
+
26
+ - Section search endpoint:
27
+ - `GET /library/sections/2/search?type=10&query=Gear%20Change`
28
+ - The returned track proved the import landed in Plex:
29
+ - track title: `Gear Change`
30
+ - artist: `74 Miles Away`
31
+ - file path: `/volume1/music/library/74 Miles Away/2013 - Gear Change - Single/01 Gear Change.flac`
32
+
33
+ ## Why this matters
34
+
35
+ Image-driven requests are easy to misread if you trust OCR or the user's prose too early. The right flow is image first, tracker second, YouTube fallback third, Plex verification last.
@@ -0,0 +1,19 @@
1
+ # Image-driven album identification and verification
2
+
3
+ Use this when the user gives an attached cover image, a misspelled album title, or only partial artist/release text.
4
+
5
+ ## Pattern
6
+ 1. Treat the image as primary evidence for identifying the release.
7
+ 2. Use text search only to confirm the likely album, not to override the cover art.
8
+ 3. After download/import, verify both:
9
+ - the final NAS folder exists and contains audio files
10
+ - Plex can see the album/track(s) after refresh
11
+ 4. If the album title is uncertain, report the exact release name you actually matched, not the user's misspelling.
12
+
13
+ ## Session example
14
+ - User wrote: "Paul McCrtney (newsest one)" and attached album art.
15
+ - The matched release was `Paul McCartney - The Boys of Dungeon Lane`.
16
+ - Verification succeeded only after checking the final folder and confirming Plex search results returned the album and tracks.
17
+
18
+ ## Why this matters
19
+ Text-only guesses are fragile on new releases and misspellings. Cover art plus post-import verification avoids adding the wrong release or reporting success before Plex has indexed it.
@@ -0,0 +1,22 @@
1
+ # Library repair: folder consolidation and malformed FLAC handling
2
+
3
+ Use this when repairing an existing music library, not just ingesting one album.
4
+
5
+ ## Pattern
6
+ - Normalize artist variants to a canonical display name before deciding folder placement.
7
+ - Apply the same canonical mapping while aggregating batch dominance and while comparing per-file tags.
8
+ - Treat punctuation-only splits as real drift if they create duplicate artist folders in Plex.
9
+ - Sanitize destination folder names before joining paths. `AC/DC` is display text, not a path separator.
10
+ - If a FLAC is malformed (`invalid FLAC header`, `sample rate not set`), skip it, record it, and keep the batch moving.
11
+ - Refresh Plex after files reach their final NAS paths, then refresh again after any later tag or folder rename.
12
+
13
+ ## Session-specific pitfalls observed
14
+ - Safe folder naming must convert `/` to `-` before moving trees.
15
+ - Canonical artist normalization fixed GYBE variants by collapsing them to `Godspeed You! Black Emperor`.
16
+ - The repair pass surfaced two bad Twin Peaks FLACs that should be quarantined or skipped rather than retried as metadata issues.
17
+ - Raw error logs are noisy. Default to concise status unless the user explicitly asks for debug output.
18
+
19
+ ## Verification
20
+ - Spot-check canonical artists that previously split: GYBE, AC/DC, i/dex.
21
+ - Verify one folder per canonical artist on disk.
22
+ - Refresh Plex and confirm the duplicate artist entries disappear after the next scan.
@@ -0,0 +1,11 @@
1
+ # Malformed FLAC fallback notes
2
+
3
+ Session takeaways for bulk music library tag repair:
4
+
5
+ - `ffmpeg` can fail on some legacy FLACs with `sample rate not set` or `invalid FLAC header`.
6
+ - Treat these as file-level salvage failures, not library-wide failures.
7
+ - Prefer `mutagen` for tag writes first. Only fall back to `ffmpeg` when a file is structurally writable.
8
+ - If a FLAC header is invalid, record the path, skip it, and continue the batch. Do not retry indefinitely.
9
+ - After successful writes, refresh Plex only once the files are in their final NAS path.
10
+
11
+ This is a session note, not a general claim about all FLAC files.
@@ -0,0 +1,39 @@
1
+ # Manual fallback: NAS transfer and Plex verification
2
+
3
+ Use after a fully tagged/cover-embedded album is staged locally and the standard bot workflow cannot complete the import.
4
+
5
+ ## 1. Write preflight
6
+
7
+ Inspect the canonical location first: use an existing album by the same artist as the layout guide. Test the **exact final album directory** with a create/remove probe using the same SSH account that will transfer. If its parent is root-owned, ask for an **album-scoped** directory/ACL repair; never change ownership recursively across the library.
8
+
9
+ ## 2. Transfer without fragile rsync assumptions
10
+
11
+ Some bundled macOS `rsync` builds lack newer flags such as `--info=progress2`, and a remote-shell rsync session can behave differently from a standalone SSH probe. If rsync is unsuitable, send the staged directory through a tar stream over SSH:
12
+
13
+ ```bash
14
+ /usr/bin/tar -C "$LOCAL_ALBUM" -cf - . | \
15
+ ssh -i "$SSH_KEY" -o BatchMode=yes "$SSH_USER@$SSH_HOST" \
16
+ "tar -C '$NAS_ALBUM' -xf -"
17
+ ```
18
+
19
+ On macOS, this can create `._*` AppleDouble sidecars on the NAS. Remove only those sidecars from the newly created target folder, then verify that the count of normal `*.flac` files equals the expected track count and that `cover.jpg` exists.
20
+
21
+ ```bash
22
+ ssh -i "$SSH_KEY" -o BatchMode=yes "$SSH_USER@$SSH_HOST" \
23
+ "find '$NAS_ALBUM' -maxdepth 1 -type f -name '._*' -delete; \
24
+ find '$NAS_ALBUM' -maxdepth 1 -type f -name '*.flac' ! -name '._*' | wc -l; \
25
+ test -f '$NAS_ALBUM/cover.jpg'"
26
+ ```
27
+
28
+ ## 3. Refresh and prove Plex visibility
29
+
30
+ Run a targeted refresh first, then a plain section refresh if needed:
31
+
32
+ ```bash
33
+ mtp refresh --path "$NAS_ALBUM"
34
+ mtp refresh
35
+ ```
36
+
37
+ The refresh response only proves Plex accepted the request. Poll the Plex API for the album and verify **album title, artist, year, and track count**. Plex album (`type=9`) metadata uses `parentTitle` for the artist; `grandparentTitle` may be empty. To prove track visibility, request `GET /library/metadata/<ratingKey>/children` and count its metadata entries.
38
+
39
+ Treat an album as complete only after the NAS file count and Plex track count agree with canonical metadata.
@@ -0,0 +1,21 @@
1
+ # mtp-bot bulk import state safety
2
+
3
+ ## Why bulk album requests must be serialized
4
+
5
+ `mtp-bot` is a chat-scoped state machine. A search that needs a numbered choice leaves the chat in `AWAITING_PICK`; a later request is not an independent request. Concurrent handler calls can therefore collide with or overwrite the intended conversational flow.
6
+
7
+ ## Safe procedure
8
+
9
+ 1. Identify the exact artist and release scope before starting (for example, core studio albums vs. live, compilation, collaboration, or solo records).
10
+ 2. Check for an existing picker/state in the destination chat before sending any batch item.
11
+ 3. If a picker exists, preserve it. Only send `cancel` after the user has explicitly authorized cancelling that specific stale request.
12
+ 4. Send exactly one `mtp-bot handle` request.
13
+ 5. Read its reply before the next request:
14
+ - **Accepted/downloading:** record it and proceed to the next album only if the handler has returned to idle.
15
+ - **Numbered picker:** stop and ask the requester to choose; never guess a number.
16
+ - **No results / skipped / malformed parse:** stop the batch. Diagnose the request parser or source integration; do not substitute direct `mtp` search/add commands or claim that an import started.
17
+ 6. Verify the final album only when it is in the library path and visible in Plex/Plexamp.
18
+
19
+ ## Parsing degradation signal
20
+
21
+ If an otherwise clear message is parsed with artist/album words incorrectly divided, the LLM parser may have fallen back to its simplistic token-splitting heuristic. Treat this as a bot integration issue, not a reason to send malformed variants repeatedly. Preserve the chat state and repair or route the parser before continuing.
@@ -0,0 +1,13 @@
1
+ # mtp subprocess wrapper pitfall
2
+
3
+ Session finding:
4
+ - The bot path can accidentally execute the globally installed `mtp` wrapper instead of the checked-out project code.
5
+ - That hid a valid NAS connection behind an old launcher that was not exercising the current tree.
6
+
7
+ Preferred invocation during development:
8
+ - Use `uv run python -m mtp.bot.cli handle "<message>" --chat <chat_id>` to exercise the repo checkout.
9
+ - In `mtp/bot/mtp_client.py`, subprocesses should call `sys.executable -m mtp ...` so child calls stay on the same environment as the parent process.
10
+
11
+ Verification:
12
+ - Confirm the target NAS endpoint with `curl` or a direct Python request before blaming the network.
13
+ - If `mtp-bot` selection still looks wrong, inspect which launcher is being used before assuming the DS API is down.
@@ -0,0 +1,38 @@
1
+ # Music note blurb order
2
+
3
+ Use this exact order for artist/album notes:
4
+
5
+ 1. Artist note
6
+ 2. Album note
7
+ 3. Optional one-line DJ-style summary
8
+
9
+ Style:
10
+ - Write in the lane of WFMU, LDBK / Radio Brussels, and serious classic underground radio: crate-digger intelligence, warm human enthusiasm, sly humour, and a little beautiful weirdness.
11
+ - This is an original radio-DJ voice, not an imitation of any one station or presenter. Never name-drop the style in the note itself.
12
+ - Make listeners feel an invitation to listen: sensory, curious, vivid, and slightly dangerous when the record demands it. Prefer concrete musical images over generic praise.
13
+ - Include juicy, source-backed facts: recording/release context, label and year, collaborators/producers, samples or scene connections when verified, unusual backstory, chart/cultural impact, and one or two specific listening details. Facts should create intrigue, not become a Wikipedia dump.
14
+ - Separate fact from interpretation. If a fact is uncertain or unsourced, omit it or say it is a claim; never invent samples, personnel, labels, dates, or anecdotes.
15
+ - Artist note: establish the artist's lane, history, sound, collaborators, and why this artist matters before discussing the particular album.
16
+ - Album note: give the release year/label, key players and context, then explain what to listen for and why the record still matters.
17
+ - End with an optional one-line DJ cue or listening invitation that is tactile and specific, not promotional copy.
18
+ - Avoid reusable AI-blurb phrases and generic metaphors such as “summer breeze,” “bright telescope,” “one sneaker on the pavement,” “the room needs colour,” “key document,” or “still sounds fresh.” If a sentence could describe twenty unrelated albums, rewrite it.
19
+ - Do not use a fixed artist-note → atmospheric-album-note → generic-DJ-cue template mechanically. Vary the opening: a scene, an odd fact, a collaborator, a production decision, a historical collision, a lyric-level observation, or a listener challenge.
20
+ - Every album note should contain at least two genuinely specific hooks: an unusual verified fact, a named musical relationship explained in context, a concrete production/sample detail, a scene or label connection, or a precise moment to listen for. Names alone are not facts.
21
+ - **Editorial attitude:** WFMU is not merely poetic wording. Make the note feel like a live, adventurous radio segment: playful, eccentric, conversational, anti-commercial, and happy to take a funny detour. Let the host sound delighted by the discovery. Use odd connections, affectionate mischief, sharp asides, mini cliffhangers, and unexpected turns when the facts support them.
22
+ - The prose may be lopsided, funny, slangy, or slightly unruly. It should sound like a person with a crate, a microphone, and genuine excitement—not a critic delivering a verdict or a label polishing a campaign.
23
+ - Facts should enter through personality: “Here’s the strange bit…”, “Listen for what happens after…”, “This is where the record gets gloriously sideways…” Use that energy without forcing these exact phrases every time.
24
+ - Ban commercial-review language and prestige fog: “sonic journey,” “immersive experience,” “genre-defining,” “landmark,” “timeless masterpiece,” “a testament to,” and similar claims unless directly quoted and necessary.
25
+ - Fun does not mean shallow. Keep the juicy verified facts, but let them trigger curiosity, jokes, and listener invitations rather than sit as a dry credits list.
26
+ - Before saving, perform a replaceability test: delete the album and artist names. If most of the note still works for another record, it is too generic and must be rewritten.
27
+
28
+ Recommended note structure in Obsidian:
29
+
30
+ ```md
31
+ # Artist - Album
32
+
33
+ ## Artist note
34
+ ...
35
+
36
+ ## Album note
37
+ ...
38
+ ```
@@ -0,0 +1,16 @@
1
+ # NAS import and Plex refresh note
2
+
3
+ Use this workflow when importing an album into the NAS music library and refreshing Plex afterwards.
4
+
5
+ ## What worked in this session
6
+ - Source can be a chaptered YouTube/vinyl rip when it contains a clean track breakdown.
7
+ - Inspect chapters first to confirm track count and titles before tagging.
8
+ - Stage files locally, tag them, then transfer to the NAS over SSH if direct writes to the library path are blocked by permissions.
9
+ - If the final library path is root-owned, use an interactive SSH `sudo` move on the NAS rather than trying to bypass permissions from the local machine.
10
+ - Expected destination pattern:
11
+ - `/volume1/music/library/<genre>/<Artist>/<Album (Year)>`
12
+ - After the move, refresh the Plex music section so the new album is indexed.
13
+ - Verify the remote album folder contains the expected track count before closing out.
14
+
15
+ ## Output preference
16
+ - Keep user-facing confirmation short. Do not dump command output unless the user asks for it.
@@ -0,0 +1,31 @@
1
+ # NAS library layout and write preflight
2
+
3
+ Use this before transferring a manually staged fallback album. Treat `nas_music` in app configuration as a storage root, **not proof of Plex's scanned folder layout**.
4
+
5
+ ## Preflight
6
+
7
+ 1. Inspect an existing album by the same artist when possible. This reveals the real Plex tree (for example, an artist-first `library/<Artist>/` layout rather than a proposed genre bucket).
8
+ 2. Check that the configured SSH account can create the target directory before staging a large fallback:
9
+
10
+ ```bash
11
+ ssh -i ~/.ssh/id_ed25519 -o BatchMode=yes <user>@<host> \
12
+ "test -d '<parent>' && test -w '<parent>' && printf WRITABLE"
13
+ ```
14
+
15
+ 3. If the artist folder exists but is not writable, do not silently place the album in an arbitrary writable genre folder. Keep the release staged and report the permission blocker.
16
+
17
+ ## Least-privilege repair
18
+
19
+ Have the NAS owner create **only the target album directory**, then grant the transfer account ownership. Avoid recursively changing ownership of the whole music library.
20
+
21
+ ```bash
22
+ sudo mkdir -p "/volume1/music/library/<Artist>/<Album> (<Year>)"
23
+ sudo chown -R <transfer-user>:users "/volume1/music/library/<Artist>/<Album> (<Year>)"
24
+ sudo chmod 755 "/volume1/music/library/<Artist>/<Album> (<Year>)"
25
+ ```
26
+
27
+ The `sudo` password must be entered by the NAS owner in an interactive shell; never ask them to paste it into chat. Afterward, transfer into that album-only directory, verify file count/cover/permissions, then run the Plex refresh.
28
+
29
+ ## Why it matters
30
+
31
+ A successful download and correct tags do not establish Plex readiness. A wrong scanned root or non-writable parent folder can make a genre-based transfer both inaccessible to Plex and inconsistent with the existing library.
@@ -0,0 +1,26 @@
1
+ # NAS permission repair and Plex traversal
2
+
3
+ Use when a staged album cannot be copied into the canonical Plex music library, or Plex is not indexing files after a successful copy.
4
+
5
+ ## Scope the repair narrowly
6
+
7
+ - Do **not** recursively `chown` the broad `/volume1/music` share just to enable one import.
8
+ - If the owner explicitly wants durable managed imports, grant ownership/write access at the configured Plex **library root** (for this environment, `/volume1/music/library`) only.
9
+ - Verify it with a real SSH probe: create a unique temporary directory, write a file inside it, remove both, then inspect ownership/mode.
10
+
11
+ ## Permissions to verify
12
+
13
+ 1. Managed import account can create an artist directory below the library root.
14
+ 2. Every parent from the Plex section root through `Artist/Album` is traversable by the Plex process. Use `755` for artist and album directories unless the Plex service group has been deliberately granted equivalent execute access.
15
+ 3. Do not infer traversal from file readability. A `770` artist directory can prevent scanning even though the account that transferred the FLACs can read the album.
16
+
17
+ ## Transfer fallback
18
+
19
+ If the NAS rsync implementation cannot support the desired safe flags or preservation semantics, stream the already-validated album using `tar` over SSH into the final directory. On macOS-originated sources, remove `._*` AppleDouble sidecars afterward and verify the exact FLAC count on NAS before triggering Plex refresh.
20
+
21
+ ## Plex evidence order
22
+
23
+ 1. Refresh the music section after permissions and copy are final.
24
+ 2. Query the Plex DB for `media_parts` at the final path.
25
+ 3. Read album metadata and track children through Plex API/DB; do not rely only on a fuzzy library-search query.
26
+ 4. Compare the returned track count and sequence with the canonical release tracklist.
@@ -0,0 +1,22 @@
1
+ # NAS routing and Plex refresh
2
+
3
+ Session takeaway:
4
+ - For albums that must land in a genre bucket, the final Plex path matters more than the download origin.
5
+ - If the intended genre bucket does not exist or cannot be written by the organizer, create a writable bucket first and move the album there instead of leaving it in `unsorted`.
6
+ - After moving files into the final NAS music folder, trigger a Plex music library refresh for the correct section.
7
+ - If tags are corrected after the move, refresh again. Plex refresh does not retroactively fix a wrong folder placement; it only re-indexes what is already on disk.
8
+
9
+ Case study from this session:
10
+ - Iron Maiden albums ended up in `/volume1/music/metal/Iron Maiden/...` after the metal bucket was made writable.
11
+ - A later metadata correction from `Pop` to `Heavy Metal` required another Plex refresh.
12
+
13
+ Reusable order of operations:
14
+ 1. Confirm the album's real tags.
15
+ 2. Ensure the target NAS bucket exists and is writable.
16
+ 3. Move the album into the final Plex-rooted path.
17
+ 4. Refresh Plex section 2.
18
+ 5. Verify PlexAmp can actually see the album after the refresh. If it cannot, re-check the on-disk path before assuming the scan succeeded.
19
+ 6. If tags changed, refresh Plex again.
20
+
21
+ Session note:
22
+ - In one follow-up, Plex was refreshed successfully but PlexAmp still showed nothing. The fix path was to re-verify the album's final library location instead of trusting the refresh alone.
@@ -0,0 +1,28 @@
1
+ # Album fallback when `mtp-bot` has no release result
2
+
3
+ Use this only after the album handler returns an actual no-result outcome and the user has explicitly asked to continue the import. A bot/provider parsing or source-search failure is not a reason to end the job with a status report.
4
+
5
+ ## Fail-closed, track-by-track fallback
6
+
7
+ 1. Resolve an original official release in MusicBrainz. Record its release ID, release year, ordered tracks, and canonical durations.
8
+ 2. Prefer separate source audio per track over a single full-album upload. This produces real track boundaries and avoids cumulative timing drift when an upload has missing/extra intro or outro seconds.
9
+ 3. For each track, query using artist + track title + album. Accept a source only if:
10
+ - normalized source title contains the canonical track title;
11
+ - duration is plausibly close to the canonical duration;
12
+ - it is not visibly a video, remix, live take, or edit unless that is the canonical track.
13
+ Search normalization is only a first pass: canonical punctuation and wording often differ (`Parts` vs `Pts`, curly apostrophes, or ellipses). For a missed title, manually compare candidate title and MusicBrainz duration, record the chosen URL as an explicit override in the source manifest, then resume only the missing track — never relax the filter globally.
14
+ 4. Resolve the canonical genre from MusicBrainz (or another authoritative release source) before final tagging. Convert, then tag every output with artist, album artist, album, title, release year, **genre**, track number/total, and MusicBrainz release ID. Embed a verified front-cover image in every FLAC. Use that same genre value to build the final Plex library path, so the tag and `Genre/Artist/Album (Year)` folder agree.
15
+ 5. Verify the output file opens, has the required tags and embedded art, and is in the final artist/album folder structure before transfer.
16
+ 6. Transfer to the NAS Plex root only when the NAS is reachable. Then refresh Plex, inspect the album/track count in Plex/Plexamp, and only then report completion.
17
+
18
+ ## Full-album uploads
19
+
20
+ Only use a continuous full-album upload if individual tracks are unavailable. Split against a canonical cue/timing sheet, inspect boundaries with silence detection and waveform/listening checks, and do not rely on proportional timestamps alone. A duration mismatch between the upload and the canonical release is a red flag for a different master, gap structure, or intro/outro.
21
+
22
+ ## Communication rule
23
+
24
+ Do not stop at “the source returned zero results” when the user has asked for the music. State the fallback being launched, make real progress, and distinguish:
25
+
26
+ - **staged locally** from
27
+ - **transferred to NAS** from
28
+ - **verified visible in Plex/Plexamp**.
@@ -0,0 +1,12 @@
1
+ # Per-track album-art split
2
+
3
+ Use this when a DJ crate or batch import shows the same cover for every track, but each track actually belongs to a different release.
4
+
5
+ ## Pattern
6
+ - If tracks are from different albums, do not try to force one shared album folder.
7
+ - Split files into one folder per release before Plex refresh.
8
+ - Keep embedded art on each file, but make the folder path match the release so Plex reads the right parent album.
9
+ - Refresh the Plex audio section only after the files are in their final per-album locations.
10
+
11
+ ## Session note
12
+ In the Deep Lineage Set case, the tracks were moved from one staging folder into release-specific folders like `Washing Machine/`, `Altered States/`, and `Tourist/`, then Plex was refreshed. That was the right fix for the "same art for every track" symptom.
@@ -0,0 +1,18 @@
1
+ # Plex playlist append and verification
2
+
3
+ Use this when a playlist already exists and needs more items added.
4
+
5
+ ## What worked in this session
6
+
7
+ - Read the playlist shell first: `GET /playlists/{playlist_id}`.
8
+ - Read the current contents back with: `GET /playlists/{playlist_id}/items`.
9
+ - Append library tracks with: `PUT /playlists/{playlist_id}/items?uri=server://{machineIdentifier}/com.plexapp.plugins.library/library/metadata/{ratingKey}`.
10
+ - For multiple tracks, repeat the `uri` param once per item in the same request or loop one-by-one when order matters.
11
+ - Verify by reading back `leafCount` and the returned `Metadata` item list.
12
+
13
+ ## Pitfalls
14
+
15
+ - A successful PUT response is not enough. Always confirm the playlist item list changed.
16
+ - If Plex returns a shell with `leafCount: 0`, do not assume creation failed. It may just need item appends.
17
+ - Use the Plex server's `machineIdentifier` from `/identity` when building `server://...` URIs for library items.
18
+ - If a requested track does not move the count, the add may have been a duplicate or the URI may be wrong. Re-read the item list before retrying.
@@ -0,0 +1,21 @@
1
+ # Plex playlist creation from existing library tracks
2
+
3
+ Session finding:
4
+ - The Plex server accepted playlist creation through the standard library API, not through the app UI.
5
+ - Tracks can be resolved by section search using `type=10`, `title`, and `artist`, then referenced by `ratingKey`.
6
+ - Playlist creation used a `server://<machineIdentifier>/com.plexapp.plugins.library/library/metadata/<comma-separated ratingKeys>` URI.
7
+
8
+ Working sequence:
9
+ 1. Read `/identity` with the Plex token to get `machineIdentifier`.
10
+ 2. Search the music section for each track and capture the track `ratingKey`.
11
+ 3. POST to `/playlists` with:
12
+ - `title=<playlist name>`
13
+ - `type=audio`
14
+ - `smart=0`
15
+ - `uri=server://<machineIdentifier>/com.plexapp.plugins.library/library/metadata/<ratingKey1>,<ratingKey2>,...`
16
+ 4. Verify by GETting `/playlists/<id>/items` and checking leaf count / order.
17
+
18
+ Pitfalls:
19
+ - Track search can 400 if you use the wrong query shape. `type=10&title=...&artist=...` worked here.
20
+ - Do not assume `search?query=` works for music tracks.
21
+ - Verify the playlist contents after create, not just the create response.
@@ -0,0 +1,20 @@
1
+ # Plex token source
2
+
3
+ Session note:
4
+ - Secrets (`PLEX_TOKEN`, `SYNO_USER/PASS`, `RUTRACKER_USER/PASS`, `TELEGRAM_BOT_TOKEN`)
5
+ live in `~/.config/music-to-plex/.env`, NOT in `config.toml`. `config.toml` holds
6
+ only non-secret structure (URLs, `music_section_id`, paths).
7
+ - `Config.load()` sources that `.env` automatically (via `load_env()`), so every
8
+ entrypoint — `mtp`, `mtp-bot`, `mtp doctor` — sees the token without the shell
9
+ having to `export` anything. If a check says "PLEX_TOKEN not set", the fix is the
10
+ `.env` file, not the shell env and not `config.toml`.
11
+ - Verify quickly with: `mtp doctor` (look for "PLEX_TOKEN set" and
12
+ "Plex reachable + token valid").
13
+ - Do not echo the token in chat or logs; use it only for local verification.
14
+
15
+ If the token is missing from `.env`, fetch it from the NAS Preferences.xml:
16
+
17
+ ssh beheerder@192.168.178.245 'grep -oE "PlexOnlineToken=\"[^\"]+" \
18
+ "/volume1/PlexMediaServer/AppData/Plex Media Server/Preferences.xml"'
19
+
20
+ then add `PLEX_TOKEN=<value>` to `~/.config/music-to-plex/.env`.
@@ -0,0 +1,28 @@
1
+ # Plex visibility check when PlexAmp shows nothing
2
+
3
+ Use this when the album was supposedly imported, a refresh was triggered, but PlexAmp still returns no results.
4
+
5
+ ## Check order
6
+
7
+ 1. Verify the album is on the NAS in the final Plex-rooted music path, not a staging/download directory.
8
+ 2. Verify the final folder name matches the canonical album/artist/year structure that Plex scans.
9
+ 3. Refresh Plex *after* the files are in the final path.
10
+ 4. Query Plex by track or album title and artist. If search size is 0, Plex has not indexed the content yet.
11
+ 5. If the content exists on disk but Plex still sees 0 results, treat it as a path/layout problem first, not a rescan problem.
12
+
13
+ ## Practical rule
14
+
15
+ A successful refresh is not proof of visibility. The only reliable proof is:
16
+ - audio files exist in the final library path, and
17
+ - Plex search returns matching tracks/albums.
18
+
19
+ Use Plex's own search endpoint with the album title and at least one track title. If the album appears but tracks do not, the folder landed but indexing is incomplete.
20
+
21
+ ## Failure mode now covered
22
+
23
+ If Plex search stays at `size=0` after refresh and the scanner later crashes, treat the scanner crash as the root signal. Do not keep retagging or re-refreshing the album until the log or crash report explains why Plex never indexed it.
24
+
25
+ ## Pitfalls from this session
26
+
27
+ - A root-owned `700` album folder blocked Plex traversal even though the files were present. Fix the directory to `755` before refresh so Plex can traverse it on first scan.
28
+ - An album folder existed on disk under the expected `Various Artists/...` tree, but Plex search still returned `size=0` for title and track queries until the final path was re-verified and refresh was repeated.
@@ -0,0 +1,18 @@
1
+ # DJ practice crate playlist notes
2
+
3
+ Session lesson:
4
+ - When the user says the playlist is for DJ practice, treat it as a **practice crate**, not a general listening set.
5
+ - Tighten the set by favoring steady, mix-friendly tracks over vibes alone.
6
+
7
+ Selection heuristics:
8
+ - Keep tracks with stable tempo and phrasing.
9
+ - Prefer long intros/outros, clean drum passages, and predictable transitions.
10
+ - Favor instrumental or sparse-vocal tracks for controller drills.
11
+ - Remove tracks that are too short, too busy, or better as listening-only picks.
12
+
13
+ Playlist update pattern:
14
+ - If an existing playlist has drifted, **replace/trim** it instead of only appending more tracks.
15
+ - After edits, verify final contents by reading back the Plex playlist items.
16
+ - For bulk adds/removals in Plex, use the playlist items endpoint and confirm the resulting leaf count.
17
+
18
+ This file is intentionally narrow and session-derived. The umbrella skill should stay class-level; use this reference for the exact practice-crate curation pattern.
@@ -0,0 +1,13 @@
1
+ # Session note: Synology probe and mtp-bot mismatch
2
+
3
+ When `mtp-bot handle "add <album>"` reported `No route to host` against `192.168.178.245:5000`, direct network probes showed the NAS was reachable and the Synology API responded.
4
+
5
+ Observed checks:
6
+ - `curl http://192.168.178.245:5000/webapi/query.cgi?...` returned `{"success":true}` for `SYNO.API.Auth`.
7
+ - `/usr/bin/python3` socket connect to `192.168.178.245:5000` and `:5001` succeeded.
8
+ - `curl --cookie ~/.config/music-to-plex/cookies.txt https://rutracker.org/forum/dl.php?t=3296838` downloaded the torrent.
9
+ - Direct Synology API calls with `curl` succeeded and `task.cgi?method=create` returned `{"success":true}`.
10
+ - The created task showed up in Download Station as `dbid_806` with status `downloading`.
11
+
12
+ Takeaway:
13
+ - If the bot path fails but direct curl/API probes succeed, treat it as a bot runtime/context issue and verify the Synology call sequence with curl before changing album selection or torrent handling.
@@ -0,0 +1,62 @@
1
+ # Torrent Stall & YouTube Fallback Pattern
2
+
3
+ **Context:** May 2026 session adding "Dexter Gordon — Go" to Plex revealed a reliability pattern in RuTracker sourcing.
4
+
5
+ ## The Pattern
6
+
7
+ RuTracker torrent searches often succeed (find 5–10 versions), but the selected torrent may:
8
+ - Have low/stalled seeders
9
+ - Stall at 0% or low % for 5+ minutes
10
+ - Eventually timeout or fail silently
11
+
12
+ Rather than wait indefinitely, the workflow should detect stall within 5 minutes and pivot to YouTube + MP3.
13
+
14
+ ## Dexter Gordon — Go (Case Study)
15
+
16
+ Search returned multiple FLAC versions:
17
+ - `[SACD-R][OF] Dexter Gordon – Go - 2010` (9 seeds, 1 GB)
18
+ - `[TR24][OF] Dexter Gordon - Go - 1962/2013` (8 seeds, 1 GB)
19
+ - `(Bop, Hard Bop) [CD] Dexter Gordon - Go! - 1962 (1989 Japan Edition), FLAC` (7 seeds, 254 MB) ← often a safe choice: smaller, older, established peers
20
+ - `[CD] Dexter Gordon - GO-RVG Edition - 1962 {1998 Blue Note RVG}` (5 seeds, 307 MB) ← audiophile remaster
21
+
22
+ **Watch for:** even 7–9 seeds may not mean fast peers. Seed count ≠ reachability.
23
+
24
+ ## 5-Minute Timeout Rationale
25
+
26
+ - 30 seconds: too aggressive, may give up on legitimate slow starts
27
+ - 5 minutes: Oleg's preference — balances hope vs. pragmatism
28
+ - 10+ minutes: frustrating UX; YouTube is known-good
29
+
30
+ ## YouTube Fallback Quality
31
+
32
+ When switching to YouTube, the skill currently:
33
+ 1. Fetches full album via `yt-dlp`
34
+ 2. Extracts audio to `.opus` or `.mp3`
35
+ 3. Rewrites ID3 tags (artist, album, genre)
36
+ 4. Moves to NAS via SSH
37
+ 5. Refreshes Plex
38
+
39
+ Result: playable album in Plexamp. Quality is typically 128–320 kbps MP3 (YT limits). Not lossless, but reliable and fast.
40
+
41
+ ## Detection & Automation (current behavior — June 2026)
42
+
43
+ This is now **automated and interactive**. The background notifier
44
+ (`mtp-notify`) polls `mtp status <task_id>` every 30s. If percent-done stays
45
+ flat for the stuck window (default 10 min; `stuck_timeout` in the chat-state
46
+ blob), it flips the chat to the `STUCK` state and posts a message with **four
47
+ numbered options** — it does NOT auto-pivot to YouTube:
48
+
49
+ ```
50
+ 1️⃣ Wait 1 more hour
51
+ 2️⃣ Wait N hours (asks how many)
52
+ 3️⃣ Try the next release in the list ← deletes stuck task, auto-picks next by seeds
53
+ 4️⃣ Grab it from YouTube in highest quality
54
+ ```
55
+
56
+ The user's reply (`1`–`4`, a count of hours, or "next"/"youtube") is passed
57
+ verbatim to `mtp-bot handle`, which routes it through the `STUCK` /
58
+ `STUCK_WAIT_INPUT` handlers in `mtp/bot/machine.py`. Option 4 returns the
59
+ `__YOUTUBE_FALLBACK__` signal that hands the YouTube acquisition to Hermes.
60
+
61
+ Operator choice is preserved by design — the user decides per-stall, rather than
62
+ the tool silently switching sources.
@@ -0,0 +1,17 @@
1
+ # Verification and pitfalls
2
+
3
+ Session takeaway:
4
+ - The bot can print a successful download-start message even if the follow-up notification step fails.
5
+ - In this case, the started download later showed a local album folder at `/Volumes/home/downloads/Fear Of The Dark` containing the FLAC tracks.
6
+ - `mtp-notify` originally failed with `album required` because the bot passed `task_id` + `chat_id` and the notifier expected full metadata. The durable fix was to resolve `artist` and `album` from `~/.config/music-to-plex/bot-state.db` when they are omitted.
7
+ - The downloaded FLAC also had a bad `genre` tag (`Pop`), which can misroute the album during organize. Verify tags before moving anything into the Plex library.
8
+
9
+ Verification pattern:
10
+ 1. Treat the bot's "Downloading ..." output as a start signal, not proof of completion.
11
+ 2. Check the configured mount download directory for the album folder.
12
+ 3. Confirm actual audio files exist inside the folder before telling the user the album is ready.
13
+ 4. If the notification helper errors, report that separately from download state.
14
+ 5. If tags look wrong, fix or override them before organize, otherwise Plex refresh will not correct the folder placement.
15
+
16
+ Known local path from this session:
17
+ - `/Volumes/home/downloads/Fear Of The Dark`
@@ -0,0 +1,17 @@
1
+ # YouTube download fallback for music-to-plex
2
+
3
+ When a track rip fails with `HTTP Error 403: Forbidden` or `unable to download video data`, retry `yt-dlp` with a different YouTube client before abandoning the source.
4
+
5
+ ## Proven retry order
6
+
7
+ 1. Standard extraction.
8
+ 2. Retry the same verified URL with `--extractor-args 'youtube:player_client=android'`.
9
+ 3. If it still fails, use the next **already verified** candidate from the album source manifest (same canonical title and duration). Do not restart or discard the successfully staged tracks.
10
+ 4. If no verified alternative remains, leave only that track unresolved and report the exact gap; do not fill it with an unverified remix, live take, or unrelated upload.
11
+
12
+ ## Practical notes
13
+
14
+ - The Android client can surface working media URLs when the default client gets blocked.
15
+ - This is a retry pattern, not a guarantee. If it still 403s, stop burning time on the same URL.
16
+ - Keep the exact album folder and cover placement workflow separate from track acquisition. Cover art can usually be finalized even when the rip path is blocked.
17
+ - When the final import succeeds, remember to verify the NAS folder permissions too. A `700` directory owned by root can make Plex ignore the album even though the files download cleanly.