mirror of
https://github.com/beetbox/beets.git
synced 2026-01-03 22:42:44 +01:00
Add config option for human vs raw track duration
* Add "format_raw_length" global configuration option to allow the user to toggle between human-readable (default) or raw formatting of track durations.
This commit is contained in:
parent
67eb0ed54c
commit
8d2fda790b
2 changed files with 6 additions and 1 deletions
|
|
@ -65,6 +65,7 @@ ui:
|
|||
format_item: $artist - $album - $title
|
||||
format_album: $albumartist - $album
|
||||
time_format: '%Y-%m-%d %H:%M:%S'
|
||||
format_raw_length: no
|
||||
|
||||
sort_album: albumartist+ album+
|
||||
sort_item: artist+ album+ disc+ track+
|
||||
|
|
|
|||
|
|
@ -200,7 +200,11 @@ class DurationType(types.Float):
|
|||
query = dbcore.query.DurationQuery
|
||||
|
||||
def format(self, value):
|
||||
return beets.ui.human_seconds_short(value or 0.0)
|
||||
# TODO: decide if documenting format_raw_length
|
||||
if not beets.config['format_raw_length'].get(bool):
|
||||
return beets.ui.human_seconds_short(value or 0.0)
|
||||
else:
|
||||
return value
|
||||
|
||||
def parse(self, string):
|
||||
try:
|
||||
|
|
|
|||
Loading…
Reference in a new issue