-
Couldn't load subscription status.
- Fork 1.9k
Open
Labels
bugbugs that are confirmed and actionablebugs that are confirmed and actionablepluginPull requests that are plugins relatedPull requests that are plugins related
Description
Problem
Looks like there's a uncaught recursive condition in the inline plugin when, disabling inline removed the issue. I've attempted this with a few other integer fields and had no issues. It seems specific to the track_no field. I'll see if I can dig into it, but putting this here in case anyone is quicker to it.
Command:
$ beet -vv beet modify 'track name' track_no=2 Modifying 47 items.
Traceback (most recent call last):
File "/home/henry/.local/bin/beet", line 7, in <module>
sys.exit(main())
^^^^^^
File "/home/henry/.local/share/pipx/venvs/beets/lib/python3.12/site-packages/beets/ui/__init__.py", line 1713, in main
_raw_main(args)
File "/home/henry/.local/share/pipx/venvs/beets/lib/python3.12/site-packages/beets/ui/__init__.py", line 1692, in _raw_main
subcommand.func(lib, suboptions, subargs)
File "/home/henry/.local/share/pipx/venvs/beets/lib/python3.12/site-packages/beets/ui/commands.py", line 2038, in modify_func
modify_items(
File "/home/henry/.local/share/pipx/venvs/beets/lib/python3.12/site-packages/beets/ui/commands.py", line 1968, in modify_items
if print_and_modify(obj, obj_mods, dels) and obj not in changed:
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/henry/.local/share/pipx/venvs/beets/lib/python3.12/site-packages/beets/ui/commands.py", line 2012, in print_and_modify
return ui.show_model_changes(obj)
^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/henry/.local/share/pipx/venvs/beets/lib/python3.12/site-packages/beets/ui/__init__.py", line 1116, in show_model_changes
f" {field}: {colorize('text_highlight', new_fmt[field])}"
~~~~~~~^^^^^^^
File "/home/henry/.local/share/pipx/venvs/beets/lib/python3.12/site-packages/beets/library/models.py", line 198, in __getitem__
value = self._get(key)
^^^^^^^^^^^^^^
File "/home/henry/.local/share/pipx/venvs/beets/lib/python3.12/site-packages/beets/library/models.py", line 186, in _get
return self._get_formatted(self.model, key)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/henry/.local/share/pipx/venvs/beets/lib/python3.12/site-packages/beets/dbcore/db.py", line 134, in _get_formatted
value = model._type(key).format(model.get(key))
^^^^^^^^^^^^^^
File "/home/henry/.local/share/pipx/venvs/beets/lib/python3.12/site-packages/beets/library/models.py", line 871, in get
return self._get(key, default, raise_=with_album)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
The following chunk is caught in a loop until the maximum recursive depth is exceeded:
File "/home/henry/.local/share/pipx/venvs/beets/lib/python3.12/site-packages/beets/dbcore/db.py", line 462, in _get
return getters[key](self)
^^^^^^^^^^^^^^^^^^
File "/home/henry/.local/share/pipx/venvs/beets/lib/python3.12/site-packages/beetsplug/inline.py", line 108, in _expr_func
values = _dict_for(obj)
^^^^^^^^^^^^^^
File "/home/henry/.local/share/pipx/venvs/beets/lib/python3.12/site-packages/beetsplug/inline.py", line 100, in _dict_for
out = dict(obj)
^^^^^^^^^
File "/home/henry/.local/share/pipx/venvs/beets/lib/python3.12/site-packages/beets/library/models.py", line 837, in __getitem__
return super().__getitem__(key)
^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/henry/.local/share/pipx/venvs/beets/lib/python3.12/site-packages/beets/dbcore/db.py", line 481, in __getitem__
return self._get(key, raise_=True)
^^^^^^^^^^^^^^^^^^^^^^^^^^^**
Setup
- OS: Windows 11, Linux
- Python version: 3.12
- beets version: 2.5.1
- Turning off plugins made problem go away (yes/no): yes
My configuration (output of beet config) is:
# --------------- Main ---------------
library: /mnt/data/media/musiclibrary.db
import:
copy: yes
write: yes
# --------------- Plugins ---------------
plugins: inline
album_fields:
quality: "qual = \"\"\nif len(set([item.format for item in items])) != 1 or len(set([item.bitdepth for item in items])) != 1 or len(set([item.samplerate for item in items])) != 1:\n qual += \"[MUTT]\"\ni = items[0]\nif i.format == \"MP3\":\n qual += f\"[MP3 {i.bitrate // 1000}]\"\nelse:\n qual += f\"[{i.format} {i.bitdepth}-{i.samplerate // 1000}]\"\nreturn qual\n"
item_fields:
track_no: f"{disc:02d}-{track:02d}" if disctotal > 1 else f"{track:02d}"
asciify_paths: yes
# --------------- Tagging ---------------
per_disc_numbering: yes
paths:
vinyl_rip:1: vinyl_rips/%lower{%left{%the{$albumartist}, 1}}/%the{$albumartist}/$album ($original_year, $label%if{$catalognum, $catalognum}) $quality/$track_no - $artist - $title
default: digital/%lower{%left{%the{$albumartist}, 1}}/%the{$albumartist}/$album ($original_year, $label%if{$catalognum, $catalognum}) $quality/$track_no - $artist - $title
comp: digital/%lower{%left{%the{$albumartist}, 1}}/%the{$albumartist}/$album ($original_year, $label%if{$catalognum, $catalognum}) $quality/$track_no - $artist - $title
discogs:
append_style_genre: yes
source_weight: 0.0
album_artist_anv: no
track_artist_anv: yes
featured_label: feat.
match:
strong_rec_thresh: 0.2
required: year label
ignore_data_tracks: yes
preferred:
media: [File|Digital Media, CD, Vinyl]
ignored_media:
- Data CD
- DVD
- DVD-Video
- Blu-ray
- HD-DVD
- VCD
- SVCD
- UMD
- VHS
replaygain:
threads: 4
overwrite: no
backend: ffmpeg
# --------------- Search ---------------
format_item: $artist - $album - $title ($year, $label%if{$catalognum, $catalognum})
format_album: $albumartist - $album ($year, $label%if{$catalognum, $catalognum})
# --------------- Performance ---------------
threaded: yes
incremental: yes
duplicate_verbose_prompt: yes
color: yes
disabled_plugins: []
pathfields: {}Metadata
Metadata
Assignees
Labels
bugbugs that are confirmed and actionablebugs that are confirmed and actionablepluginPull requests that are plugins relatedPull requests that are plugins related