Skip to content

feat(instagram): add media count fields#1664

Merged
nbartels merged 1 commit into
devfrom
feat/ig-media-fields
Apr 30, 2026
Merged

feat(instagram): add media count fields#1664
nbartels merged 1 commit into
devfrom
feat/ig-media-fields

Conversation

@nbartels

@nbartels nbartels commented Apr 30, 2026

Copy link
Copy Markdown
Contributor

Summary

  • Add missing Instagram media count fields from the current Meta documentation.
  • Document field availability and endpoint restrictions in Javadocs.

Verification

  • mvn -q -DskipTests compile

Summary by CodeRabbit

  • New Features
    • Extended Instagram media analytics support with new engagement metrics: view count, reposts count, saved count, shares count, total comments, total likes, and total views.

@coderabbitai

coderabbitai Bot commented Apr 30, 2026

Copy link
Copy Markdown
📝 Walkthrough

Walkthrough

Added seven new Long properties to the IgMedia class to support additional Instagram media insight metrics: viewCount, repostsCount, savedCount, sharesCount, totalCommentsCount, totalLikeCount, and totalViewsCount. Each property is annotated with @Getter, @Setter, and @Facebook for API field mapping.

Changes

Cohort / File(s) Summary
Instagram Media Metrics
src/main/lombok/com/restfb/types/instagram/IgMedia.java
Added 7 new Long metric properties (viewCount, repostsCount, savedCount, sharesCount, totalCommentsCount, totalLikeCount, totalViewsCount) with Lombok and Facebook annotations for enhanced Instagram media engagement data capture.

Estimated code review effort

🎯 1 (Trivial) | ⏱️ ~5 minutes

Poem

🐰 Seven metrics hop into view,
New counts for posts both old and new,
Views and shares and likes galore,
Instagram data, rich encore! 📊✨

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title 'feat(instagram): add media count fields' accurately describes the main change: adding new count/metric fields to the IgMedia class for Instagram media engagement data.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch feat/ig-media-fields

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share
Review rate limit: 7/8 reviews remaining, refill in 7 minutes and 30 seconds.

Comment @coderabbitai help to get the list of available commands and usage tips.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🧹 Nitpick comments (1)
src/main/lombok/com/restfb/types/instagram/IgMedia.java (1)

110-185: ⚡ Quick win

Add focused deserialization tests for the new metric fields.

Please add/extend JSON-mapper tests to assert each new API key (view_count, reposts_count, saved_count, shares_count, total_comments_count, total_like_count, total_views_count) populates the intended property and remains null when omitted.

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@src/main/lombok/com/restfb/types/instagram/IgMedia.java` around lines 110 -
185, Add focused JSON deserialization tests for the new IgMedia metric fields:
viewCount (Facebook key "view_count"), repostsCount ("reposts_count"),
savedCount ("saved_count"), sharesCount ("shares_count"), totalCommentsCount
("total_comments_count"), totalLikeCount ("total_like_count"), and
totalViewsCount ("total_views_count"). Locate the existing Instagram media
JSON-mapper tests (the test suite that exercises
com.restfb.types.instagram.IgMedia) and add cases that (1) deserialize a JSON
object containing each of those keys and assert the corresponding IgMedia
getters (getViewCount, getRepostsCount, getSavedCount, getSharesCount,
getTotalCommentsCount, getTotalLikeCount, getTotalViewsCount) are populated with
the expected Long values, and (2) deserialize JSON that omits those keys and
assert the same getters return null; keep tests small and focused on these
properties only.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Nitpick comments:
In `@src/main/lombok/com/restfb/types/instagram/IgMedia.java`:
- Around line 110-185: Add focused JSON deserialization tests for the new
IgMedia metric fields: viewCount (Facebook key "view_count"), repostsCount
("reposts_count"), savedCount ("saved_count"), sharesCount ("shares_count"),
totalCommentsCount ("total_comments_count"), totalLikeCount
("total_like_count"), and totalViewsCount ("total_views_count"). Locate the
existing Instagram media JSON-mapper tests (the test suite that exercises
com.restfb.types.instagram.IgMedia) and add cases that (1) deserialize a JSON
object containing each of those keys and assert the corresponding IgMedia
getters (getViewCount, getRepostsCount, getSavedCount, getSharesCount,
getTotalCommentsCount, getTotalLikeCount, getTotalViewsCount) are populated with
the expected Long values, and (2) deserialize JSON that omits those keys and
assert the same getters return null; keep tests small and focused on these
properties only.

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 91039da6-897e-439f-914d-172a3b6dc738

📥 Commits

Reviewing files that changed from the base of the PR and between 25abdea and a8c7ad5.

📒 Files selected for processing (1)
  • src/main/lombok/com/restfb/types/instagram/IgMedia.java

@nbartels nbartels added this to the 2026.4.0 milestone Apr 30, 2026
@nbartels nbartels self-assigned this Apr 30, 2026
@nbartels
nbartels merged commit a9fc00c into dev Apr 30, 2026
4 checks passed
@nbartels nbartels modified the milestones: 2026.4.0, 2026.5.0 Apr 30, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant