beetbox / beets

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

TypeError upon import #3540

Closed abdulocracy closed 4 years ago

abdulocracy commented 4 years ago

Problem

Running from git tip, when trying to import I get this error:

Traceback (most recent call last):                                                                                                                                                                     
  File "/home/abdulkadir/.local/bin/beet", line 11, in <module>                                                                                                                                        
    load_entry_point('beets==1.5.0', 'console_scripts', 'beet')()                                                                                                                                      
  File "/home/abdulkadir/.local/lib/python3.7/site-packages/beets-1.5.0-py3.7.egg/beets/ui/__init__.py", line 1267, in main                                                                            
    _raw_main(args)                                                                                                                                                                                    
  File "/home/abdulkadir/.local/lib/python3.7/site-packages/beets-1.5.0-py3.7.egg/beets/ui/__init__.py", line 1254, in _raw_main                                                                       
    subcommand.func(lib, suboptions, subargs)                                                                                                                                                          
  File "/home/abdulkadir/.local/lib/python3.7/site-packages/beets-1.5.0-py3.7.egg/beets/ui/commands.py", line 956, in import_func                                                                      
    import_files(lib, paths, query)                                                                                                                                                                    
  File "/home/abdulkadir/.local/lib/python3.7/site-packages/beets-1.5.0-py3.7.egg/beets/ui/commands.py", line 926, in import_files                                                                     
    session.run()                                                                                                                                                                                      
  File "/home/abdulkadir/.local/lib/python3.7/site-packages/beets-1.5.0-py3.7.egg/beets/importer.py", line 329, in run                                                                                 
    pl.run_parallel(QUEUE_SIZE)                                                                                                                                                                        
  File "/home/abdulkadir/.local/lib/python3.7/site-packages/beets-1.5.0-py3.7.egg/beets/util/pipeline.py", line 445, in run_parallel                                                                   
    six.reraise(exc_info[0], exc_info[1], exc_info[2])                                                                                                                                                 
  File "/usr/lib/python3/dist-packages/six.py", line 693, in reraise                                                                                                                                   
    raise value                                                                                                                                                                                        
  File "/home/abdulkadir/.local/lib/python3.7/site-packages/beets-1.5.0-py3.7.egg/beets/util/pipeline.py", line 312, in run                                                                            
    out = self.coro.send(msg)                                                                                                                                                                          
  File "/home/abdulkadir/.local/lib/python3.7/site-packages/beets-1.5.0-py3.7.egg/beets/util/pipeline.py", line 194, in coro                                                                           
    func(*(args + (task,)))                                                                                                                                                                            
  File "/home/abdulkadir/.local/lib/python3.7/site-packages/beets-1.5.0-py3.7.egg/beets/importer.py", line 1353, in lookup_candidates                                                                  
    task.lookup_candidates()                                                                                                                                                                           
  File "/home/abdulkadir/.local/lib/python3.7/site-packages/beets-1.5.0-py3.7.egg/beets/importer.py", line 641, in lookup_candidates                                                                   
    autotag.tag_album(self.items, search_ids=self.search_ids)                                                                                                                                          
  File "/home/abdulkadir/.local/lib/python3.7/site-packages/beets-1.5.0-py3.7.egg/beets/autotag/match.py", line 467, in tag_album                                                                      
    extra_tags):                                                                                                                                                                                       
  File "/home/abdulkadir/.local/lib/python3.7/site-packages/beets-1.5.0-py3.7.egg/beets/plugins.py", line 577, in decorated                                                                            
    for v in generator(*args, **kwargs):                                                                                                                                                               
  File "/home/abdulkadir/.local/lib/python3.7/site-packages/beets-1.5.0-py3.7.egg/beets/autotag/hooks.py", line 647, in album_candidates                                                               
    extra_tags):                                                                                                                                                                                       
  File "/home/abdulkadir/.local/lib/python3.7/site-packages/beets-1.5.0-py3.7.egg/beets/plugins.py", line 387, in candidates                                                                           
    extra_tags):                                                                                                                                                                                       
TypeError: candidates() takes 5 positional arguments but 6 were given                                                                                                                                  

I've tried rolling back commits and have narrowed it down to 19d6dfc8f301c4123989227084842d1c25807594. When importing an existing library without tagging there is no error.

Setup

My configuration (output of beet config) is:

lyrics:                                                                                                                                                                                      [113/2672]
    bing_lang_from: []                                                                                                                                                                                 
    auto: yes                                                                                                                                                                                          
    bing_client_secret: REDACTED                                                                                                                                                                       
    bing_lang_to:                                                                                                                                                                                      
    google_API_key: REDACTED                                                                                                                                                                           
    google_engine_ID: REDACTED                                                                                                                                                                         
    genius_api_key: REDACTED                                                                                                                                                                           
    fallback:                                                                                                                                                                                          
    force: no                                                                                                                                                                                          
    local: no                                                                                                                                                                                          
    sources:                                                                                                                                                                                           
    - google                                                                                                                                                                                           
    - lyricwiki                                                                                                                                                                                        
    - musixmatch                                                                                                                                                                                       
    - genius                                                                                                                                                                                           
directory: /media/music/music-archive                                                                                                                                                                  
library: /media/music/music-archive/beets.db                                                                                                                                                           

plugins: acousticbrainz absubmit badfiles chroma convert deezer discogs duplicates embedart info fetchart fromfilename lastgenre lyrics mbsync missing replaygain scrub spotify thumbnails             
convert:                                                                                                                                                                                               
    copy_album_art: yes                                                                                                                                                                                
    never_convert_lossy_files: yes                                                                                                                                                                     
    command: /home/abdulkadir/.scripts/convert_mp3.sh $source $dest                                                                                                                                    
    extension: mp3                                                                                                                                                                                     
    dest:                                                                                                                                                                                              
    pretend: no                                                                                                                                                                                        
    link: no                                                                                                                                                                                           
    hardlink: no                                                                                                                                                                                       
    threads: 4                                                                                                                                                                                         
    format: mp3                                                                                                                                                                                        
    id3v23: inherit
    formats:
        aac:
            command: ffmpeg -i $source -y -vn -acodec aac -aq 1 $dest
            extension: m4a
        alac:
            command: ffmpeg -i $source -y -vn -acodec alac $dest
            extension: m4a
        flac: ffmpeg -i $source -y -vn -acodec flac $dest
        mp3: ffmpeg -i $source -y -vn -aq 2 $dest
        opus: ffmpeg -i $source -y -vn -acodec libopus -ab 96k $dest
        ogg: ffmpeg -i $source -y -vn -acodec libvorbis -aq 3 $dest
        wma: ffmpeg -i $source -y -vn -acodec wmav2 -vn $dest
    max_bitrate: 500
    auto: no
    tmpdir:
    quiet: no
    embed: yes                                                                                                                                                                                [65/2672]

    paths: {}
    no_convert: ''
    album_art_maxwidth: 0
replaygain:
    auto: yes
    backend: ffmpeg
    r128_targetlevel: 89
    overwrite: no
    per_disc: no
    peak: 'true'
    targetlevel: 89
    r128: [Opus]
fetchart:
    sources: coverart itunes amazon albumart fanarttv filesystem
    fanarttv_key: REDACTED
    auto: yes
    minwidth: 0
    maxwidth: 0
    quality: 0
    enforce_ratio: no
    cautious: no
    cover_names:
    - cover
    - front
    - art
    - album
    - folder
    google_key: REDACTED
    google_engine: 001442825323518660753:hrh5ch1gjzm
    store_source: no
    high_resolution: no
lastgenre:
    whitelist: yes
    min_weight: 10
    count: 1
    fallback:
    canonical: no
    source: album
    force: yes
    auto: yes
    separator: ', '
    prefer_specific: no
duplicates:
    album: no
    checksum: ''
    copy: ''
    count: no                                                                                                                                                                                 [17/2672]
    delete: no
    format: ''
    full: no
    keys: []
    merge: no
    move: ''
    path: no
    tiebreak: {}
    strict: no
    tag: ''
discogs:
    apikey: REDACTED
    apisecret: REDACTED
    tokenfile: discogs_token.json
    source_weight: 0.5
    user_token: REDACTED
    separator: ', '
    index_tracks: no
thumbnails:
    auto: yes
    force: no
    dolphin: no
acousticbrainz:
    auto: yes
    force: no
    tags: []
missing:
    count: no
    total: no
    album: no
spotify:
    source_weight: 0.5
    mode: list
    tiebreak: popularity
    show_failures: no
    artist_field: albumartist
    album_field: album
    track_field: title
    region_filter:
    regex: []
    client_id: 4e414367a1d14c75a5c5129a627fcab8
    client_secret: REDACTED
    tokenfile: spotify_token.json
chroma:
    auto: yes
embedart:
    maxwidth: 0
    auto: yes
    compare_threshold: 0
    ifempty: no
    remove_art_file: no
    quality: 0
deezer:
    source_weight: 0.5
absubmit:
    extractor: ''
    force: no
    pretend: no
scrub:
    auto: yes
sampsyo commented 4 years ago

Thanks! Any chance you could help us narrow down which plugin is causing this? It looks like discogs has gotten the extra_tags treatment, but perhaps something went wrong with that?

@x1ppy, could you please double-check to see if some of these plugin signatures still need updating?

x1ppy commented 4 years ago

Oops. It looks like #3531 covered most of it, but there's one more sneaky case in plugins.py under MetadataSourcePlugin#get_artist. It looks like several of the listed plugins (discogs, deezer, spotify, beatport) rely on that method.

@abdulocracy, can you please verify whether this branch fixes the error?

abdulocracy commented 4 years ago

Oops. It looks like #3531 covered most of it, but there's one more sneaky case in plugins.py under MetadataSourcePlugin#get_artist. It looks like several of the listed plugins (discogs, deezer, spotify, beatport) rely on that method.

@abdulocracy, can you please verify whether this branch fixes the error?

Can confirm, the import is successful on this branch.