Skip to content

Commit 29c50fe

Browse files
committed
CI (Claude) code review feedback
1 parent eefa59d commit 29c50fe

1 file changed

Lines changed: 7 additions & 4 deletions

File tree

  • src/palace/manager/celery/tasks

src/palace/manager/celery/tasks/marc.py

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -37,10 +37,12 @@
3737
# LibraryInfo fields that change between runs without a configuration change.
3838
_VOLATILE_LIBRARY_INFO_FIELDS = frozenset({"last_updated", "needs_update"})
3939

40-
# LibraryInfo tuple fields whose values are compared as unordered sets.
40+
# LibraryInfo tuple fields compared order-independently. Duplicate values are
41+
# significant: each web client URL produces its own 856 field, so a duplicate
42+
# URL changes the export and must register as a difference.
4143
# TODO: The `filtered_audiences` and `filtered_genres` library settings are
4244
# compared below, but changing them does not yet queue a MARC export reset.
43-
_UNORDERED_LIBRARY_INFO_FIELDS = frozenset(
45+
_ORDER_INSENSITIVE_LIBRARY_INFO_FIELDS = frozenset(
4446
{"web_client_urls", "filtered_audiences", "filtered_genres"}
4547
)
4648

@@ -128,12 +130,13 @@ def _export_settings_changed(snapshot: LibraryInfo, current: LibraryInfo) -> boo
128130
"""Whether a library's export-affecting settings differ between two LibraryInfo.
129131
130132
Ignores the fields that may change between runs without affecting the export
131-
and compares the tuple fields as unordered sets of values.
133+
and compares the tuple fields order-independently, with duplicate values
134+
significant.
132135
"""
133136

134137
def comparable(info: LibraryInfo) -> dict[str, Any]:
135138
dumped = info.model_dump(exclude=set(_VOLATILE_LIBRARY_INFO_FIELDS))
136-
for field in _UNORDERED_LIBRARY_INFO_FIELDS:
139+
for field in _ORDER_INSENSITIVE_LIBRARY_INFO_FIELDS:
137140
dumped[field] = sorted(dumped[field])
138141
return dumped
139142

0 commit comments

Comments
 (0)