feat: preserve start and end dates during sync (fixes #53)#54
Merged
Conversation
- UpdateAnimeEntry: replace prefix parameter with startedAt/completedAt - UpdateMangaEntry: replace prefix parameter with startedAt/completedAt - Add timeToFuzzyDateInput helper for AniList FuzzyDateInput format - Only send dates when non-nil (omit to preserve existing manually-set dates) - Add comprehensive doc comments explaining date handling behavior
- Add sameDates() helper for comparing date pointers at day-level granularity - Modify SameProgressWithTarget() to compare StartedAt and FinishedAt - Only compare FinishedAt when status is COMPLETED (prevents infinite loops) - Modify GetStringDiffWithTarget() to include date fields in diff output
- Modify SameProgressWithTarget() to compare StartedAt and FinishedAt - Only compare FinishedAt when status is COMPLETED (prevents infinite loops) - Modify GetStringDiffWithTarget() to include date fields in diff output
- Modify AniListAnimeService.Update() to pass StartedAt and FinishedAt (only completedAt when status is COMPLETED) - Modify AniListMangaService.Update() to pass dates (only completedAt when status is COMPLETED) - Remove unused prefix parameter
- Add TestTimeToFuzzyDateInput - test nil and valid dates, edge cases - Add TestSameDates - test all combinations of nil/set dates - Add TestAnime_SameProgressWithTarget_Dates - comprehensive date comparison scenarios - Add TestAnime_GetStringDiffWithTarget_Dates - verify dates appear in diff - Add TestManga_SameProgressWithTarget_Dates - manga-specific date tests - Add TestManga_GetStringDiffWithTarget_Dates - manga diff tests
- Add docs/date-sync.md with comprehensive date sync documentation - Update CLAUDE.md to reference date-sync.md in components table - Add note about date preservation in sync directions section
Remove unused jikanGo and x/time packages
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Closes #53
This PR adds support for preserving start and end dates when synchronizing between MyAnimeList and AniList. Previously, manually set dates were lost during sync, or replaced with sync timestamps.
Changes
startedAtandcompletedAtfieldsFinishedAtis only synced when status is COMPLETED (prevents infinite update loops for non-completed entries)Behavior
Test Plan