Results 1 to 7 of 7

Thread: abcde - band names beginning with the word "the"

  1. #1
    Join Date
    Aug 2013
    Beans
    38

    abcde - band names beginning with the word "the"

    Has anyone found a way of getting abcde to alter the artist name if it begins with the word "The " ?

    eg.

    "The Cure" becomes "Cure, The"
    "the Cure" becomes "Cure, The"
    "Therapy" remains unchanged

    thanks

  2. #2
    Join Date
    Apr 2011
    Beans
    80

    Re: abcde - band names beginning with the word "the"

    It might have problems with "The The", if anyone remembers them. OOH! it might have problems with "Them" as well

  3. #3
    Join Date
    Aug 2013
    Beans
    38

    Re: abcde - band names beginning with the word "the"

    Good one!

    I think the logic would be something like,

    if the leftmost 4 characters of the artist name is equal to "the " (case insensitive search)
    then
    set the artistname to be mid(artistname, 4, len(artistname)) +', The'

    Just not quite sure how I can do that within the .abcde conf file.

    Alternatively, I guess I could rename the folder once ripping has completed.

  4. #4
    Join Date
    Jun 2007
    Beans
    17,095

    Re: abcde - band names beginning with the word "the"

    On a 18.04 install didn't have abcde setup so installed it, (2.9-2) put a .abcde.conf for flac in (copied from Andrew.46's site, edited only to use libcdio.
    Used the 1st The ... cd I found (The Band), works fine..
    What abcde.conf are you using?
    Attached Images Attached Images

  5. #5
    Join Date
    Aug 2013
    Beans
    38

    Re: abcde - band names beginning with the word "the"

    Mine would do the same:

    # System defaults for abcde version 2.8.1# Nothing in this file is uncommented by default.
    #
    # If you wish to override these system-wide settings, create your own
    # .abcde.conf file in your home directory.


    OUTPUTDIR=/home/music/
    OUTPUTTYPE=flac
    OUTPUTFORMAT='${ARTISTFILE} - ${ALBUMFILE}/${TRACKNUM} - ${TRACKFILE}'
    PADTRACKS=y
    INTERACTIVE=n
    mungefilename ()
    {
    echo "$@" | sed -e 's/^\.*//' | tr -d ":><|*/\"'?[:cntrl:]"
    }
    EJECTCD=y

    I'm looking to be able to save the folder as "Band, The - AlbumName"

    I could probably figure it out if I knew how mungefilename() worked. It looks like each variable is passed to it (ARTISTFILE, ALBUMFILE, TRACKFILE) in order to get "cleaned". If this is correct, how would one put in a routine that only applied to ARTISTFILE?

    Or can this logic be added outside of the function?
    Last edited by z7APXKm; 1 Week Ago at 11:21 AM.

  6. #6
    Join Date
    Aug 2013
    Beans
    38

    Re: abcde - band names beginning with the word "the"

    OK, so this is working in bash, given a variableName of $ARTISTFILE

    Code:
    ARTISTFILE="The Fray"
    lowerArtist=$(echo "$ARTISTFILE" | tr '[:upper:]' '[:lower:]')
    if [[ $lowerArtist == "the "* ]] ;
    then
      ARTISTFILE=$(echo $ARTISTFILE | cut -c 4-)', The'
    fi
    Still trying to work out how to get it into the .abcde.conf file
    Last edited by z7APXKm; 1 Week Ago at 12:16 AM.

  7. #7
    Join Date
    Aug 2013
    Beans
    38

    Re: abcde - band names beginning with the word "the"

    OK, here's what I did...

    1. Take a copy of the .abcde.conf file into the local home directory and edit to add a new mungeartistname2 function:

    Code:
    # System defaults for abcde version 2.8.1
    # Nothing in this file is uncommented by default.
    #
    # If you wish to override these system-wide settings, create your own
    # .abcde.conf file in your home directory.
    
    
    OUTPUTDIR=/home/music/
    OUTPUTTYPE=flac
    OUTPUTFORMAT='${ARTISTFILE} - ${ALBUMFILE}/${TRACKNUM} - ${TRACKFILE}'
    PADTRACKS=y
    INTERACTIVE=n
    
    
    mungefilename ()
    {
      echo "$@" | sed -e 's/^\.*//' | tr -d ":><|*/\"'?[:cntrl:]"
    }
    
    
    mungeartistname2 ()
    {
      if [[ $(echo "$@" | tr '[:upper:]' '[:lower:]') == "the "* ]] ;
      then
        echo "$(mungefilename $@ | cut -c 5-), The"
      else
        echo "$(mungefilename $@)"
      fi
    }
    
    
    EJECTCD=y
    2. Edit the abcde main script at /usr/bin/abcde
    We're editing the mungeartistname() function. Instead of calling the generic mungefilename function, it calls the wrapper function mungeartistname2:

    Code:
       3490 # Custom filename munging specific to artist names:
       3491 mungeartistname ()
       3492 {
       3493         mungeartistname2 $@
       3494 }
    NOTE: I'm sure this could be improved upon, and it's also probably not advisable to edit /usr/bin/abcde directly as future updates will overwrite it. Then again, it's only a one line change and easy to put back if needs be.
    Last edited by z7APXKm; 1 Week Ago at 01:40 AM.

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •