Duplicate summary and thumb from TVShowObject

Hi all,

 

I have a peculiar problem. I'm writing a channel for animetv.org, and in doing so I'm working on the menu hierarchy. I have a top node of an alphabetical list (DirectoryObjects) and below that I have a list of shows. My first try was to use the DirectoryObject here as well and that works just fine, but I wanted some extra fields that the TVShowObject gives, so I changed to that. The only problem is that the thumb and the title/summary always appear twice when using the TVShowObject, whereas when using DirectoryObject everything works as expected. Am I doing something wrong or what?

 

Example with TVShowObject

 

![post-59100-0-04291600-1367517242.jpg|690x277](upload://jFE5XTtpW0aGGIIJghFwGfGfD7O.jpg)

 

Code is

 

@handler('/video/AnimeTV', 'AnimeTV')
def TopList():
  oc = ObjectContainer()
  document = HTML.ElementFromURL("http://animetv.org/anime-list/all", cacheTime=3600)
  links = document.xpath("//div[@class='letter']/ul/li/a")
  for link in links:
    oc.add(DirectoryObject(
        key=Callback(ShowMenu, url=link.get("href")),
        title=link.text,
        art="http://i.imgur.com/uCUQI.jpg"
        )
    )
  return oc

def ShowMenu(url):
oc = ObjectContainer()
document = HTML.ElementFromURL(url, cacheTime=3600)
links = document.xpath("//div[@class = ‘vvdo’]")
for link in links:
anchor = link.xpath(“div[@class = ‘vvdo-details’]/h3/a”)[0]
oc.add(ShowMeta(anchor.get(“href”), anchor.text))
return oc

def ShowMeta(url, title):
document = HTML.ElementFromURL(url, cacheTime=3600)
image = document.xpath("//img[@class = ‘anime-pic’]")[0]
episodes = document.xpath("//table[@class = ‘anime-eps’]//a")
Log(title)
return TVShowObject(
key=Callback(EpisodeMenu, url=url),
rating_key=url,
title=title,
summary=image.getnext().text,
thumb=image.get(“src”),
episode_count=len(episodes),
viewed_episode_count=0
)

def EpisodeMenu(url):
oc = ObjectContainer()
document = HTML.ElementFromURL(url, cacheTime=3600)
image = document.xpath("//div[@id = ‘primary-content’]/div/img")[0].get(“src”)
links = document.xpath("//table[@class = ‘anime-eps’]//a")
for link in reversed(links):
episode = HTML.ElementFromURL(link.get(“href”), cacheTime=3600)
playerUrl = episode.xpath("//iframe")[0].get(“src”)
videoNum = playerUrl[playerUrl.find("/watch/")+7:].strip("/")
oc.add(EpisodeObject(
url=link.get(“href”),
title=link.text,
thumb=image,
art=“http://i.imgur.com/uCUQI.jpg
)
)
return oc

 

Your code looks fine to me. It appears that you may have found a bug in the MediaStream skin. What's the version number of the desktop client you're testing with? I suspect that other clients should render that just fine.

Your code looks fine to me. It appears that you may have found a bug in the MediaStream skin. What's the version number of the desktop client you're testing with? I suspect that other clients should render that just fine.

Silly me, I didn't even think about checking the Plex Media Center version. I just used what was installed on my dev machine but apparently I haven't updated it for a while, still 0.9.5.2. After updating to latest 0.9.5.4 it works ok. Thanks for the pointer!

Yay!

Seems I have encountered the same issue as Tuffo. I, however am testing on OS X Desktop Client verison 0.9.5.4. I've tested on PHT 0.9.9.7.146 to the same effect as well.

![post-115819-0-85391400-1371285011.png|654x386](upload://eV9Zm7q82kVQRjOUOB8MdF2gT5c.png)

@route('/music/gpodder/toplist/{page}')
def Toplist(page=0):
    toplist = session.public_client.get_toplist()

    oc = ObjectContainer(title1=NAME, title2='Most Popular')
    for index, entry in enumerate(toplist):
        oc.add(TVShowObject(
            key=Callback(Podcast, entry=entry),
            rating_key=entry.url,
            summary=entry.description,
            thumb=Resource.ContentsOfURLWithFallback(url=entry.logo_url, fallback=ICON),
            title=entry.title,
        ))
    return oc

What PMS version are you running?  I think I've seen that with older PMS/newer client combinations before as well.

Was 0.9.7.22 (OS X). An update to 0.9.7.28 just now didn't seem to make a difference either.

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.