-
|
For the built-in length field you can use human readable notation, like |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 1 reply
-
|
Yes, but not through the stock The built-in The int
float
bool
dateso this will not work: types:
album_length: durationFor 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 value as seconds. After that, If you only need this for display and do not care about query parsing, an inline/template field is also possible, but for "behave exactly like length", the field type is the right place. |
Beta Was this translation helpful? Give feedback.
-
|
For anyone who stumbles upon this, I made a plugin to add a |
Beta Was this translation helpful? Give feedback.
Yes, but not through the stock
typesplugin config.The built-in
lengthfield gets that behavior because it is declared astypes.DurationType()inbeets/library/fields.py.DurationTypeis the piece that formats seconds asM:SSand parsesM:SSback to seconds.The
typesplugin currently only accepts:so this will not work:
For the same behavior on an album flex field, use a small plugin that declares the field type:
Then enable that plugin and store the valu…