Skip to content
Discussion options

You must be logged in to vote

Yes, but not through the stock types plugin config.

The built-in length field gets that behavior because it is declared as types.DurationType() in beets/library/fields.py. DurationType is the piece that formats seconds as M:SS and parses M:SS back to seconds.

The types plugin currently only accepts:

int
float
bool
date

so this will not work:

types:
  album_length: duration

For the same behavior on an album flex field, use a small plugin that declares the field type:

from beets.dbcore import types
from beets.plugins import BeetsPlugin

class AlbumLengthTypePlugin(BeetsPlugin):
    album_types = {
        "album_length": types.DurationType(),
    }

Then enable that plugin and store the valu…

Replies: 2 comments 1 reply

Comment options

You must be logged in to vote
1 reply
@emiham
Comment options

Answer selected by emiham
Comment options

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants