pymedusa / Medusa

Automatic Video Library Manager for TV Shows. It watches for new episodes of your favorite shows, and when they are posted it does its magic.
https://pymedusa.com
GNU General Public License v3.0
1.8k stars 276 forks source link

TRAKTCHECKER TypeError: string indices must be integers #11174

Open doopsuiker opened 1 year ago

doopsuiker commented 1 year ago

Describe the bug Syncing shows with Trakt that don't have any episodes yet, throws following error: TypeError: string indices must be integers

To Reproduce Steps to reproduce the behavior: Add a show that will air in the future. Let Medusa run Trakt Sync See how Trakt Checker fails

Expected behavior Track Checker should skip this show

Medusa (please complete the following information):

Debug logs (at least 50 lines): 2023-03-14 12:08:02 ERROR TRAKTCHECKER :: [671a443] Ahsoka

Traceback (most recent call last):

File "C:\Medusa\Medusa\medusa\schedulers\trakt_checker.py", line 608, in sync_trakt_episodes

indexer_id = trakt_show['ids'].get(trakt_indexer)

TypeError: string indices must be integers

Additional context

I added a Try/Expect in following code for trakt_checker.py (line 595 for me) to see which show causes the problem.

        for i in indexerConfig:
            trakt_indexer = get_trakt_indexer(i)
            if not trakt_indexer:
                continue
            try:
                indexer_id = trakt_show['ids'].get(trakt_indexer)
            except TypeError:
                log.error(trakt_show)
                continue
            indexer = indexerConfig[i]['id']
            show = Show.find_by_id(app.showList, indexer, indexer_id)
            if show:
                break
the-jeffski commented 1 year ago

I've seen the same thing today and it caused it to delete the show: 2023-06-10 10:54:28 ERROR TRAKTCHECKER :: [e98773f] Exception generated: string indices must be integers Traceback (most recent call last): File "/app/medusa/medusa/schedulers/scheduler.py", line 78, in run self.action.run(self.force) File "/app/medusa/medusa/schedulers/trakt_checker.py", line 92, in run self.sync_watchlist() File "/app/medusa/medusa/schedulers/trakt_checker.py", line 325, in sync_watchlist self.sync_trakt_episodes() File "/app/medusa/medusa/schedulers/trakt_checker.py", line 595, in sync_trakt_episodes indexer_id = trakt_show['ids'].get(trakt_indexer) TypeError: string indices must be integers 2023-06-10 10:54:32 INFO SHOWQUEUE-REMOVE-SHOW :: [e98773f] 76331: delete show folder /share/TV_Shows/Succession 2023-06-10 10:54:32 DEBUG SHOWQUEUE-REMOVE-SHOW :: [e98773f] 76331: Removing show Succession from Trakt watchlist