Skip to content

Commit

Permalink
Updated README.md and refactored trakt_kind logic as requested
Browse files Browse the repository at this point in the history
  • Loading branch information
mkanet committed Aug 26, 2024
1 parent e735d98 commit 611f139
Show file tree
Hide file tree
Showing 2 changed files with 38 additions and 1 deletion.
37 changes: 37 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -175,6 +175,43 @@ There are three parameters for each sensor:
- `exclude` should be a list of shows you'd like to exclude, since it's based on your watched history. To find keys to put there, go on trakt.tv, search for a show, click on it, notice the url slug, copy/paste it. So, if I want to hide "Friends", I'll do the steps mentioned above, then land on https://trakt.tv/shows/friends, I'll just have to copy/paste the last part, `friends`, that's it
You can also use the Trakt.tv "hidden" function to hide a show from [your calendar](https://trakt.tv/calendars/my/shows) or the [progress page](https://trakt.tv/users/<username>/progress)

##### Anticipated Sensors

- `sensor.trakt_anticipated_shows`: This sensor displays the most anticipated TV shows on Trakt.
- `sensor.trakt_anticipated_movies`: This sensor displays the most anticipated movies on Trakt.

### Example Configuration

To enable these sensors, you can use the following configuration:

```yaml
trakt_tv:
language: en
timezone: America/Los_Angeles
sensors:
anticipated:
movie:
max_medias: 10
show:
max_medias: 10
```

You can also exclude collected items from these sensors:

```yaml
trakt_tv:
language: en
timezone: America/Los_Angeles
sensors:
anticipated:
movie:
exclude_collected: true
max_medias: 10
show:
exclude_collected: true
max_medias: 10
```

##### Stats sensors

Creates individual sensors giving all of your stats about the movies, shows, and episodes you have watched, collected, and rated.
Expand Down
2 changes: 1 addition & 1 deletion custom_components/trakt_tv/apis/trakt.py
Original file line number Diff line number Diff line change
Expand Up @@ -441,7 +441,7 @@ async def fetch_anticipated_medias(self, configured_kinds: list[TraktKind]):
for trakt_kind, raw_medias in zip(kinds, data):
if raw_medias is not None:
medias = [
trakt_kind.value.model.from_trakt(media["movie" if trakt_kind == TraktKind.ANTICIPATED_MOVIE else "show"]) for media in raw_medias
trakt_kind.value.model.from_trakt(media[trakt_kind.identifier]) for media in raw_medias
]
await gather(
*[media.get_more_information(language) for media in medias]
Expand Down

0 comments on commit 611f139

Please sign in to comment.