Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

discogs: TypeError whenever artist and title are empty #4973

Closed
fhchl opened this issue Oct 22, 2023 · 1 comment · Fixed by #4974
Closed

discogs: TypeError whenever artist and title are empty #4973

fhchl opened this issue Oct 22, 2023 · 1 comment · Fixed by #4974
Labels
bug bugs that are confirmed and actionable

Comments

@fhchl
Copy link
Contributor

fhchl commented Oct 22, 2023

Problem

Running this command in verbose (-vv) mode:

$ eet -v import -s /mnt/16b3f200-a888-42d0-bac1-4f9176ab62ae/music/musikregal/new-downloads

Led to this problem:

beet -v import -s /mnt/16b3f200-a888-42d0-bac1-4f9176ab62ae/music/musikregal/new-downloads                                1
user configuration: /home/fhchl/.config/beets/config.yaml
data directory: /home/fhchl/.config/beets
plugin paths: /home/fhchl/.local/lib/python3.8/site-packages/beetsplug
fetchart: google: Disabling art source due to missing key
fetchart: lastfm: Disabling art source due to missing key
Sending event: pluginload
library database: /mnt/16b3f200-a888-42d0-bac1-4f9176ab62ae/music/beets.db
library directory: /mnt/16b3f200-a888-42d0-bac1-4f9176ab62ae/music/musikregal/beets
Sending event: library_opened
Sending event: import_begin
Import of the directory:
/mnt/16b3f200-a888-42d0-bac1-4f9176ab62ae/music/musikregal/new-downloads
was interrupted. Resume (Y/n)? n
Sending event: import_task_created
...
Sending event: import_task_created
Looking up: /mnt/16b3f200-a888-42d0-bac1-4f9176ab62ae/music/musikregal/new-downloads/Barato Total - Gal Costa-mzTeBoCJ6JM.mp3
Item search terms:  - 
bandcamp: Searching ts for  using {'query': '', 'artist': '', 'label': '', 'search_type': 't'}
discogs: Skipping Discogs query. File missing artist and title tags.
Traceback (most recent call last):
  File "/home/fhchl/.local/bin/beet", line 8, in <module>
    sys.exit(main())
  File "/home/fhchl/.local/lib/python3.8/site-packages/beets/ui/__init__.py", line 1862, in main
    _raw_main(args)
  File "/home/fhchl/.local/lib/python3.8/site-packages/beets/ui/__init__.py", line 1849, in _raw_main
    subcommand.func(lib, suboptions, subargs)
  File "/home/fhchl/.local/lib/python3.8/site-packages/beets/ui/commands.py", line 1384, in import_func
    import_files(lib, paths, query)
  File "/home/fhchl/.local/lib/python3.8/site-packages/beets/ui/commands.py", line 1315, in import_files
    session.run()
  File "/home/fhchl/.local/lib/python3.8/site-packages/beets/importer.py", line 360, in run
    pl.run_parallel(QUEUE_SIZE)
  File "/home/fhchl/.local/lib/python3.8/site-packages/beets/util/pipeline.py", line 447, in run_parallel
    raise exc_info[1].with_traceback(exc_info[2])
  File "/home/fhchl/.local/lib/python3.8/site-packages/beets/util/pipeline.py", line 312, in run
    out = self.coro.send(msg)
  File "/home/fhchl/.local/lib/python3.8/site-packages/beets/util/pipeline.py", line 195, in coro
    func(*(args + (task,)))
  File "/home/fhchl/.local/lib/python3.8/site-packages/beets/importer.py", line 1497, in lookup_candidates
    task.lookup_candidates()
  File "/home/fhchl/.local/lib/python3.8/site-packages/beets/importer.py", line 1008, in lookup_candidates
    prop = autotag.tag_item(self.item, search_ids=self.search_ids)
  File "/home/fhchl/.local/lib/python3.8/site-packages/beets/autotag/match.py", line 611, in tag_item
    for track_info in hooks.item_candidates(item, search_artist, search_title):
  File "/home/fhchl/.local/lib/python3.8/site-packages/beets/plugins.py", line 579, in decorated
    for v in generator(*args, **kwargs):
  File "/home/fhchl/.local/lib/python3.8/site-packages/beets/autotag/hooks.py", line 771, in item_candidates
    yield from plugins.item_candidates(item, artist, title)
  File "/home/fhchl/.local/lib/python3.8/site-packages/beets/plugins.py", line 398, in item_candidates
    yield from plugin.item_candidates(item, artist, title)
TypeError: 'NoneType' object is not iterable

Whenever both title and artist strings are empty, this method returns None, instead of an empty list, triggering the error.

Setup

  • OS: Ubuntu 20.04
  • Python version: 3.8
  • beets version: master branch
  • Turning off plugins made problem go away (yes/no): yes, discogs plugin

My configuration (output of beet config) is:

directory: /mnt/16b3f200-a888-42d0-bac1-4f9176ab62ae/music/musikregal/beets
library: /mnt/16b3f200-a888-42d0-bac1-4f9176ab62ae/music/beets.db

import:
  move: yes

pluginpath: 
  - ~/.local/lib/python3.8/site-packages/beetsplug
    
plugins: discogs chroma spotify fetchart embedart lastgenre # bandcamp

group_albums: yes
asciify_paths: yes

# Plugin options
lastgenre:
    fallback: ''

fetchart:
    auto: yes

chroma:
    auto: yes

embedart:
    ifemtpy: yes
    auto: yes

acoustid:
    apikey: bbhn6v8T3A

musicbrainz:
    searchlimit: 5

discogs:
    source_weight: 0.0%     
@fhchl fhchl mentioned this issue Oct 22, 2023
3 tasks
@wisp3rwind wisp3rwind added the bug bugs that are confirmed and actionable label Oct 22, 2023
@sampsyo sampsyo changed the title TypeError in discogs plugin import whenever artist and title are empty discogs: TypeError whenever artist and title are empty Oct 25, 2023
@sampsyo
Copy link
Member

sampsyo commented Oct 25, 2023

Thank you for the detailed description! Looks very much like a bug.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug bugs that are confirmed and actionable
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants