Metadata-Version: 2.4
Name: beets-lrc
Version: 0.1.0
Summary: Write .lrc sidecars from lyrics fetched by the lyrics plugin.
Keywords: beets,lrc,lyrics,metadata,music
Author: Mikie
License-Expression: MIT
License-File: LICENSE
Classifier: Development Status :: 4 - Beta
Classifier: Environment :: Console
Classifier: Intended Audience :: End Users/Desktop
Classifier: Topic :: Multimedia :: Sound/Audio
Requires-Dist: beets[lyrics]>=2.14.1
Requires-Python: >=3.12
Project-URL: Homepage, https://codeberg.org/mikie/beets-lrc
Project-URL: Issues, https://codeberg.org/mikie/beets-lrc/issues
Project-URL: Repository, https://codeberg.org/mikie/beets-lrc
Description-Content-Type: text/markdown

# beets-lrc

Write `.lrc` sidecar files from synced lyrics fetched by beets' built-in `lyrics` plugin. Zero network access — reads only what beets already stored in the database.

Servers like Plex (and some other music servers/DAPs that support synced lyrics) only read lyrics from `.lrc` sidecar files, not from the audio file's metadata tags. This plugin bridges that gap: let beets' `lyrics` plugin fetch and embed lyrics as usual, and `beets-lrc` mirrors them out to sidecar files your server will actually see.

## Features

- **One command sweep**: `beet lrc [QUERY]` — writes sidecars for all synced lyrics in your library
- **Auto on import**: Sidecars written automatically when albums/singles are imported
- **Manual `beet lyrics` catch**: `after_write` hook catches lyrics added later via `beet lyrics -f`
- **Dry-run mode**: `beet lrc -n` — see what would be written without touching anything
- **Canonical detection**: Uses beets' own `Lyrics.from_item()` — synced classification always matches `--keep-synced`
- **Theme-aware output**: Follows beets' `colors:` config, respects `color: no`

## Installation

From PyPI (preferred):

```bash
uv tool install beets -w beets-lrc
```

Or from source (gross...):

```bash
git clone https://codeberg.org/mikie/beets-lrc.git
cd beets-lrc
uv sync
```

Add to your beets config:

```yaml
plugins: lyrics lrc

lyrics:
  synced: yes # enable synced lyric fetching
  sources: [lrclib] # or your preferred backend(s)

lrc:
  auto: yes # write sidecars automatically on import (default: yes)
  overwrite: no # don't clobber existing .lrc files (default: no)
```

## Usage

```bash
# Sweep entire library
beet lrc

# Scope to an artist/album
beet lrc 'artist:Spiritbox'
beet lrc 'album:Tsunami Sea'

# Dry-run (preview output without writing)
beet lrc -n

# Force rewrite existing sidecars
beet lrc -f

# Also list tracks whose sidecar already exists
beet lrc -a

# Quiet mode (summary only)
beet lrc -q
```

Output format:

```
Wrote     Spiritbox, Tsunami Sea, Keep Sweet
Kept      Polaris, Fatalism, Inhumane
Unsynced  Daisy Grenade, So Much To Say, Emily
Missing   ...

11 Wrote, 49 Kept, 2 Unsynced, 0 Missing
```

The verb shows the track's status; artist, album, and track are colorized per your beets theme.

## Notes

Synced availability depends on your lyrics backend. For LRCLib, a synced candidate is rejected if its duration differs from your track by more than 5%, or if its last timestamp exceeds your track length — in those cases the track stays plain.

## License

MIT — same as beets.
