Hi,
now I am a few steps ahead but still kind of confused.
I applied the example above like that:
plugins: convert lastgenre edit fetchart inline
item_fields:
threeDigitTrack: ‘{:03n}’.format(track)
paths:
default: $albumartist/$album%aunique{}/$threeDigitTrack_$title
But this gives a syntax problem:
configuration error: file /home/mpcww/.config/beets/hoerbuch/config_hoerbuch.yaml could not be read: while parsing a block mapping
in “/home/mpcww/.config/beets/hoerbuch/config_hoerbuch.yaml”, line 29, column 9
expected , but found ‘’
in “/home/mpcww/.config/beets/hoerbuch/config_hoerbuch.yaml”, line 29, column 34
In the meantime I encountered the docu for “inline plugin”
According the example I changed the syntax to
item_fields:
threeDigitTrack: u’%03i’ % (track)
paths:
default: $albumartist/$album%aunique{}/$threeDigitTrack_$title
Syntax seemed to be ok but the result is not resolved:
$threeDigitTrack_Track_001.mp3
I decided to apply the example:
paths:
default: $albumartist/$album%aunique{}/‘$disc_and_track’_$title
item_fields:
disc_and_track: u’%02i.%03i’ % (disc, track) if disctotal > 1 else u’%03i’ % (track)
with little changes:
Due to underscore in disc_and_track I had to use ‘’'.
I change 2i to 3i for the track part.
The result looks kind of closer to what I want:
_001__Track_001.mp3
_017__Track_017.mp3
However now I have the leading ‘_’ in front of the tracknumber and (!) an additional wone after it and I not even see how it is produced ?
I hope I don’t have to learn python, do I ?
Regarding the syntax of padding I assume my pthyon version doesn’t support it:
python -V
Python 2.7.13
But I guessed wrong, actually it works:
Welcome to Python 2.7! This is the online help utility.
[…]
‘{:03n}’.format(11)
‘011’
From the beginning of the post (syntax error) there is the question why beets or “inline plugine” are complaing about the new syntax:
configuration error: file …/config_hoerbuch.yaml could not be read: while parsing a block mapping
in “…config_hoerbuch.yaml”, line 29, column 9
expected , but found ‘’
in “…config_hoerbuch.yaml”, line 29, column 34
and force me to switch to the old one
item_fields:
# threeDigitTrack: ‘{:03n}’.format(track)
threedigittrack: u’%03d’ % (track,)