dylandoamaral / trakt-integration

A Trakt integration for Home Assistant compatible with upcoming media card
MIT License
30 stars 12 forks source link

Next To Watch sensor shows all history including the finished shows #50

Closed l30ns closed 1 year ago

l30ns commented 1 year ago

Hi, You are doing a great work with this. Here's a thing - sensor.trakt_next_to_watch_shows, as it is now, makes no sense as it includes all shows that I have ever seen and it shows them in no particular order.

You are fetching the list from "https://trakt.tv/users//progress" while you should get it from here https://trakt.tv/users//progress/watched/activity?hide_completed=true

Anrolosia commented 1 year ago

Hey @l30ns , I'll let @dylandoamaral complete or correct my answer but we're not "fetching" lists from trakt.tv website, we're using Trakt API The shows retrieved by next_to_watch sensor are the ones you've watched in the past, but still with unseen episodes. If you already saw all episodes, the show shouldn't be there. If however you have some shows you don't want to track anymore, you can use the exclude setting as explained in the doc. Finaly, there is an order: It's from the oldest to the newest, based on the next to watch episode airdate. The issue is, with the upcoming media card, there is no mention about the year, I strongly encourage you to modify this piece of code https://github.com/custom-cards/upcoming-media-card/blob/master/upcoming-media-card.js#L291-L311 to include the year (This is what I've done on my side), and you'll see it's ordered. Thanks

dylandoamaral commented 1 year ago

I can't give a better answer !

l30ns commented 1 year ago

Hey @Anrolosia, thanks for the answer. I'll admit that my note "shows them in no particular order" was a bit stretched and emotional. Sorry!

I don't know which Trakt API call are you using (dividing in your / any code of such complexity is a bit much for me), but what I am saying, the current version returns uncomfortably way too many shows from my list. It includes shows that show up with 100% watched mark and it ignores HIDDEN feature. Basically, as I am active Trakt user, I need to list all the shows in ignore list to get to what I am looking for thus rendering this feature not useful. Trakt API "Shows/Watched Progress/Get show watched progress" has such feature (...watched?hidden=false&specials=false), but I understand that this is for 1 show only. https://trakt.docs.apiary.io/#reference/shows/watched-progress/get-show-watched-progress?console=1

I hope this explains my point better.

Anrolosia commented 1 year ago

Hey @l30ns , thanks for this feedback! I checked and it seems there is an issue with Trakt.tv API, because if I understand correctly their documentation: By default, any hidden seasons will be removed from the response and stats. To include these and adjust the completion stats, set the hidden flag to true. Like you can see here: https://github.com/dylandoamaral/trakt-integration/blob/main/custom_components/trakt_tv/apis/trakt.py#L108 we're not specifying any value for that field, that means hidden seasons shouldn't be retrieved. I added a workaround and I'll let @dylandoamaral take a look at the PR (https://github.com/dylandoamaral/trakt-integration/pull/52) and decide if he wants to merge it or not

Anrolosia commented 1 year ago

Hello @l30ns , could you confirm version 0.6.1 fixes your issue? Thanks

dylandoamaral commented 1 year ago

Feel free to reopen if the bug is still here