Commit Graph

41 Commits

Author SHA1 Message Date
7ef8912d69 feat: wrapup worker handler + auto-generate job 2026-06-02 22:13:08 +02:00
b171d2d1e2 feat(application): wrapup generate/get/list use cases 2026-06-02 22:09:08 +02:00
4c75113c4f chore: wire WrapUpStatsQuery panic stub into binaries
Some checks failed
CI / Check / Test (push) Failing after 44s
2026-06-02 21:49:54 +02:00
28170c95d4 chore: fmt + remove dead federation module
Some checks failed
CI / Check / Test (push) Failing after 5m58s
2026-06-02 20:44:08 +02:00
ac7edd6953 WIP: federation + integrations
Some checks failed
CI / Check / Test (push) Failing after 5m56s
2026-06-02 19:50:19 +02:00
aadad3cfb0 feat: Jellyfin/Plex auto-import via watch queue
Some checks failed
CI / Check / Test (push) Failing after 6m5s
Webhook ingestion from media servers — movies land in a pending
watch queue, user rates and confirms to create diary entries.

- domain: WatchEvent, WebhookToken models, MediaServerParser port
- adapters: jellyfin + plex parser crates, SQLite + Postgres repos
- application: ingest/confirm/dismiss/cleanup use cases, token mgmt
- presentation: webhook endpoints (bearer + query param auth),
  watch queue + integrations settings HTML pages, OpenAPI docs
- worker: WatchEventCleanupJob (daily, 30d retention)

Movie resolution deferred to confirm — single canonical path
through log_review for enrichment, poster fetch, federation.
2026-06-02 17:34:16 +02:00
c3b89f6dc6 refactor: extract business logic from handlers to application layer
Some checks failed
CI / Check / Test (push) Has been cancelled
CI / Release build (push) Has been cancelled
Move domain logic out of 7 handlers into use cases:
- activity feed: FollowingFilter construction
- user profile: social counts + pending followers
- users list: parallel local+remote actor loading
- watchlist page: local-vs-remote branching
- sync_poster: movie lookup + validation
- get_profile: avatar URL construction
- post_register: register+login orchestration

Add SocialQueryPort.{count_following,count_accepted_followers,
get_pending_followers} to AppContext behind federation feature gate.
2026-05-29 11:41:16 +02:00
2355f89bed refactor: fix all clippy warnings properly
- UserProfile struct groups display_name/bio/avatar/banner/also_known_as/profile_fields
- User::from_persistence takes UserProfile (6 args, was 11)
- PersistedReview struct for Review::from_persistence (1 arg, was 8)
- WatchlistApInput struct for watchlist_to_ap_object (1 arg, was 8)
- ActivityPubDeps struct for activitypub::wire (1 arg, was 11)
- FederationRepos type alias for wire() return types
- FeedSortBy: impl std::str::FromStr instead of inherent from_str
- postgres users.rs: row_to_user takes &PgRow like sqlite
- collapse nested ifs in multipart handlers
- type alias for complex return types (image-converter, worker)
- tui: allow large_enum_variant at crate level (pre-existing, unrelated)
2026-05-29 11:19:02 +02:00
68a939f6c4 Refactor code for improved readability and consistency
- Simplified error handling in `PostgresApContentQuery` and `SqliteApContentQuery` by aligning the formatting of `try_get` calls.
- Removed unnecessary line breaks and improved formatting in various repository implementations for better readability.
- Consolidated imports in `lib.rs` and `factory.rs` to maintain a cleaner structure.
- Enhanced consistency in async function signatures across multiple files.
- Updated test helpers and use cases to streamline code and improve clarity.
- Refactored `InMemory` repositories to enhance readability by aligning method implementations.
2026-05-29 10:58:44 +02:00
36d15e1344 fix: AP bugs — backfill mapping, review activity type, also_known_as parse
- BackfillRequested now maps to BackfillFollower domain event (not FollowAccepted);
  worker calls run_backfill_for_follower to send LOCAL content to new follower inbox,
  instead of incorrectly trying to import from an inbox URL as if it were an outbox
- reviews broadcast as Create activity instead of Add (semantically correct)
- also_known_as JSON parse failure logs warning + preserves raw string as single-element
  vec instead of silently returning empty
2026-05-29 10:54:11 +02:00
624cfe5799 feat: migrate k-ap 0.1.10→0.3.1, fix AP gaps
- split FederationRepository into FollowRepository, ActorRepository, BlocklistRepository, ActivityRepository
- RemoteActor: 5 new fields (bio, banner_url, followers_url, following_url, also_known_as)
- ApObjectHandler split: get_local_objects_page/count_local_posts → ApContentReader trait
- builder API: positional args → named setters
- broadcast_create_note/update_note: add ApVisibility + mentioned_inboxes params
- backfill_outbox → import_remote_outbox
- ApUser: also_known_as Option<String> → Vec<String>, new fields

AP gaps fixed:
- add GET /users/{id}/followers + /following with content negotiation
- wire EventPublisher into builder via FederationEventBridge adapter
- add display_name field full stack (domain→DB→API→AP)
- DB-side outbox pagination (get_local_reviews_page)
- set featured_url on ApUser
2026-05-29 10:42:53 +02:00
51bd580a04 watchlist backfill
Some checks failed
CI / Check / Test (push) Failing after 57s
CI / Release build (push) Has been skipped
2026-05-28 03:52:38 +02:00
6efc47a891 chore: replace local activitypub-base with k-ap git dep 2026-05-17 23:06:20 +02:00
19171806b9 fmt
Some checks failed
CI / Check / Test / Build (push) Has been cancelled
2026-05-13 23:38:57 +02:00
fdd61ae701 feat: refactor user profile handling and integrate ApProfileField structure 2026-05-13 22:59:38 +02:00
815178e6a4 feat(ap): ActivityPub spec compliance and profile completeness
Phase 1 — spec compliance:
- Add AS_PUBLIC constant; add to/cc fields to CreateActivity, DeleteActivity,
  UpdateActivity, AddActivity; populate on all broadcast call sites
- Add @context to outbox CreateActivity items
- Set manuallyApprovesFollowers: true to match actual Pending follow flow
- Gate PermissiveVerifier behind FEDERATION_DEBUG env var
- Add updated timestamp to Person actor JSON
- Improve actor update delivery logging

Phase 2a Batch 1 — AP layer:
- Add /inbox shared inbox route; add endpoints.sharedInbox to Person
- Paginate followers and following collections (20/page, OrderedCollectionPage)

Phase 2a Batch 2 — profile completeness:
- DB migrations: banner_path, also_known_as columns; user_profile_fields table
- ProfileField value object; UserProfileFieldsRepository port
- Banner image upload (stored via image-converter, surfaced as image in Person)
- alsoKnownAs field in Person (account migration support)
- Custom profile fields (up to 4 PropertyValue attachments in Person)
- Profile settings UI: banner preview/upload, alsoKnownAs input, fields form
- PUT /api/v1/profile/fields API endpoint
2026-05-13 22:21:41 +02:00
20e70325c6 feat: add FollowBackfillHandler to worker 2026-05-13 01:34:04 +02:00
ca9a504632 feat: wire event_publisher through activitypub::wire() 2026-05-13 01:30:30 +02:00
31fbb79451 refactor: remove watchlist repository references and add get_remote_watchlist use case 2026-05-13 00:34:23 +02:00
53df90ab1f feat: MovieDto enrichment, movie detail page, PWA, watchlist, watchlist federation 2026-05-13 00:23:45 +02:00
2fd8734d23 fix: close search index consistency gaps (orphan cleanup, discovery indexing, poster sync) 2026-05-12 19:05:22 +02:00
c6770659c5 feat: extensible search engine with person entities (FTS5/tsvector) 2026-05-12 18:47:06 +02:00
cea414fe60 refactor: split ImageRefPort into ImageRefCommand and ImageRefQuery 2026-05-12 15:10:49 +02:00
696e3e170c feat: async image conversion service (avif/webp) with backfill 2026-05-12 15:05:28 +02:00
fb81aa10c1 feat: enable TMDb enrichment with conditional event handling 2026-05-12 13:29:43 +02:00
78c2d9b1d3 feat: implement database connection and event bus handling 2026-05-12 13:28:13 +02:00
38d13fbff1 feat: implement TMDb enrichment for movie profiles
- Add SqliteMovieProfileRepository for managing movie profiles in SQLite.
- Create TmdbEnrichmentClient to fetch movie details from TMDb API.
- Implement enrichment event handling with EnrichmentHandler.
- Introduce periodic jobs for cleaning up expired import sessions and checking for stale movie profiles.
- Update application context to include movie profile repository.
- Add API endpoint to retrieve movie profiles.
- Extend domain models with new structures for movie enrichment (Genre, Keyword, CastMember, CrewMember, MovieProfile).
- Modify event system to include MovieEnrichmentRequested event.
- Enhance tests to cover new functionality and ensure stability.
2026-05-12 13:23:41 +02:00
99ce81efe5 refactor: deps cleanup, split openapi, extract api-types crate 2026-05-12 11:54:00 +02:00
6eeba2cf57 feat: review delete/update AP propagation, remote actor avatars, OpenAPI updates
- Send Delete activity when a review is deleted
- Send Update(Note) activity when a review is edited
- Remote actor avatars shown in followers/following pages
- OpenAPI spec updated with profile, blocked domains, blocked actor endpoints
- Fix: worker wire() call missing allow_registration argument
2026-05-12 02:02:41 +02:00
80f620c840 feat: image storage generalization, user profile, and federation polish
- Replace PosterStorage with generic ImageStorage port (IMAGE_STORAGE_BACKEND/PATH env vars)
- Rename poster-storage crate to image-storage; serve at /images/{*key}
- Add bio and avatar_path to User model (migration 0009_user_profile)
- update_profile use case with avatar upload, mime validation, old avatar cleanup
- GET/PUT /api/v1/profile and GET/POST /settings/profile HTML page
- Enrich AP Person actor with summary, icon, url, discoverable fields
- Store remote actor avatar_url (migration 0010_ap_remote_actor_avatar)
- Shared inbox delivery via collect_inboxes deduplication
- Broadcast Update(Person) to followers on UserUpdated event
- Paginated outbox: OrderedCollection + OrderedCollectionPage with cursor
- Announce/boost tracking in ap_announces table (migration 0011_ap_announces)
2026-05-11 22:59:52 +02:00
8a254346f4 inbox rate limiting + poster storage cleanup 2026-05-11 01:07:21 +02:00
b2a2aa4262 movie detail page + importer architecture fix 2026-05-10 23:59:26 +02:00
f2f1317660 importer feature 2026-05-10 21:23:56 +02:00
e461c689d9 feat: add axum dependency and implement wiring functions for federation repositories 2026-05-10 18:58:41 +02:00
810d051dee Refactor event payload handling across adapters
- Introduced `event-payload` crate to centralize event payload definitions.
- Updated NATS and PostgreSQL adapters to use the new `EventPayload` type.
- Removed redundant event payload definitions and conversion implementations from NATS and PostgreSQL adapters.
- Simplified SQLite event queue to utilize the new `EventPayload`.
- Refactored wiring functions for PostgreSQL and SQLite to improve database connection handling and migration.
- Cleaned up presentation and worker crates by removing unused event publisher dependencies and related wiring functions.
2026-05-10 18:41:42 +02:00
af25a43bbc feat: add federation support with SQLite and Postgres repositories 2026-05-10 18:22:24 +02:00
9ca5bebe59 feat: refactor database connection handling to use DbPool enum for better abstraction 2026-05-10 18:03:08 +02:00
c2a5541706 feat: implement event bus backend configuration for DB and NATS 2026-05-10 17:55:51 +02:00
37b0e07055 feat: implement SQLite and Postgres event queue adapters
- Added SQLite and Postgres event queue implementations with migrations and payload structures.
- Created migration scripts for both SQLite and Postgres event queues.
- Implemented event publishing and consumption logic for both adapters.
- Added serialization and deserialization for domain events to database payloads.
- Updated presentation and worker crates to support new event queue features.
- Refactored event handling to utilize the new database-backed event queues.
2026-05-10 16:09:36 +02:00
8678bbf391 nats adapter 2026-05-10 13:42:28 +02:00
05b44e17a1 background worker 2026-05-10 11:12:52 +02:00