# beets-mpd-utils
Some [beets](https://beets.io/) plugins to interface with [Music Player Daemon](https://www.musicpd.org/).
- [MPD Tracker](#mpd-tracker): Track song plays/skips on MPD.
- [MPD DJ](#mpd-dj): Auto-add songs/albums to your MPD queue.
## Installation
Install the plugin.
```bash
pip install beets-mpd-utils
```
Enable the plugin by adding it the `plugins` option in your beets config.
```yaml
plugins: mpd_tracker, mpd_dj
```
## Provided Plugins
### MPD Tracker
The `mpd_tracker` plugin tracks song plays and skips on MPD and records them in the following flexible attributes:
- Song
- `play_count`: The number of times the song has been played.
- `last_played`: When the `play_count` was last updated.
- `skip_count`: The number of times the song has beed skipped.
- Album
- `last_played`: Only written once every song in the album has been played. Defined as the oldest `last_played` value for the songs in the album.
#### Usage
Once enabled, start the tracker by typing:
```bash
beet tracker
```
#### Configuration
To configure, make a `mpd_tracker` section in your beets config file. Songs will be considered played/skipped if either of the time/percentage thresholds are met.
The available options are:
- **play_time**: The amount of seconds played after which the song will be considered "played". Default: `240`.
- **play_percent**: The percentage of the song that needs to be played before being considered "played". Expects a value between `0` and `1`, default: `0.5`.
- **skip_time**: The amount of seconds played before which the song will be considered "skipped". Default: `20`.
- **skip_percent**: The percentage of the song that needs to be played before which the song will be considered "skipped". Expects a value between `0` and `1`, default: `0.0`.
### MPD DJ
The `mpd_dj` plugin randomly adds items to the MPD queue. Note that activating this plugin will turn off random mode in MPD, as it needs to know what songs are upcoming in the queue.
#### Usage
Once enabled, start the tracker by typing:
```bash
beet dj
```
By default, the plugin will work to maintain 20 upcoming songs, selected randomly from the library. These defaults can be changed using command-line options.
- `--number=ITEMS`, `-n ITEMS`: The plugin will maintain the specified number of items in the upcoming queue.
- `--album`, `-a`: The plugin will queue albums instead of songs.
In addition, you can enter a [query](https://beets.readthedocs.io/en/stable/reference/query.html) to specify what will be added to the queue.
```bash
# maintain 5 albums in the queue, pulling randomly from albums released in 2022
beet dj -n 5 --album year:2022
```
Raw data
{
"_id": null,
"home_page": null,
"name": "beets-mpd-utils",
"maintainer": null,
"docs_url": null,
"requires_python": "<4.0,>=3.12",
"maintainer_email": null,
"keywords": "beets, MPD, music player daemon, music",
"author": null,
"author_email": null,
"download_url": "https://files.pythonhosted.org/packages/24/3b/d11385f28fe8c375d0e15af69a2796a3cba5729c517598f83f870312fb3c/beets_mpd_utils-0.1.4.tar.gz",
"platform": null,
"description": "# beets-mpd-utils\n\nSome [beets](https://beets.io/) plugins to interface with [Music Player Daemon](https://www.musicpd.org/).\n\n- [MPD Tracker](#mpd-tracker): Track song plays/skips on MPD.\n- [MPD DJ](#mpd-dj): Auto-add songs/albums to your MPD queue.\n\n## Installation\n\nInstall the plugin.\n\n```bash\npip install beets-mpd-utils\n```\n\nEnable the plugin by adding it the `plugins` option in your beets config.\n\n```yaml\nplugins: mpd_tracker, mpd_dj\n```\n\n## Provided Plugins\n\n### MPD Tracker\n\nThe `mpd_tracker` plugin tracks song plays and skips on MPD and records them in the following flexible attributes:\n\n- Song\n - `play_count`: The number of times the song has been played.\n - `last_played`: When the `play_count` was last updated.\n - `skip_count`: The number of times the song has beed skipped.\n- Album\n - `last_played`: Only written once every song in the album has been played. Defined as the oldest `last_played` value for the songs in the album.\n\n#### Usage\n\nOnce enabled, start the tracker by typing:\n\n```bash\nbeet tracker\n```\n\n#### Configuration\n\nTo configure, make a `mpd_tracker` section in your beets config file. Songs will be considered played/skipped if either of the time/percentage thresholds are met.\n\nThe available options are:\n\n- **play_time**: The amount of seconds played after which the song will be considered \"played\". Default: `240`.\n- **play_percent**: The percentage of the song that needs to be played before being considered \"played\". Expects a value between `0` and `1`, default: `0.5`.\n- **skip_time**: The amount of seconds played before which the song will be considered \"skipped\". Default: `20`.\n- **skip_percent**: The percentage of the song that needs to be played before which the song will be considered \"skipped\". Expects a value between `0` and `1`, default: `0.0`.\n\n### MPD DJ\n\nThe `mpd_dj` plugin randomly adds items to the MPD queue. Note that activating this plugin will turn off random mode in MPD, as it needs to know what songs are upcoming in the queue.\n\n#### Usage\n\nOnce enabled, start the tracker by typing:\n\n```bash\nbeet dj\n```\n\nBy default, the plugin will work to maintain 20 upcoming songs, selected randomly from the library. These defaults can be changed using command-line options.\n\n- `--number=ITEMS`, `-n ITEMS`: The plugin will maintain the specified number of items in the upcoming queue.\n- `--album`, `-a`: The plugin will queue albums instead of songs.\n\nIn addition, you can enter a [query](https://beets.readthedocs.io/en/stable/reference/query.html) to specify what will be added to the queue.\n\n```bash\n# maintain 5 albums in the queue, pulling randomly from albums released in 2022\nbeet dj -n 5 --album year:2022\n```\n",
"bugtrack_url": null,
"license": "MIT",
"summary": "Utilities for MPD integration with Beets",
"version": "0.1.4",
"project_urls": {
"homepage": "https://github.com/thekakkun/beets-mpd-utils",
"repository": "https://github.com/thekakkun/beets-mpd-utils.git"
},
"split_keywords": [
"beets",
" mpd",
" music player daemon",
" music"
],
"urls": [
{
"comment_text": "",
"digests": {
"blake2b_256": "a87585556268650bb17434208fed0295c0f0f92ee786db7ecb11b1acb1b14a53",
"md5": "6b68121d04004deb2501c25c3682860f",
"sha256": "f106f06ab2357fb2615c0e28590b5379b46557dab3225d344333c435a3e53b60"
},
"downloads": -1,
"filename": "beets_mpd_utils-0.1.4-py3-none-any.whl",
"has_sig": false,
"md5_digest": "6b68121d04004deb2501c25c3682860f",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": "<4.0,>=3.12",
"size": 8515,
"upload_time": "2024-08-18T19:13:17",
"upload_time_iso_8601": "2024-08-18T19:13:17.870031Z",
"url": "https://files.pythonhosted.org/packages/a8/75/85556268650bb17434208fed0295c0f0f92ee786db7ecb11b1acb1b14a53/beets_mpd_utils-0.1.4-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "243bd11385f28fe8c375d0e15af69a2796a3cba5729c517598f83f870312fb3c",
"md5": "3001ef25a1422a76c6f38f730fa97f7f",
"sha256": "a967448a7870f2bbdb2c8de07b46787ccdd16a0a0b01128a95d76619d228bbc5"
},
"downloads": -1,
"filename": "beets_mpd_utils-0.1.4.tar.gz",
"has_sig": false,
"md5_digest": "3001ef25a1422a76c6f38f730fa97f7f",
"packagetype": "sdist",
"python_version": "source",
"requires_python": "<4.0,>=3.12",
"size": 7012,
"upload_time": "2024-08-18T19:13:19",
"upload_time_iso_8601": "2024-08-18T19:13:19.268596Z",
"url": "https://files.pythonhosted.org/packages/24/3b/d11385f28fe8c375d0e15af69a2796a3cba5729c517598f83f870312fb3c/beets_mpd_utils-0.1.4.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2024-08-18 19:13:19",
"github": true,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"github_user": "thekakkun",
"github_project": "beets-mpd-utils",
"travis_ci": false,
"coveralls": false,
"github_actions": false,
"lcname": "beets-mpd-utils"
}