Note: This work is licensed under the Apache License 2.0. If you contribute any non-trivial patches make sure to read and agree with the license.
Note: Keep your pull requests small, otherwise it is less likely they will get merged.
Note: This project is built with Maven, see the pom.xml in the root folder.
-
Create a new branch and make great commits + messages:
- Each line should be 72 characters or less.
- Add a subject line and body text separated by an empty line.
- Describe why this change, how does it address an issue or what side effects it has.
- Link related issues or documentation as needed.
-
If you add or modify methods, make sure to also create and run basic tests (see
src/test). -
Start a pull request against
main.
The tests require at least two credentials to run:
TEST_CLIENT_ID: A Trakt API client IDTEST_ACCESS_TOKEN: A Trakt API access token
They can be set either
- in a
secrets.propertiesfile (a template is available in secrets.properties.template) - or as environment variables.
If both are set, environment variables take precedence over the properties file.
To obtain Trakt API credentials:
- Create a Trakt account at https://trakt.tv (
⚠️ Tests do modify data of the Trakt account, don't use your personal account!) - Register an application at https://trakt.tv/oauth/applications
- Copy the Client ID and set it as
TEST_CLIENT_ID - Copy the Client Secret and set it as
TEST_CLIENT_SECRET - Add
http://localhostto the Redirect URIs - Click the "Authorize" button next to the localhost redirect URI and authorize access (alternatively, run
test_getAuthorizationRequest()in AuthTest and visit the URL it prints) - Extract the value of
codefrom the redirect URI and set it asTEST_AUTH_CODE - Run
test_getAccessToken()in AuthTest - Copy the printed access and refresh token and set them as
TEST_ACCESS_TOKENandTEST_REFRESH_TOKEN
If TEST_ACCESS_TOKEN is expired, but TEST_REFRESH_TOKEN isn't:
- Run
test_refreshAccessToken()in AuthTest - Copy the printed access and refresh token and set them as
TEST_ACCESS_TOKENandTEST_REFRESH_TOKEN
Otherwise, repeat steps 6 and following from above.
You can discuss or submit bug reports!