pytagsfs doesn't perform variable substitution in else clauses of format strings

Bug #259928 reported by Forest Bond on 2008-08-21
4
Affects Status Importance Assigned to Milestone
pytagsfs
Undecided
Forest Bond

Bug Description

for example, let's try to mount directory which contains files without "title" tag.
$ pytagsfs -o format='/%?%title%:%{filename}%?' no_title_tags_at_all foo
$ ls foo
%(filename)s
$ file foo/%\(filename\)s
foo/%(filename)s: FLAC audio bitstream data, 16 bit, stereo, 44.1 kHz, 10880940 samples

this is not expected behaviour.
im just wanna see original file names, if no title tag present.

maybe im doing something wrong?

Revision history for this message
Forest Bond (forest-bond) wrote :

I have re-written the substitution string code, and will have this resolved soon, I hope. The complication is that allowing variable expansion in else clauses opens up the possibility of ambiguous results from splitting paths. For instance, with a format string like:

%?%{artist}%:%{composer}%?

If we rename a file from "foo" to "bar", should that affect the artist or composer tag?

Here are the options:

 * Always affect the tag in the "if" clause.
 * Always affect the tag in the "else" clause.
 * Change the one that is currently being used. I.e., if the artist is "foo" and rename the file to "bar", set the artist tag to "bar". However, if the artist tag is not set but the composer is "foo", set the composer tag to "bar". This is obviously a little more difficult.
 * Set neither and throw back an error (Invalid argument, I guess).

I'm still contemplating which option is best. Input is always appreciated.

Revision history for this message
Forest Bond (forest-bond) wrote :

Fixed in bzr revision 456.

Changed in pytagsfs:
assignee: nobody → forest-bond
status: New → Fix Committed
Revision history for this message
Forest Bond (forest-bond) wrote :

Actually, fixed in revision 453.

Revision history for this message
Forest Bond (forest-bond) wrote :

Fixed in version 0.8.0rc1.

Changed in pytagsfs:
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers