## Description
Fixes#7002.
Both `py7zr` and `rarfile` are optional dependencies specified under the
`import` extra (`beets[import]`).
When running the test suite in environments where `py7zr` is not
installed (e.g. minimal packaging buildroots such as Fedora Rawhide),
`ArchiveImportTask.handlers` does not register the 7z extraction
handler. Consequently, `TestImport7z` runs unconditionally and treats
`archive.7z` as an ordinary file rather than an archive, failing with:
```text
FAILED test/test_importer.py::TestImport7z::test_import_zip
E assert 0 == 1
E + where 0 = len(<beets.dbcore.db.Results object>)
E + where <beets.dbcore.db.Results object> = items()
WARNING beets:stages.py:58 No files imported from .../test/rsrc/archive.7z
```
Additionally, `TestImportRar` previously checked only for the presence
of the `unrar` executable via `has_program("unrar")`, but extraction
also depends on the Python `rarfile` package being importable.
This PR:
1. Adds `NEEDS_PY7ZR` (`is_importable("py7zr")`) and `NEEDS_RARFILE`
(`is_importable("rarfile") and has_program("unrar")`) test skip markers
in `beets.test.helper`.
2. Marks `TestImport7z` with `@NEEDS_PY7ZR`.
3. Marks `TestImportRar` with `@NEEDS_RARFILE`.
4. Adds an unreleased bug fix entry to `docs/changelog.rst`.
## To Do
- [x] ~Documentation.~
- [x] Changelog.
- [x] Tests.
LRCLIB commonly returns LRC timestamps with 3 decimal places ([mm:ss.xxx]).
LINE_PARTS_PAT and LRC_TIMESTAMP_PAT strictly expected two digits (\.\d\d),
causing verify_synced_lyrics to fail when the final line of a song has
millisecond precision (e.g. Final Light - Final Light ending with [06:07.301])
and fall back to plain text.
Additionally, interior 3-decimal lines had timestamps dropped from ID3 SYLT
frames and leaked raw bracketed tags into plain text extraction.
- Update regexes to accept \.\d{2,3}
- Parse both 2-digit (cs) and 3-digit (ms) fractions in Lyrics.sylt
- Add unit tests and changelog entry
When beets can't confidently match an album, the interactive import
prompt now offers a "Rescan directory" option alongside Skip/Use
as-is/etc. It re-reads the task's directories from disk and re-runs
the match, so files can be cleaned up (duplicates, junk) mid-import
without restarting the whole beet import run.
- New Action.RESCAN enum member (actions.py) and set_choice wiring
(tasks.py).
- New "r" PromptChoice, shown for album tasks with a toppath, added
to both the "no candidates" and "pick a candidate" prompt variants
since they share the same choice list (session.py).
- New rescan_tasks() generator and a RESCAN branch in the user_query
pipeline stage that re-extends the pipeline with freshly-discovered
tasks, mirroring the existing TRACKS/ALBUMS branches (stages.py).
Discovery is delegated to ImportTaskFactory.paths(), the same logic
the initial scan uses; rescan_tasks only scopes the walk and keeps
the original toppath on the emitted tasks (for move pruning and
resume bookkeeping).
- Handles nested multi-disc albums, flattened sibling discs, the
"Group albums" choice (withheld -- no directory scope to rescan),
and a plugin forcing Action.RESCAN onto a task with no valid rescan
scope (singleton, toppath-less, or grouped).
- Tests, auto-tagger guide entry, changelog entry.
Comments and docstrings are kept deliberately brief per review
feedback; see the PR description for the fuller design rationale and
the known limitations (sibling-disc/loose-parent edge cases).
Fixes#166
Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_019mndYhbgqCtkRY3wppFoQb
Rewrite the plugin documentation in the current style with dedicated
sections on authentication, usage, and configuration, and mark the
manual `token` option as deprecated. Add a changelog entry for the
new `beet plexupdate --auth` command.
TrackInfo expects the converted ISO 8601 duration in its length
field. The plugin passed it as duration instead, which TrackInfo
silently stores as a flexible attribute while length stays None, so
Tidal candidates were matched without any track-length distance.
Pass the duration as length and update the parsing tests to assert
info.length instead of the incorrect info.duration flex field.
LRCLib stores track metadata independently of the lyrics themselves, so an
entry can come back with both `plainLyrics` and `syncedLyrics` null while
`instrumental` is False. `LRCLyrics.is_valid` accepted such an entry as a
match on duration alone, and `get_text` then returned `self.plain`, i.e.
None, despite being annotated `-> str`.
The None propagated into `Lyrics`, and the first access of its text raised
AttributeError: 'NoneType' object has no attribute 'splitlines'
`beet lyrics` surfaced this per track, but during an import the exception
escaped the pipeline stage and aborted the entire run: one such track
stranded every file queued behind it.
Treat an entry with no lyrics text as not a match, so the search moves on to
other candidates and backends and ultimately reports that no lyrics were
found. That is deliberately distinct from an instrumental track, where "no
lyrics" is itself the answer and the existing `instrumental` handling still
applies. Marking these as instrumental would assert something the API
response does not tell us.
Also fall back to synced lyrics when only `plainLyrics` is null, rather than
discarding lyrics we do have, and correct the annotations: `plainLyrics` and
`LRCLyrics.plain` are both nullable.