Skip to content

Commit

Permalink
Better messaging around skipping for is_wiki_eligible reasons.
Browse files Browse the repository at this point in the history
  • Loading branch information
mdellabitta committed Jan 12, 2025
1 parent 0fe5e85 commit 38bcf82
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
6 changes: 3 additions & 3 deletions ingest_wikimedia/metadata.py
Original file line number Diff line number Diff line change
Expand Up @@ -51,14 +51,14 @@ def is_wiki_eligible(item_metadata: dict, provider: dict, data_provider: dict) -
)

if not provider_ok:
logging.warning("Bad provider.")
logging.info("Bad provider.")

rights_category_ok = (
get_str(item_metadata, RIGHTS_CATEGORY_FIELD_NAME) == UNLIMITED_RE_USE
)

if not rights_category_ok:
logging.warning("Bad rights category.")
logging.info("Bad rights category.")

is_shown_at = get_str(item_metadata, EDM_IS_SHOWN_AT)
media_master = len(get_list(item_metadata, MEDIA_MASTER_FIELD_NAME)) > 0
Expand All @@ -75,7 +75,7 @@ def is_wiki_eligible(item_metadata: dict, provider: dict, data_provider: dict) -
asset_ok = (media_master is not None) or (iiif_manifest is not None)

if not asset_ok:
logging.warning("Bad asset.")
logging.info("Bad asset.")

# todo create banlist. item based? sha based? local id based? all three?
# todo don't re-upload if deleted
Expand Down
4 changes: 2 additions & 2 deletions tools/uploader.py
Original file line number Diff line number Diff line change
Expand Up @@ -96,8 +96,7 @@ def process_file(

if not ext:
logging.info(
f"Skipping {dpla_id} {ordinal}: "
f"Unable to guess extension for {mime}"
f"Skipping {dpla_id} {ordinal}: Unable to guess extension for {mime}"
)
tracker.increment(Result.SKIPPED)
return
Expand Down Expand Up @@ -195,6 +194,7 @@ def process_item(
)

if not is_wiki_eligible(item_metadata, provider, data_provider):
logging.info(f"Skipping {dpla_id}: Not eligible.")
tracker.increment(Result.SKIPPED)
return

Expand Down

0 comments on commit 38bcf82

Please sign in to comment.