Skip to content

Commit a1f0909

Browse files
committed
Address broken tests.
1 parent 7d42839 commit a1f0909

2 files changed

Lines changed: 9 additions & 2 deletions

File tree

src/palace/manager/celery/opds.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,7 @@ def opds_import_task[FeedType](
5252
collection,
5353
url,
5454
apply_bibliographic=apply.bibliographic_apply.delay,
55+
apply_circulation=apply.circulation_apply.delay,
5556
identifier_set=identifier_set,
5657
import_even_if_unchanged=force,
5758
)

src/palace/manager/integration/license/opds/importer.py

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -385,10 +385,16 @@ def import_feed(
385385
)
386386
called_bibliographic_apply = True
387387
elif (
388-
bibliographic.circulation is not None and apply_circulation is not None
388+
bibliographic.circulation is not None
389+
and apply_circulation is not None
390+
and (
391+
import_even_if_unchanged
392+
or bibliographic.circulation.needs_apply(session, collection)
393+
)
389394
):
390395
circulation_data = bibliographic.circulation
391-
# If the bibliographic data is unchanged, we still want to apply the circulation data
396+
# Bibliographic data is unchanged but circulation data has changed
397+
# (e.g. availability state flipped); apply only the circulation update.
392398
apply_circulation(
393399
circulation_data,
394400
collection_id=collection.id,

0 commit comments

Comments
 (0)