beetbox / beets

music library manager and MusicBrainz tagger
http://beets.io/
MIT License
12.74k stars 1.82k forks source link

edit plugin not functioning #2149

Closed tijssen closed 8 years ago

tijssen commented 8 years ago

Problem

First of all I want to say that I am new to beets so maybe I'm doing something stupidly wrong here. I wanted the featured artist to show up in the title of my songs instead of the artist section. So, I installed the ftintitle plugin to accomplish this. Then I learned that that plugin doesn't work for compilation albums (of which I have a bunch), so I wanted to manually edit them with the edit plugin. However, when I try to edit any song, the edit plugin will open my text editor (which sometimes gives me an error message saying the file wasn't found (I use TextWrangler)) and the terminal will immediately return me with No changes; aborting..

Running this command in verbose (-vv) mode:

$ beet -vv edit

Led to this problem:

user configuration: /Users/luuk/.config/beets/config.yaml
data directory: /Users/luuk/.config/beets
plugin paths: 
Sending event: pluginload
library database: /Users/luuk/Music/beets/musiclibrary.blb
library directory: /Users/luuk/Music/beets/beets Media/Music
Sending event: library_opened
edit: invoking editor command: ['open', '/var/folders/kd/jkfpr_n10p57_v57pnskkrhr0000gn/T/tmpQB5ifR.yaml']
No changes; aborting.
Sending event: cli_exit

Setup

My configuration (output of beet config) is:

ftintitle:
    format: (feat. {0})
    auto: yes
    drop: no
embedart:
    remove_art_file: yes
    compare_threshold: 0
    auto: yes
    ifempty: no
    maxwidth: 0
fetchart:
    enforce_ratio: yes
    auto: yes
    minwidth: 0
    sources:
    - filesystem
    - coverart
    - itunes
    - amazon
    - albumart
    google_engine: 001442825323518660753:hrh5ch1gjzm
    cautious: no
    maxwidth: 0
    store_source: no
    google_key: REDACTED
    fanarttv_key: REDACTED
    cover_names:
    - cover
    - front
    - art
    - album
    - folder
directory: ~/Music/beets/beets Media/Music

plugins: ftintitle fetchart embedart edit
library: ~/Music/beets/musiclibrary.blb
edit:
    itemfields: track title artist album
    albumfields: album albumartist
    ignore_fields: id path
sampsyo commented 8 years ago

Hi! You're not doing anything wrong; you just need to be careful about how your preferred text editor gets invoked. The edit plugin tries to use your preferred editor as configured by the $EDITOR environment variable (google this for more background). When you don't have one configured, on OS X it tries to use open—which works some of the time, but not for TextWrangler apparently. (The problem is that the open command returns immediately and doesn't wait for you to make your changes.)

So you'll need to set your $EDITOR appropriately. According to this SO answer, you'll probably want to set it to edit -w after installing TextWrangler's command-line tools.

tijssen commented 8 years ago

Hello sampsyo,

Thank you for your swift answer! I kind of understand this now. I got the plugin to work properly with the text editor in the terminal by setting the value to /usr/bin/nano, however I couldn't get TextWrangler to work (and the text editor in the terminal is difficult to use). I tried setting its directory as a value and I tried setting edit -w as a value but neither worked. I did install the command line tools.

sampsyo commented 8 years ago

OK, great! I'm glad nano is working. I'm not familiar with TextWrangler myself, but you might be interested in contacting Bare Bones directly if you want to work it out.