Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improve Timezone Handling and Fix End Date Picker #101

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

a-mnich
Copy link

@a-mnich a-mnich commented Feb 1, 2025

This pull request introduces several changes to the Jellyfin.Plugin.PlaybackReporting plugin, primarily focusing on handling user-server timezone offsets more accurately and fixing the end date date picker across various reports.

Timezone Handling Improvements

  • Added a new method, CalculateUserServerTimezoneOffset, to compute the timezone offset between the user and the server. This is necessary because the plugin currently saves playback reporting database entries using the server's local timezone (instead of UTC). Therefore, a timezone offset is only needed if the timezones of the user and server differ.
  • Although saving the entries directly in UTC would be the cleaner approach, changing this now would be a breaking change for all data already saved. I wanted to avoid this.
  • Updated the GetUsageForUser, GetUsageForDays, GetHourlyUsageReport, GetBreakdownReport, GetTvShowReport, GetMoviesReport, and GetUserReport methods to use the new timezone offset calculation method.

Invalid URL Parameter

Fixed the URL parameter end_date/endDate in various JavaScript API calls, which caused the end date date picker not to work.

resolves #47
resolves #31
resolves #94

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
1 participant