nixgates / plugin.video.seren

Repository for Seren Development
309 stars 95 forks source link

[BUG] new tv shows error #549

Closed kodi-lover closed 3 years ago

kodi-lover commented 3 years ago

Logs

https://paste.ubuntu.com/p/t62MpWMrdt/

Describe the bug New tv shows menu comes up with error.

To Reproduce Steps to reproduce the behavior:

  1. Go to discover tv shows
  2. Click on new tv shows
  3. See error

Expected behavior Other menus in discover tv shows work fine except this particular menu.

Screenshots If applicable, add screenshots to help explain your problem.

Kodi Version (please complete the following information):

Additional context Add any other context about the problem here.

Nuklear92 commented 3 years ago

+1 to this issue, it's also plaguing TV Shows Watchlist and many of the Trakt Liked Lists under the My TV Shows section.

cg00001 commented 3 years ago

Latest Matrix version of Seren suddenly made my TV Shows Library, and widgets stop working after updating today.

RichardPIS commented 3 years ago

Same here on 2 devices, Android and Linux, can't search for movies nor tv-shows.

cg00001 commented 3 years ago

@nixgates this might be a TMDB or Trakt issue?

xxlren commented 3 years ago

I have this problem from a fresh install of kodi. I installed seren, and can't search TV shows. Can't search by actor. Also my lists which include TV shows only show an error with Seren

BinaryAssault commented 3 years ago

Same thing on Leia

peno64 commented 3 years ago

I have a "fix" (most probably not a definite one but it makes possible to continue searching tv shows). Note that it is only for searching tv shows on name of tv show. Not by actor, year or whatever. I haven't looked at that since I never use it. In Addons\plugin.video.seren\resources\lib\indexers\tvdb.py change the following:

def _handle_response(self, language, item):
    result = {}
    item = self._try_detect_type(item)
    if "mediatype" not in item:
        return item

to

def _handle_response(self, language, item):
    result = {}
    item = self._try_detect_type(item)
    if item is None or "mediatype" not in item:
        return item

and

def _try_detect_type(item):
    if "airedSeasons" in item or "seriesName" in item:
        item.update({"mediatype": "tvshow"})
    elif "episodeName" in item:
        item.update({"mediatype": "episode"})
    return item

to

def _try_detect_type(item):
    if item is None:
        return item
    if "airedSeasons" in item or "seriesName" in item:
        item.update({"mediatype": "tvshow"})
    elif "episodeName" in item:
        item.update({"mediatype": "episode"})
    return item

After this, restart your kodi (important) and then search works again for me.

sabatale commented 3 years ago

@peno64 's workaround works for me!

peno64 commented 3 years ago

If needed , I can make a zip file available so that seren can be updated temporary with this patch until the addon is updated.

penguinspl commented 3 years ago

If needed , I can make a zip file available so that seren can be updated temporary with this patch until the addon is updated.

That zip file will be great because editing this files on amazon fire stick is a pain..

peno64 commented 3 years ago

See https://peno64.github.io/ to install the temporary fix. Please read the note in bold. For some reason you need to have a bit of patience to install this.

peno64 commented 3 years ago

Oh and I also included the fix for #552

BinaryAssault commented 3 years ago

The fix by @peno64 didn't work for me on windows 10. Actually made it worse, I was not able to play any videos on top of viewing list issue with the modification. I didn't use your temp versions I directly modified the file myself. At least I was able to revert fairly easy. Can't view lists but I can at least search and watch

peno64 commented 3 years ago

That is a pitty for you See message #550 A user there says that it even fixes more than what I thaught it would fix. Maybe you did something wrong...

BinaryAssault commented 3 years ago

That is a pitty for you See message #550 A user there says that it even fixes more than what I thaught it would fix. Maybe you did something wrong...

I'm not discrediting your fix as it works for others. Just adding another data point that there may be another issue somewhere else.

peno64 commented 3 years ago

@BinaryAssault Well as I said previously, my change is not really a fix but more a temporary work-around until the Seren developers themselves can look at it. Most probably there are also other issues. I know for example that search on author also doesn't work. My guess is that it has to do with changes in tvdb.

hluaces commented 3 years ago

I've been trying to figure out the problem and I got to a point where I'm fairly certain of what's going on, at least on my use case.

I got to this error whenever I tried to:

By tracing what Seren does I got to the point where I found that there's a method that can return None in some edge cases and I think that might not be intentional.

This happens on the resources/lib/indexers/tvdb.py file:

https://github.com/nixgates/plugin.video.seren/blob/38db0e0d5bfac4a697de55bcfc40cb0bb2cc81f3/resources/lib/indexers/tvdb.py#L929-L935

Whenever the method receives a response object such as this:

{
  "data": []
}

The result is that the method returns None because the check if not response: returns True on Python3. If this were to be fixed so that it returns the empty array (return []) the problem would be fixed, at least on my installation.

But wait: there's more.

I've been searching why this empty returnset got to the _flatten method and got to something very interesting, the API call to tvdb for series/253463/actors is returning that the show has no actors. If you are curious, the show with ID 253463 is Black Mirror. You can check by yourself that the shows has no actors by checking the Black Mirror's homepage on thetvdb.com.

So, just for science, I did the following to confirm whether that was the issue for me or not:

To my surprise everything began to work properly, so It's kind of confirmed that:

Depending on what happens on the next days and what @nixgates has to say about this I might open a PR or even upload the hotfix somewhere so that people can use it without editing their Python files on their sticks or android tvs until our savior has time to look at this.

TL;DR: a method might be returning None whenever it receives an empty array and this should be looked at. If you have Black Mirror on your Trak's collection, delete it, clear Seren's cache and Trakt's metadata and restart Kodi.

hluaces commented 3 years ago

There are more shows that are returning no actors and triggering the issue, I'll add them here as soon as I discover them.

peno64 commented 3 years ago

@hluaces Great job. Looks fine by me

drinfernoo commented 3 years ago

This should be solved in 2.0.17.