Bug 25 - Ripping to ONETRACK with custom ONETRACKOUTPUTFORMAT saves the album art in the wrong position
Summary: Ripping to ONETRACK with custom ONETRACKOUTPUTFORMAT saves the album art in t...
Status: RESOLVED FIXED
Alias: None
Product: abcde
Classification: Unclassified
Component: Album art (show other bugs)
Version: unspecified
Hardware: All All
: Normal normal
Assignee: Andrew Strong
URL:
Depends on:
Blocks:
 
Reported: 2015-12-06 14:45 GMT by Nino Burini
Modified: 2015-12-11 23:15 GMT (History)
3 users (show)

See Also:


Attachments
abcde.conf to reproduce the bug (18.51 KB, text/plain)
2015-12-06 14:45 GMT, Nino Burini
Details
Fix for one track and getalbumart (765 bytes, patch)
2015-12-10 11:31 GMT, Andrew Strong
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Nino Burini 2015-12-06 14:45:16 GMT
Created attachment 10 [details]
abcde.conf to reproduce the bug

Ripping to ONETRACK with custom ONETRACKOUTPUTFORMAT saves the album art in the wrong position

Steps to reproduce:

* Use the attached abcde.conf
* Run abcde with "abcde -1 -a default,cue,getalbumart -c abcde.conf"
* The cover art will be saved in a different folder than the one with the audio file.

For instance, ripping the Muse album Drones, the final result will be:

/flac
  /Muse
    cover.jpg  <----------
/Muse
  /Drones
    Muse - drones.flac
    Muse - drones.flac.cue

(abcde 2.7.1 on Linux)
Comment 1 Nino Burini 2015-12-06 14:55:59 GMT
I've check the code and noticed that the problem might be here (abcde line 3182):

    # put cover in the same place as the album
    if [ "$VARIOUSARTISTS" = "y" ] ; then
        ALBUMARTDIR="$(eval echo "$VAOUTPUTFORMAT")"
    else
        ALBUMARTDIR="$(eval echo "$OUTPUTFORMAT")"
    fi

The destination directory for the cover art is set using $OUTPUTFORMAT, not $ONETRACKOUTPUTFORMAT, which might explain why a custom $ONETRACKOUTPUTFORMAT would cause the problem.

The default $ONETRACKOUTPUTFORMAT coincides with $OUTPUTFORMAT, in which case the bug doesn't appear.

Distinguishing the case of ONETRACK seems to fix the problem for me:

    # put cover in the same place as the album
    if [ "$ONETRACK" = "y" ] ; then
        if [ "$VARIOUSARTISTS" = "y" ] ; then
            ALBUMARTDIR="$(eval echo "$VAONETRACKOUTPUTFORMAT")"
        else
            ALBUMARTDIR="$(eval echo "$ONETRACKOUTPUTFORMAT")"
        fi
    else
        if [ "$VARIOUSARTISTS" = "y" ] ; then
            ALBUMARTDIR="$(eval echo "$VAOUTPUTFORMAT")"
        else
            ALBUMARTDIR="$(eval echo "$OUTPUTFORMAT")"
        fi
    fi
Comment 2 Andrew Strong 2015-12-09 06:52:17 GMT
Thanks for adding the bug report here Nino. I have added Johannes in to the bug report as he is the brains behind get_albumart and may have some thoughts...
Comment 3 Johannes Gernemann 2015-12-09 13:34:49 GMT
Nino's solution seems to be copied from what other functions use in abcde for one-track output. So I guess it should fix the problem.
Comment 4 Andrew Strong 2015-12-10 11:31:12 GMT
Created attachment 11 [details]
Fix for one track and getalbumart

This certainly works on my system, I will do a few more slightly paranoid tests and then commit shortly...
Comment 5 Andrew Strong 2015-12-11 23:00:14 GMT
Thanks for the report and fix Nino, I have made the commit a few minutes ago. Still an exciting thing when I see getalbumart in operation :).
Comment 6 Nino Burini 2015-12-11 23:15:36 GMT
Thanks for making the feature available! I'm glad I could help.