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

[BUG] conflict between import set_fields configuration and convert plugin #4589

Open
J4gQBqqR opened this issue Dec 16, 2022 · 7 comments
Open
Assignees
Labels
needinfo We need more details or follow-up from the filer before this can be tagged "bug" or "feature."

Comments

@J4gQBqqR
Copy link

When the convert plugin is set to "auto: yes" and the import configuration has set_fields activated, the program will report error:

Traceback (most recent call last):
  File "/usr/bin/beet", line 33, in <module>
    sys.exit(load_entry_point('beets==1.6.0', 'console_scripts', 'beet')())
  File "/usr/lib/python3.10/site-packages/beets/ui/__init__.py", line 1285, in main
    _raw_main(args)
  File "/usr/lib/python3.10/site-packages/beets/ui/__init__.py", line 1272, in _raw_main
    subcommand.func(lib, suboptions, subargs)
  File "/usr/lib/python3.10/site-packages/beets/ui/commands.py", line 973, in import_func
    import_files(lib, paths, query)
  File "/usr/lib/python3.10/site-packages/beets/ui/commands.py", line 943, in import_files
    session.run()
  File "/usr/lib/python3.10/site-packages/beets/importer.py", line 340, in run
    pl.run_parallel(QUEUE_SIZE)
  File "/usr/lib/python3.10/site-packages/beets/util/pipeline.py", line 446, in run_parallel
    raise exc_info[1].with_traceback(exc_info[2])
  File "/usr/lib/python3.10/site-packages/beets/util/pipeline.py", line 311, in run
    out = self.coro.send(msg)
  File "/usr/lib/python3.10/site-packages/beets/util/pipeline.py", line 193, in coro
    func(*(args + (task,)))
  File "/usr/lib/python3.10/site-packages/beets/importer.py", line 1500, in import_asis
    apply_choice(session, task)
  File "/usr/lib/python3.10/site-packages/beets/importer.py", line 1523, in apply_choice
    task.set_fields(session.lib)
  File "/usr/lib/python3.10/site-packages/beets/importer.py", line 593, in set_fields
    self.album.store()
  File "/usr/lib/python3.10/site-packages/beets/library.py", line 1335, in store
    super().store(fields)
  File "/usr/lib/python3.10/site-packages/beets/library.py", line 344, in store
    super().store(fields)
  File "/usr/lib/python3.10/site-packages/beets/dbcore/db.py", line 534, in store
    tx.mutate(
  File "/usr/lib/python3.10/site-packages/beets/dbcore/db.py", line 866, in mutate
    cursor = self.db._connection().execute(statement, subvals)
sqlite3.InterfaceError: Error binding parameter 2 - probably unsupported type.

Config file that generate this error:

convert:
  auto: yes
  quiet: yes
  threads: 5
  hardlink: true
  tmpdir: /home/media/tmp
  dest: /home/media/music/newage
  album_art_maxwidth: 3000
  no_convert:
    format: opus
  format: opus
  formats:
    opus:
      command: ffmpeg -i $source -y -vn -acodec libopus -ab 128k $dest
      extension: opus

import:
  write: yes
  copy: no
  move: yes
  hardlink: yes
  resume: ask
  incremental: no
  incremental_skip_later: no
  autotag: no
  default_action: apply
  quiet: yes
  quiet_fallback: asis
  none_rec_action: asis
  timid: no
  log: /home/media/config/beets/newage/beet.log
  bell: yes
  from_scratch: yes
  set_fields:
    albumtypes: {}
    comments: {}
    genre: 'New Age'
@sampsyo sampsyo added the needinfo We need more details or follow-up from the filer before this can be tagged "bug" or "feature." label Dec 17, 2022
@sampsyo
Copy link
Member

sampsyo commented Dec 17, 2022

Hi! Thanks for the report! This looks annoying. I notice that not all of the values in this mapping are strings:

  set_fields:
    albumtypes: {}
    comments: {}
    genre: 'New Age'

Can you try setting these all to strings to see if the problem goes away?

@JOJ0 JOJ0 self-assigned this Mar 13, 2023
@stale
Copy link

stale bot commented May 21, 2023

Is this still relevant? If so, what is blocking it? Is there anything you can do to help move it forward?

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

@stale stale bot added the stale label May 21, 2023
@JOJ0
Copy link
Member

JOJ0 commented May 24, 2023

I have seen this problem too and will try what @sampsyo commented.

@stale stale bot removed the stale label May 24, 2023
@stale
Copy link

stale bot commented Aug 12, 2023

Is this still relevant? If so, what is blocking it? Is there anything you can do to help move it forward?

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

@stale stale bot added the stale label Aug 12, 2023
@JOJ0
Copy link
Member

JOJ0 commented Aug 12, 2023

Oh I wanted to try this...

@stale stale bot removed the stale label Aug 12, 2023
@J4gQBqqR
Copy link
Author

Hi, I can confirm that this is still not working. I am using Arch and installed the latest AUR beets-git version.
BTW, I currently have only one string in my set_fields:

  set_fields:
    genre: 'New Age'

@JOJ0
Copy link
Member

JOJ0 commented Jan 14, 2024

@J4gQBqqR try setting that field to string using the types plugin as sampsyo suggested #4589 (comment)

https://beets.readthedocs.io/en/latest/plugins/types.html

not sure if that helps, I guess genre, since it is a fixed lib field, is string type already...

or is it not genre but a user defined aka flexible field?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
needinfo We need more details or follow-up from the filer before this can be tagged "bug" or "feature."
Projects
None yet
Development

No branches or pull requests

3 participants