beetbox / beets

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

Error when running in windiws rather than Linux #961

Closed arogl closed 10 years ago

arogl commented 10 years ago

E:\>beet config

scrub:
    auto: yes
fetchart:
    auto: yes
    cautious: no
    maxwidth: 0
    remote_priority: no
    google_search: no
    cover_names:
    - cover
    - front
    - art
    - album
    - folder
color: yes
max_filename_length: 80
embedart:
    auto: yes
    maxwidth: 0
replace:
    '[\\/]': ''
    ^\.: ''
    '[\x00-\x1f]': ''
    '[<>:\"\?\*\|]': ''
    \.$: ''
    \s+$: ''
    ^\s+: ''
    "\\\u201C": ''
    "\\\u201D": ''
    \`: ''''
    "\\\u2019": ''''
replaygain:
    overwrite: no
    auto: yes
    command: c:\agrbin\aacgain.exe
    targetlevel: 89
    backend: command
    noclip: yes
pluginpath: C:\Users\andre_000\AppData\Roaming\beets\beetsplug    

plugins: ftintitle chroma discogs beatport lastgenre mbsync fetchart embedart replaygain duplicates missing info scrub zero fromfilename    

paths:
    default: '%asciify{%upper{%left{$albumartist,1}}/$albumartist/($year) $album%aunique{}/$album - $track - $artist - $title}'
    singleton: '%asciify{Singles/$artist - $title}'
    comp: '%asciify{Various Artists/($year) $album%aunique{}/$album - $track - $artist - $title}'
    albumtype:soundtrack: '%asciify{Soundtracks/($year) $album%aunique{}/$album - $track - $artist - $title}'
    albumartist:various\ artists: '%asciify{Various Artists/($year) $album%aunique{}/$album - $track - $artist - $title}'
    albumartist:various: '%asciify{Various Artists/($year) $album%aunique{}/$album - $track - $artist - $title}'
convert:
    ffmpeg: c:\agrbin\bin\ffmpeg.exe
    embed: yes
    format: mp3
    max_bitrate: 192
    dest: '%upper{%left{$albumartist,1}}/$albumartist/($year) $album%aunique{}/$album - $track - $artist - $title'
    threads: 4    

    paths:
        default: '%upper{%left{$albumartist,1}}/$albumartist/($year) $album%aunique{}/$album - $track - $artist - $title'
threaded: yes
art_filename: cover
id3v23: yes
zero:
    fields: month day genre comments
    comments:
    - EAC
    - LAME
    - from.+collection
    - ripped by
amazon:
    Access_Key_ID: XXXXXXXXXXXXXXXXXXXXXXXXXXXXX
    Secret_Access_Key: XXXXXXXXXXXXXXXXXXXXXXXXXXXXX
    asso_tag: beets
ignore: .AppleDouble ._* *~ .DS_Store *.sfv *.srr *.nfo *.m3u
directory: F:\Music\    

import:
    copy: no
    move: yes
    write: yes
    resume: ask
    quiet_fallback: skip
    timid: no
    log: F:\Music\beetslog.txt
    languages: en
acoustid:
    apikey: XXXXXXXXXX
lastgenre:
    count: 1
    source: album
    force: yes
    min_weight: 10
    auto: yes
    whitelist: yes
    separator: ', '
    fallback:
    canonical: no
duplicates:
    album: no
    full: no
    format: ''
    keys: [mb_trackid, mb_albumid]
    move: no
    tag: no
    path: no
    copy: no
    count: no
    checksum:
    delete: no
missing:
    count: no
    total: no
    format:
beatport:
    source_weight: 0.5
discogs:
    source_weight: 0.5
chroma:
    auto: yes
ftintitle:
    drop: no

running:

beet import -q e:\music

Traceback (most recent call last):
  File "C:\Python27\Scripts\beet-script.py", line 9, in <module>
    load_entry_point('beets==1.3.8', 'console_scripts', 'beet')()
  File "C:\Python27\lib\site-packages\beets\ui\__init__.py", line 964, in main
    _raw_main(args)
  File "C:\Python27\lib\site-packages\beets\ui\__init__.py", line 954, in _raw_main
    subcommand.func(lib, suboptions, subargs)
  File "C:\Python27\lib\site-packages\beets\ui\commands.py", line 884, in import_func
    import_files(lib, paths, query)
  File "C:\Python27\lib\site-packages\beets\ui\commands.py", line 856, in import_files
    session.run()
  File "C:\Python27\lib\site-packages\beets\importer.py", line 297, in run
    pl.run_parallel(QUEUE_SIZE)
  File "C:\Python27\lib\site-packages\beets\util\pipeline.py", line 299, in run
    out = self.coro.send(msg)
  File "C:\Python27\lib\site-packages\beets\util\pipeline.py", line 181, in coro
    func(*(args + (task,)))
  File "C:\Python27\lib\site-packages\beets\importer.py", line 1181, in plugin_stage
    func(session, task)
  File "C:\Python27\lib\site-packages\beetsplug\replaygain.py", line 615, in imported
    self.handle_album(task.album, False)
  File "C:\Python27\lib\site-packages\beetsplug\replaygain.py", line 550, in handle_album
    album_gain = self.backend_instance.compute_album_gain(album)
  File "C:\Python27\lib\site-packages\beetsplug\replaygain.py", line 141, in compute_album_gain
    output = self.compute_gain(supported_items, True)
  File "C:\Python27\lib\site-packages\beetsplug\replaygain.py", line 189, in compute_gain
    len(items) + (1 if is_album else 0))
  File "C:\Python27\lib\site-packages\beetsplug\replaygain.py", line 203, in parse_tool_output
    'mp3gain': int(parts[1]),
IndexError: list index out of range

The same config with paths modified for Linux works.

Kraymer commented 10 years ago

(edited OP post for better readability)

So it's a problem with dealing with mp3gain output. We recommend on the plugin help page to install the original mp3gain, is that what you did ? Can you confirm you use the 1.2.5 version ?

(I use this plugin but on mac with aacgain so I don't have a quick fix, sorry)

sampsyo commented 10 years ago

Looks like we lost the error handling for malformed mp3gain output in 86ee30df0d177f9103a7c4e7489cbf06aaa62838. I'll add that back in.

This of course doesn't address why mp3gain failed here, as @KraYmer points out—maybe more debugging output will help.

sampsyo commented 10 years ago

The above commit should do it. Please reopen if the problem persists.

arogl commented 10 years ago

I am running the latest aacgain for windows from http://www.rarewares.org/aac-encoders.php

arogl commented 10 years ago

This is indeed now working.

The other strange thing was if I ran the import again, aacgain would work..... @KraYmer what did you use to clean up my bug report?

Kraymer commented 10 years ago

@arogl I just indented the code with 4 spaces (syntax for preformatted text) @sampsyo if it's working, maybe we could indicate this aacgain version in the doc alongside mp3gain ?

sampsyo commented 10 years ago

Sure; seems worth a link.