Skip to content

Added Moonfin/Time: the server's clock and time zone - #341

Closed
benklop wants to merge 1 commit into
Moonfin-Client:masterfrom
benklop:feat/server-time
Closed

benklop wants to merge 1 commit into
Moonfin-Client:masterfrom
benklop:feat/server-time

Conversation

@benklop

@benklop benklop commented Oct 22, 2026

Copy link
Copy Markdown
Contributor

Pull Request

Summary

Adds GET /Moonfin/Time, which returns the server's clock and time zone. Jellyfin judges a user's access schedule against the server's local time and no stock endpoint reports it, so a Roku in another time zone can't tell when the account opens or next opens. Ping gains a timeSupported flag so clients know whether to ask.

Related Issues

Type of Change

  • New feature
  • API / endpoint change

Area

  • Other / shared

Changes Made

  • Jellyfin/backend/Api/ServerTimeController.cs: GET Moonfin/Time ([Authorize], like Ping) returns { utcTime, localTime, utcOffsetSeconds, timeZoneId, isDaylightSavingTime }. utcTime is ISO 8601 UTC with a trailing Z; localTime is the same instant on the server's wall clock with no offset, which is what a schedule is judged against; the offset is in seconds, east positive, and reflects daylight saving at that instant.
  • MoonfinController: timeSupported: true on the Ping response, nullable like the other capability flags, so an older plugin leaves it out and clients fall back to the device clock.
  • ServerTimeTests: the response for fixed instants and zones (positive and negative offsets, day rollover, a New York daylight saving switch) and the JSON keys clients read.

Client Impact

Compatibility

  • Change to the settings profile is additive only, no renamed or removed properties
  • New properties use the same type the client sends (a client bool maps to bool?, an int to int?)
  • Older clients still work, unknown fields are ignored and no keys were removed

The settings profile isn't touched. Emby is not changed: the Roku access schedule feature never watches Emby, so there is no caller. Say if you want it there too.

Testing

  • Built the plugin and deployed to a Jellyfin server
  • Verified against a live client
  • Manual testing completed
  • Not tested against a live server: only dotnet test of Moonfin.Server.Tests (576 passed) and a clean build. The endpoint needs a check against a running Jellyfin and a client in a different time zone.

Test Steps

  1. Install the build on a Jellyfin server whose time zone differs from your client's.
  2. GET /Moonfin/Time with a user token and check localTime against the server's wall clock.
  3. GET /Moonfin/Ping and check timeSupported is true.

Checklist

  • Code builds successfully
  • Code follows project style and conventions
  • No unnecessary commented-out code
  • No new warnings introduced
  • Any new setting keys match the client-side keys exactly

AI assistance

An AI assistant (Claude) wrote this change, as the contributing guide asks me to say.

🤖 Generated with Claude Code

…dules judged in server-local time

Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
Copilot AI balanced review requested due to automatic review settings October 22, 2026 16:40
@github-actions github-actions Bot added API Feature Request New feature or request labels Oct 22, 2026
@coderabbitai

coderabbitai Bot commented Oct 22, 2026

Copy link
Copy Markdown

Warning

Review limit reached

You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository.

Next included review available in 42 minutes.

Check out review usage here.

View limit details

Limit details: You’ve used all 2 included reviews currently available.

Learn how review limits work.

Review configuration:

⚙️ Run configuration
📥 Commits

Reviewing files that changed from the base of the PR and between aeb35f3 and 1316c9d.

📒 Files selected for processing: 3
  • Jellyfin/backend/Api/MoonfinController.cs
  • Jellyfin/backend/Api/ServerTimeController.cs
  • Jellyfin/tests/Moonfin.Server.Tests/ServerTimeTests.cs
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

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

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

Copilot AI 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.

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

An organization owner can choose the repository organization as the billing source for reviews requested by members with a paid Copilot license. Learn about Copilot code review billing.

@RadicalMuffinMan

Copy link
Copy Markdown
Contributor

Not tested against a live server: only dotnet test of Moonfin.Server.Tests (576 passed) and a clean build. The endpoint needs a check against a running Jellyfin and a client in a different time zone.

Please dont submit PRs unless you've tested it

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

API Feature Request New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants