Samplerate Field Change

9 views
Skip to first unread message

Henry Karjalainen

unread,
Sep 15, 2019, 8:36:18 PM9/15/19
to beets
I've recently upgraded to the latest version and I have noticed that the implementation of the samplerate field has changed.

In the latest version samplerate prints something like "44khz", whereas, previously it was "44Khz"

How can I use Template functions to get back to the older value with capital letter K after the samplerate number? 

Thanks!

Adrian Sampson

unread,
Sep 15, 2019, 8:52:41 PM9/15/19
to beets
Hmm, are you sure it’s not “kHz” (which is the standard spelling)?

In any case, that’s not currently possible to customize by itself. But you could use the `inline` plugin to define a new field, like $my_samplerate, that uses whatever string you like.

Adrian


--
You received this message because you are subscribed to the Google Groups "beets" group.
To unsubscribe from this group and stop receiving emails from it, send an email to beets-users...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/beets-users/c0b7ebbf-762d-4986-a6af-17c1c13605e8%40googlegroups.com.

Henry Karjalainen

unread,
Sep 15, 2019, 11:08:12 PM9/15/19
to beets
Thanks Adrian. Unfortunately, behaviour is as I describe with the "khz" abbreviation. It changed from "Khz"

I'm not much of a Python programmer, how can I use the Inline plugin to make a new field?

I tried this and it didn't work: 

new_samplerate: samplerate[0:-3] + samplerate[-3].upper() + samplerate[-2:].lower()


On Monday, 16 September 2019 10:52:41 UTC+10, Adrian Sampson wrote:
Hmm, are you sure it’s not “kHz” (which is the standard spelling)?

In any case, that’s not currently possible to customize by itself. But you could use the `inline` plugin to define a new field, like $my_samplerate, that uses whatever string you like.

Adrian
On Sep 15, 2019, at 8:36 PM, Henry Karjalainen <henr...@gmail.com> wrote:

I've recently upgraded to the latest version and I have noticed that the implementation of the samplerate field has changed.

In the latest version samplerate prints something like "44khz", whereas, previously it was "44Khz"

How can I use Template functions to get back to the older value with capital letter K after the samplerate number? 

Thanks!

--
You received this message because you are subscribed to the Google Groups "beets" group.
To unsubscribe from this group and stop receiving emails from it, send an email to beets...@googlegroups.com.

Adrian Sampson

unread,
Sep 16, 2019, 8:15:17 AM9/16/19
to beets
In your inline configuration, `samplerate` is an integer, not a string. So you’ll want something like `str(samplerate / 1000) + ‘kHz’`.

To unsubscribe from this group and stop receiving emails from it, send an email to beets-users...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/beets-users/ec689a8f-32f4-4a1d-a641-93758fe2f2d9%40googlegroups.com.

Henry Karjalainen

unread,
Sep 16, 2019, 7:40:25 PM9/16/19
to beets
Right. Thanks Adrian.

I will try that.


Reply all
Reply to author
Forward
0 new messages