Replies: 1 comment
-
|
Just realized there's a logic bug in the snippet, should be fixed here: with lib.transaction():
AlbumMatch(
distance=Distance(), info=album_info, mapping=mapping
).apply_metadata()
# Copy flexible attributes from album_info to album
for flex_key in (
"cover_art_url",
"data_source",
"label",
*(
self._flexible_attributes(name)
for name in AlbumFlexibleAttributes
),
):
if album_info.get(flex_key):
album[flex_key] = album_info[flex_key]
_ = show_model_changes(new=album)
changed: bool = False
any_changed_item: library.Item | None = items.get()
for item in items:
item_changed: bool = show_model_changes(new=item)
changed |= item_changed
if item_changed:
any_changed_item = item
apply_item_changes(lib, item, move, pretend, write)
if pretend:
continue
if any_changed_item and changed:
key: str
for key in album.item_keys - {
"original_day",
"original_month",
"original_year",
"genres",
"language",
"script",
}:
album[key] = any_changed_item[key]
album.store() # pyright: ignore[reportUnknownMemberType]
if (
move
and any_changed_item
and lib.directory in ancestry(path=any_changed_item.path)
):
self._log.debug("moving album {}", album)
album.move() # pyright: ignore[reportUnknownMemberType] |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
I'm confused about this snippet in the mbsync plugin:
I don't see fields like
labelthat are only stored in album_info being applied anywhere. Is this intentional? The reason I'm asking is because the plugin I'm working on, beets-vocadb, where the corresponding code currently looks like this:Is it correct like this?
Beta Was this translation helpful? Give feedback.
All reactions