NineWorlds / serenity-android

An Android client for the Plex and Emby Media Servers optimized for Television displays.
MIT License
178 stars 65 forks source link

Stuck when entering library sections #83

Closed tedfox closed 11 years ago

tedfox commented 11 years ago

I have an issue where I go into one of my library sections, and it hangs. Depending on what category it is on, it is either stuck on "retrieving shows" (categories like all and unwatched), or it crashes/stucks in a loop in other categories (categories like latest and new)

I've included the xml files as requested

`

`

`

`

` <Directory ratingKey="879" key="/library/metadata/879/children" studio="CBS" type="show" title="The Big Bang Theory" titleSort="Big Bang Theory" contentRating="TV-PG" summary="Leonard Hofstadter and Sheldon Cooper are brilliant physicists, the kind of "beautiful minds" that understand how the universe works. But none of that genius helps them interact with people, especially women. All this begins to change when a free-spirited beauty named Penny moves in next door. Sheldon, Leonard's roommate, is quite content spending his nights playing Klingon Boggle with their socially dysfunctional friends, fellow CalTech scientists Howard Wolowitz and Raj Koothrappali. However, Leonard sees in Penny a whole new universe of possibilities... including love." index="1" rating="9.1999998092651403" year="2007" thumb="/library/metadata/879/thumb/1362736539" art="/library/metadata/879/art/1362736539" banner="/library/metadata/879/banner/1362736539" theme="/library/metadata/879/theme/1362736539" duration="1200000" originallyAvailableAt="2007-09-01" leafCount="39" viewedLeafCount="2" addedAt="1359033954" updatedAt="1362736539">

<Directory ratingKey="976" key="/library/metadata/976/children" studio="FOX" type="show" title="Bones" contentRating="TV-14" summary="F.B.I. Agent Seeley Booth is teamed up with forensic anthropologist Dr. Temperance "Bones" Brennan to solve some of the most baffling and bizarre crimes ever. Booth depends on clues from the living, witnesses and suspects, while Brennan gathers evidence from the dead, relying on her uncanny ability to read clues left behind in the bones of the victims." index="1" rating="8.6000003814697301" year="2005" thumb="/library/metadata/976/thumb/1362915527" art="/library/metadata/976/art/1362915527" banner="/library/metadata/976/banner/1362915527" theme="/library/metadata/976/theme/1362915527" duration="3600000" originallyAvailableAt="2005-09-13" leafCount="129" viewedLeafCount="112" addedAt="1361685728" updatedAt="1362915527">

<Directory ratingKey="1" key="/library/metadata/1/children" studio="CBS" type="show" title="CSI: NY" contentRating="TV-14" summary="The third edition of the "CSI" franchise sets up shop in the Big Apple, where taciturn Detective Mac Taylor (Gary Sinise) and his partner, Detective Stella Bonasera (Melina Kanakaredes), lead a crime-solving team. Like his counterparts in Las Vegas and Miami, Taylor knows that people may lie, but the evidence rarely does." index="1" rating="8.3000001907348597" year="2004" thumb="/library/metadata/1/thumb/1359033826" art="/library/metadata/1/art/1359033826" banner="/library/metadata/1/banner/1359033826" theme="/library/metadata/1/theme/1359033826" duration="3600000" originallyAvailableAt="2004-09-01" leafCount="180" viewedLeafCount="180" addedAt="1359033755" updatedAt="1359033826">

`

kingargyle commented 11 years ago

Okay so which categories are you having problems with.

You can get a list of the keys that are used to navigate the various categories for the particular section and then can get the xml for those by going to the following:

http://192.168.0.108:32400/library/sections/6

Replace the number 6 and the ip address that correspond to your particular library section and server address respectively.

You'll then get something that looks like the following.

 <MediaContainer size="15" allowSync="0" art="/:/resources/show-fanart.jpg" content="secondary" identifier="com.plexapp.plugins.library" mediaTagPrefix="/system/bundle/media/flags/" mediaTagVersion="1365380984" nocache="1" sortAsc="1" thumb="/:/resources/show.png" title1="TV Shows" viewGroup="secondary" viewMode="65592">
    <Directory key="all" title="All Shows"/>
    <Directory key="unwatched" title="Unwatched"/>
    <Directory key="newest" title="Recently Aired"/>
    <Directory key="recentlyAdded" title="Recently Added"/>
    <Directory key="recentlyViewed" title="Recently Viewed Episodes"/>
    <Directory key="recentlyViewedShows" title="Recently Viewed Shows"/>
    <Directory key="onDeck" title="On Deck"/>
    <Directory secondary="1" key="collection" title="By Collection"/>
    <Directory secondary="1" key="firstCharacter" title="By First Letter"/>
    <Directory secondary="1" key="genre" title="By Genre"/>
    <Directory secondary="1" key="year" title="By Year"/>
    <Directory secondary="1" key="contentRating" title="By Content Rating"/>
    <Directory key="folder" title="By Folder"/>
    <Directory prompt="Search for Shows" search="1" key="search?type=2" title="Search Shows..."/>
    <Directory prompt="Search for Episodes" search="1" key="search?type=4" title="Search Episodes..."/>
 </MediaContainer>   

You can then get the XML say for the unwatched category by navigating to the following:

http://192.168.0.108:32400/library/sections/6/unwatched

The same can be done for each of the XML.

I suspect that we are running into a situation where something isn't being returned with an empty MediaContainer, and the Progress Dialog isn't getting dismissed correctly. So if we can get snapshots of the problem categories on the library that is giving problems, I can try to work a fix into 1.2.2 or 1.2.3.

tedfox commented 11 years ago

I'll just tackle one symptom by one symptom. I hope it helps.

The following few XMLs result in the app being stuck in "retrieving shows"

<MediaContainer size="0" allowSync="1" art="/:/resources/show-fanart.jpg" identifier="com.plexapp.plugins.library" librarySectionID="5" librarySectionUUID="8997e50e-2e83-4cd1-a154-78c9d9ff34c7" mediaTagPrefix="/system/bundle/media/flags/" mediaTagVersion="1365428404" nocache="1" thumb="/:/resources/show.png" title1="TV Shows2" title2="Unwatched" viewGroup="show" viewMode="65592"></MediaContainer>

`

`

` <Directory ratingKey="879" key="/library/metadata/879/children" studio="CBS" type="show" title="The Big Bang Theory" titleSort="Big Bang Theory" contentRating="TV-PG" summary="Leonard Hofstadter and Sheldon Cooper are brilliant physicists, the kind of "beautiful minds" that understand how the universe works. But none of that genius helps them interact with people, especially women. All this begins to change when a free-spirited beauty named Penny moves in next door. Sheldon, Leonard's roommate, is quite content spending his nights playing Klingon Boggle with their socially dysfunctional friends, fellow CalTech scientists Howard Wolowitz and Raj Koothrappali. However, Leonard sees in Penny a whole new universe of possibilities... including love." index="1" rating="9.1999998092651403" year="2007" thumb="/library/metadata/879/thumb/1362736539" art="/library/metadata/879/art/1362736539" banner="/library/metadata/879/banner/1362736539" theme="/library/metadata/879/theme/1362736539" duration="1200000" originallyAvailableAt="2007-09-01" leafCount="39" viewedLeafCount="2" addedAt="1359033954" updatedAt="1362736539">... <Directory ratingKey="976" key="/library/metadata/976/children" studio="FOX" type="show" title="Bones" contentRating="TV-14" summary="F.B.I. Agent Seeley Booth is teamed up with forensic anthropologist Dr. Temperance "Bones" Brennan to solve some of the most baffling and bizarre crimes ever. Booth depends on clues from the living, witnesses and suspects, while Brennan gathers evidence from the dead, relying on her uncanny ability to read clues left behind in the bones of the victims." index="1" rating="8.6000003814697301" year="2005" thumb="/library/metadata/976/thumb/1362915527" art="/library/metadata/976/art/1362915527" banner="/library/metadata/976/banner/1362915527" theme="/library/metadata/976/theme/1362915527" duration="3600000" originallyAvailableAt="2005-09-13" leafCount="129" viewedLeafCount="114" addedAt="1361685728" updatedAt="1362915527">...

... ...

<Directory ratingKey="1" key="/library/metadata/1/children" studio="CBS" type="show" title="CSI: NY" contentRating="TV-14" summary="The third edition of the "CSI" franchise sets up shop in the Big Apple, where taciturn Detective Mac Taylor (Gary Sinise) and his partner, Detective Stella Bonasera (Melina Kanakaredes), lead a crime-solving team. Like his counterparts in Las Vegas and Miami, Taylor knows that people may lie, but the evidence rarely does." index="1" rating="8.3000001907348597" year="2004" thumb="/library/metadata/1/thumb/1359033826" art="/library/metadata/1/art/1359033826" banner="/library/metadata/1/banner/1359033826" theme="/library/metadata/1/theme/1359033826" duration="3600000" originallyAvailableAt="2004-09-01" leafCount="180" viewedLeafCount="180" addedAt="1359033755" updatedAt="1359033826">...

... ...

`

does this help?

kingargyle commented 11 years ago

Well the first one is returning an empty media container with no Directory entries, so that very possibly could be part of the problem. I have some ideas on how to rework this so that this progress dialog at least disappears. Let me work on this later this evening (day job stuff has priority over fun stuff). I should be able to replicate this issue.

tedfox commented 11 years ago

Hi, It's me again. I appreciate the effort in programming the app. No rush in fixing it. Do it at your own time!~

I was playing around a bit, so I was able to better define the issue I was having

I have various nexus devices. A nexus 4, another pretty low end android phone, a nexus 7, and a TV stick (MK 809) running android 4.1.1. The program runs fine on all my devices except for my TV stick, which I find weird.

I have no problems listing shows using any setting EXCEPT for "All shows" and "unwatched" For example, if I used "newest", it will list my newest show. From there, I can click back, and subsequently select which categories I want. INCLUDING "all shows" and "unwatched"

However, if the preferred starting category was "all shows" or "unwatched". The app would be stuck at retrieving shows, and would not respond to any input.

And again, this happens only on my TV stick. So I'm not particularly sure why.

Here's my XML for "all shows" `

`

and here's my XML for "on deck" `

`

kingargyle commented 11 years ago

If it is only happening on the All Shows and Unwatched. It could that the TV stick is just taking a while to process those shows. I haven't done any testing with it on the MK809, but find it odd that it gets stuck. only on those two sections.

This only happens with the TV shows? The movies section is fine?

kingargyle commented 11 years ago

One thing that might help is to run aLogCat on the TV stick when you encounter the problem. You might need to be running as root though in order to see the logs for the app. The filter to use for aLog cat is, us.nineworlds.serenity. There might be some information in the logs that can help use determine what is happening.

Retargeting for 1.3.0 since this only happens on a MK809.

kingargyle commented 11 years ago

Since I don't have one of these devices to test, and can't repeat it any other way, closing this issue.

junkcollector commented 10 years ago

I know this topic is closed, but in case it's of any help in the posted xml, the "Big Bang Theory" summary had the prhase "beautiful minds" in double quotes which may have broken the xml. You could only tell with the original xml - the quotes might have been escaped.