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

Feature: Implement public and private Trakt lists as sensors #107

Open
wants to merge 9 commits into
base: main
Choose a base branch
from

Conversation

downey-lv
Copy link
Contributor

@downey-lv downey-lv commented Jun 1, 2024

Created a new implementation of the highly requested Trakt lists. Tried to match your existing code as close as possible, but let me know if you want anything changed or have any suggestions for future contributions.

Currently doesn't support sorting,to keep the PR simpler, can implement that in the future.

Resolves #74, closes #75

Testing

Private list

      - friendly_name: "Sonarr Watchlist"
        private_list: True
        list_id: "sonarr-watchlist"

image

Public list

      - friendly_name: "2024 Academy Awards"
        list_id: 26885014
        max_medias: 10

image

Filtered list

      - friendly_name: "Marvel Episodes"
        list_id: 1248149
        media_type: "episode"

image

@dylandoamaral
Copy link
Owner

I will also check it ASAP, thank you !

@dylandoamaral
Copy link
Owner

It may be interesting to add the sorting strategy according to https://trakt.docs.apiary.io/#reference/users/list-items

@downey-lv
Copy link
Contributor Author

I started to look into it, but it was 1AM at that point 😃 Will check it out

@dylandoamaral
Copy link
Owner

I started to look into it, but it was 1AM at that point 😃 Will check it out

BTW the previous attempt added the sort feature if you need some inspiration:
https://github.com/dylandoamaral/trakt-integration/pull/75/files

Again thank you for your hard work !

@downey-lv
Copy link
Contributor Author

Improvements

  • Implemented your code review suggestions
  • Implemented sorting
  • Exposed trakt_rating to HA in case users prefer that over TMDB. Will look into populating this for all the other data sources in separate PR. Would probably allow to implement sorting everywhere as well.
  • Moved all date formatting to a utils function

Fixes

  • Set trakt.request return type to dict as it's not returning ClientResponse

Sorting demo

image

@downey-lv
Copy link
Contributor Author

I've synced with main and tested that everything works. Anything else before you can approve?

@dylandoamaral dylandoamaral added the enhancement New feature or request label Aug 27, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Trakt List Sensor
2 participants