Files
rclone-jav/rcjav/__init__.py
T
admin 8d636ec633 Step 10d: extract dupes/keep-ranking into rcjav/dupes.py
Pulls the duplicate-detection and keep-ranking surface out of
rc-jav.py:

  DEFAULT_KEEP_RANKING
  _KEEP_RANKING (module global)
  decide_keep_with_reason
  decide_keep
  find_dupes
  _SUSPICIOUS_MULTIPART_TAIL_RE
  describe_dupe_risks
  find_variant_alerts

Same mutable-rebound pattern as PART_RES: `_KEEP_RANKING` is now
configured via `set_keep_ranking(dict)` rather than a `global` write
in rc-jav.py's main(). Reads happen only inside the module that owns
the binding, so callers never see a stale snapshot.

rc-jav.py: 1972 → 1763 lines (209 extracted).
rcjav/dupes.py: 244 lines.

Verified:
  - python rc-jav.py --help              → ok
  - python fixtures/run.py               → 17/17 cases pass
  - python -m unittest tests.test_rules  → 5/5 OK

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-05-22 21:49:14 +02:00

44 lines
1.0 KiB
Python

"""rcjav — internal package split out of rc-jav.py.
This file re-exports the names that external callers (tests, fixtures
runner, native messaging host, in-tree code in rc-jav.py) expect to
find at the top level. Adding a new submodule does not change the
public surface — only this file does.
"""
from rcjav.model import FileEntry # noqa: F401
from rcjav.dupes import ( # noqa: F401
DEFAULT_KEEP_RANKING,
set_keep_ranking,
get_keep_ranking,
decide_keep_with_reason,
decide_keep,
find_dupes,
describe_dupe_risks,
find_variant_alerts,
)
from rcjav.cache import ( # noqa: F401
CACHE_PATH,
CACHE_VERSION,
CACHE_STALE_HOURS,
load_cache,
save_cache,
cache_age_hours,
fmt_age,
)
from rcjav.ids import ( # noqa: F401
PRIMARY_ID_RE,
FALLBACK_ID_RE,
COMPOUND_ID_RE,
RANGE_RE,
BUILTIN_PART_RES,
PART_RES,
configure_part_patterns,
detect_part,
detect_part_from_stem,
part_key,
extract_id,
normalize_id,
describe_id_match,
expand_range,
)