trakt-integration icon indicating copy to clipboard operation
trakt-integration copied to clipboard

Feature: Implement public and private Trakt lists as sensors

Open downey-lv opened this issue 1 year ago • 8 comments

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

downey-lv avatar Jun 01 '24 18:06 downey-lv

I will also check it ASAP, thank you !

dylandoamaral avatar Jun 02 '24 14:06 dylandoamaral

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

dylandoamaral avatar Jun 02 '24 18:06 dylandoamaral

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

downey-lv avatar Jun 02 '24 18:06 downey-lv

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 !

dylandoamaral avatar Jun 03 '24 12:06 dylandoamaral

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 avatar Jun 04 '24 13:06 downey-lv

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

downey-lv avatar Jun 11 '24 07:06 downey-lv

@dylandoamaral any chance of a merge on this please?

Razor5284 avatar Feb 11 '25 18:02 Razor5284

I wait the PR to be merged with develop and then I will merge it with pleasure !

dylandoamaral avatar Feb 13 '25 21:02 dylandoamaral

@downey-lv any chance of the above? :)

Razor5284 avatar Mar 29 '25 17:03 Razor5284

Should be good to go now

downey-lv avatar Apr 01 '25 21:04 downey-lv

@dylandoamaral Can we merge please? :)

Razor5284 avatar Apr 03 '25 14:04 Razor5284

Will try it first then merge max next week if everything is ok.

dylandoamaral avatar Apr 03 '25 18:04 dylandoamaral

@dylandoamaral 🙏 🙏

Razor5284 avatar Apr 22 '25 22:04 Razor5284

I have a pending comment, waiting for the author response for 3 weeks. Tried on my PC but it is not working right now.

dylandoamaral avatar Apr 23 '25 05:04 dylandoamaral

@downey-lv have you seen pending comment?

Razor5284 avatar Apr 23 '25 16:04 Razor5284

It would be so great to use @downey-lv Improvements, @dylandoamaral

Fauteck avatar Jul 07 '25 11:07 Fauteck

Will try to take a look at what's not working soon, it's been a very busy time

downey-lv avatar Jul 07 '25 11:07 downey-lv

Fixed the issues, @dylandoamaral should be good to merge now. Tested with the following:

configuration.yaml

trakt_tv:
  language: fr
  timezone: Europe/Paris
  sensors:
    upcoming:
      movie:
        days_to_fetch: 90
        max_medias: 3
    lists:
      - friendly_name: "Favorites"
        private_list: True # Set to True if the list is your own private list
        list_id: "favorites" # Can be the slug, because it's a private list
        max_medias: 5
      - friendly_name: "2024 Academy Awards"
        list_id: 26885014
        max_medias: 5
        sort_by: rating_trakt # Sort by Trakt user rating instead of list rank
        sort_order: desc
      - friendly_name: "Star Trek Movies"
        list_id: 967660
        media_type: "movie" # Filters the list to only show movies
        max_medias: 5

ui-lovelace.yaml

views:
  - title: Test environment
    cards:
      - type: custom:upcoming-media-card
        entity: sensor.trakt_upcoming_movies
        enable_tooltips: true
        enable_trailers: true
        title: "Upcoming Movies"
      - type: custom:upcoming-media-card
        entity: sensor.trakt_list_star_trek_movies
        enable_tooltips: true
        enable_trailers: true
        title: "Star Trek Movies"
      - type: custom:upcoming-media-card
        entity: sensor.trakt_list_favorites
        enable_tooltips: true
        enable_trailers: true
        title: "Favorites"
image

downey-lv avatar Sep 11 '25 19:09 downey-lv

I will check this after my working day, thanks for the hard work !

dylandoamaral avatar Sep 12 '25 08:09 dylandoamaral

All set with the tweaks @dylandoamaral. Also tested on 2025.9, no issues.

On a sidenote we should bump the dev version, doesn't make much sense to develop for Python 3.10 compatibility when the support has been removed since 2023.8

downey-lv avatar Sep 13 '25 11:09 downey-lv

About python, indeed you are right

dylandoamaral avatar Sep 13 '25 12:09 dylandoamaral