Metadata-Version: 2.4
Name: beets-inlineplus
Version: 0.1.0
Summary: A beets plugin that adds inlining with common functions
Author-email: halloleo <beets_devel@halloleo.hailmail.net>
License: MIT
Project-URL: Homepage, https://github.com/halloleo/beets-inlineplus
Project-URL: Documentation, https://github.com/halloleo/beets-inlineplus#readme
Project-URL: Bug Tracker, https://github.com/halloleo/beets-inlineplus/issues
Keywords: beets,plugin,music,logging,import
Classifier: Development Status :: 4 - Beta
Classifier: Environment :: Console
Classifier: Intended Audience :: End Users/Desktop
Classifier: License :: OSI Approved :: MIT License
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.8
Classifier: Programming Language :: Python :: 3.9
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Topic :: Multimedia :: Sound/Audio
Requires-Python: >=3.8
Description-Content-Type: text/markdown
License-File: LICENSE
Requires-Dist: beets>=2.2.0
Requires-Dist: requests>=2.32.3
Dynamic: license-file

# InlinePlus plugin for Beets

This [beets] plugin is like the builtin [`inline`][inline] plugin: it "lets you
use Python to customize your path formats. Using it, you can define template
fields in your beets configuration file and refer to them from your template
strings in the `paths: ` section."

However, `inlineplus` adds a `fields_base:` block where you can define python
functions you want to use in multiple template fields.

### Installation

Install the plugin into beets' Python environment with

    pip install beets-inlineplus

(or the respective equivalent if you use e.g. pipx).

### Usage

Add the `inlineplus` plugin to your config. 

Then under a new `fields_base:` block write python functions and constants you want to use in your fielddefinition under `item_fields:` or `album_fields:`. Python function can be used in both of these section. Example:

You want to use a function `anartist()` both in the item field `myiteminfo` and in the album fields `myartistinfo`. Define this function in your `config.yaml` like this:

```
fields_base: |
  def anartist():
    return "AnArtist"
```

Then you can refer to it the item and album fields for example liek this:

```
item_fields:
  myiteminfo: anartist()

album_fields:
  myartistinfo: |
    return "Artist_" + anartist().upper()
```

and then in the `paths` section you can use your new fields:

```
paths:
    default: $albumartist/$album%aunique{}/$track $title $myiteminfo
    singelton: $myartistinfo/$title
```


  [beets]: https://beets.io
  [inline]: https://beets.readthedocs.io/en/stable/plugins/inline.html
