Commit graph

2 commits

Author SHA1 Message Date
35c6e5f7bc feat(discovery): add Lemmy community search, fix dead request, add platform field
- Add app/services/lemmy/discovery.py: searches 5 major Lemmy instances,
  deduplicates by actor_id (AP canonical URL), skips NSFW communities,
  uses community@instance naming convention matching existing Lemmy client
- Update POST /subs/discover: accepts platforms[] param (default both),
  fans out to Reddit + Lemmy search, merges and sorts by subscribers
- Add platform field to all discovery result dicts (Reddit and Lemmy)
- Fix: remove dead _get() call left in search_subs() during earlier refactor
- Frontend: show platform badge on each discovery row, correct hyperlink
  format for Lemmy (https://{instance}/c/{community}), pass r.platform
  to upsertRules on import so Lemmy subs land in the lemmy platform slot
2026-06-13 22:23:31 -07:00
f39f36e258 feat(discovery): subreddit discovery and rule classification (#2)
- Add app/services/reddit/discovery.py:
  - search_subs(): searches /subreddits/search.json by keyword
  - analyze_sub(): fetches /about.json + /about/rules.json per sub
  - _classify_rules(): keyword-pattern classifier for promo policy
    (banned / conditional / unknown; hard to positively confirm allowed)
  - search_and_analyze(): combined search + per-sub analysis entry point
  - Unauthenticated-friendly (uses auth cookies when available)
- Add POST /subs/discover endpoint: returns candidate list with
  promo_allowed, flair_required, subscriber count, notes excerpt,
  and already_tracked flag. Nothing stored until user imports.
- Add SubDiscoveryResult interface and api.subs.discover() in api.ts
- Rework SubRulesView: slide-in discovery panel (right drawer),
  per-row Import button, auto-marks already-tracked subs, immutable
  result update on import

Closes: #2
2026-06-13 22:17:53 -07:00