unrblt / beets-bandcamp

Plugin for beets (http://beets.io) to use bandcamp as an autotagger source.
GNU General Public License v2.0
61 stars 19 forks source link

AttributeError: 'str' object has no attribute 'length' #13

Open arogl opened 4 years ago

arogl commented 4 years ago
bandcamp: Searching album, page 1
Sending event: albuminfo_received
Candidate: https://artist.bandcamp.com - https://artist.bandcamp.com/album/album (artist)
Traceback (most recent call last):
  File "/home/arogl/.local/bin/beet", line 33, in <module>
    sys.exit(load_entry_point('beets', 'console_scripts', 'beet')())
  File "/mnt/h/Git/beets/beets/ui/__init__.py", line 1267, in main
    _raw_main(args)
  File "/mnt/h/Git/beets/beets/ui/__init__.py", line 1254, in _raw_main
    subcommand.func(lib, suboptions, subargs)
  File "/mnt/h/Git/beets/beets/ui/commands.py", line 956, in import_func
    import_files(lib, paths, query)
  File "/mnt/h/Git/beets/beets/ui/commands.py", line 926, in import_files
    session.run()
  File "/mnt/h/Git/beets/beets/importer.py", line 329, in run
    pl.run_parallel(QUEUE_SIZE)
  File "/mnt/h/Git/beets/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 703, in reraise
    raise value
  File "/mnt/h/Git/beets/beets/util/pipeline.py", line 312, in run
    out = self.coro.send(msg)
  File "/mnt/h/Git/beets/beets/util/pipeline.py", line 194, in coro
    func(*(args + (task,)))
  File "/mnt/h/Git/beets/beets/importer.py", line 1353, in lookup_candidates
    task.lookup_candidates()
  File "/mnt/h/Git/beets/beets/importer.py", line 641, in lookup_candidates
    autotag.tag_album(self.items, search_ids=self.search_ids)
  File "/mnt/h/Git/beets/beets/autotag/match.py", line 468, in tag_album
    _add_candidate(items, candidates, matched_candidate)
  File "/mnt/h/Git/beets/beets/autotag/match.py", line 374, in _add_candidate
    mapping, extra_items, extra_tracks = assign_items(items, info.tracks)
  File "/mnt/h/Git/beets/beets/autotag/match.py", line 102, in assign_items
    row.append(track_distance(item, track))
  File "/mnt/h/Git/beets/beets/autotag/match.py", line 134, in track_distance
    if track_info.length:
AttributeError: 'str' object has no attribute 'length'

I have tried debugging and I do not see how or when the function album_distance is called once the candidate has been identified.

Debugging shows possible MusicBrainz candidates but not the last one from Bandcamp.

Hoping you can help?

montchr commented 4 years ago

I'm also receiving the same error message, with a very similar looking stack trace. Disabling this plugin fixed the issue for me.

saladuh commented 4 years ago

Also having this issue, but only when using beets master (which is currently the only useable version on Arch and other rolling distros as stable 1.4.9 is broken in them).

Disabling the plugin fixed this issue for me as well

montchr commented 4 years ago

Interesting. I'm using the master branch too – haven't tested with 1.4.9.