PlexKodiConnect
PlexKodiConnect copied to clipboard
Unable to see TV Show episodes
Hi - since the 5.x versions I've been unable to see any TV show episodes in the TV Shows list. Currently using RC4 with 2.5.9. Log attached.
Thanks kodi.log
Added by Croneter:
For Workaround see below!
Did you try a database reset in the PKC settings under Advanced?
If so, please try resetting again while debug logging I enabled. Then share your log file again as well as the database file "myvideos" from the Database
subdirectory of your Kodi user data folder
Also, I take it you use the "official" Kodi RC4 version from Kodi.tv, not a nightly version or something compiled elsewhere?
Also, did you try a restart of Kodi after the sync was done?
And lastly - Screenshot please :wink:
Thanks for your help as always Croneter...great stuff...
Using the official RC4 from kodi.tv. Have reset/restarted many times. Happens on all six of my devices (Windows 10, Nvidia Shield, Fire TV).
Log after database reset: kodi.log
Show list:
Episode list: should list 10 episodes:
Log including switching to shows and episodes: kodi.log
Then I need the database file
Sorry about that. It wouldn't let me update a .db file so I zipped it along with supporting myvideos files: Database.zip
Thanks
Could you also please share the Plex database plex.db
?
DELETED by Croneter
Really weird!
Could you please also share the XML info from an arbitrary episode? Using Plex Web, navigate to the info page of an episode. Then hit the three dots ... at the top right, then Information, then Show XML.
<MediaContainer size="1" allowSync="1" identifier="com.plexapp.plugins.library" librarySectionID="2" librarySectionTitle="TV Shows" librarySectionUUID="6bb27055-d7ca-4f9b-ba66-0ca051c016dc" mediaTagPrefix="/system/bundle/media/flags/" mediaTagVersion="1544804462"><Video ratingKey="3880" key="/library/metadata/3880" skipParent="1" grandparentRatingKey="3875" guid="com.plexapp.agents.thetvdb://281614/4/4?lang=en" librarySectionTitle="TV Shows" librarySectionID="2" librarySectionKey="/library/sections/2" type="episode" title="Just the Fat, Ma'am" grandparentKey="/library/metadata/3875" grandparentTitle="Angie Tribeca" parentTitle="Season 4" contentRating="TV-14" summary="Tribeca is sent undercover to investigate a string of dead models from "Popular Magazine." The only catch, the fingerprints on all of the bodies belong to dead Peruvian men. The remainder of the team heads to Peru to investigate." index="4" parentIndex="4" viewOffset="1109710" viewCount="2" lastViewedAt="1546305702" year="2018" thumb="/library/metadata/3880/thumb/1546229435" art="/library/metadata/3875/art/1546229435" grandparentThumb="/library/metadata/3875/thumb/1546229435" grandparentArt="/library/metadata/3875/art/1546229435" grandparentTheme="/library/metadata/3875/theme/1546229435" duration="1262495" originallyAvailableAt="2018-12-29" addedAt="1546142127" updatedAt="1546229435"><Media videoResolution="1080" id="5656" duration="1262495" bitrate="4690" width="1920" height="1080" aspectRatio="1.78" audioChannels="2" audioCodec="aac" videoCodec="h264" container="mkv" videoFrameRate="24p" audioProfile="lc" videoProfile="high"><Part accessible="1" exists="1" id="5668" key="/library/parts/5668/1546138051/file.mkv" duration="1262495" file="Z:\Downloads\TV\Angie Tribeca\Angie Tribeca-S04E04.mkv" size="740205051" audioProfile="lc" container="mkv" deepAnalysisVersion="2" indexes="sd" requiredBandwidths="7265,5614,5131,5131,5131,5131,5131,5131" videoProfile="high"><Stream id="14361" streamType="1" default="1" codec="h264" index="0" bitrate="4690" language="English" languageCode="eng" bitDepth="8" chromaLocation="left" chromaSubsampling="4:2:0" colorRange="tv" colorSpace="bt709" frameRate="23.976" hasScalingMatrix="0" height="1080" level="41" profile="high" refFrames="4" requiredBandwidths="7139,5488,5024,5024,5024,5024,5024,5024" scanType="progressive" width="1920" displayTitle="1080p (H.264)"/><Stream id="14362" streamType="2" selected="1" default="1" codec="aac" index="1" channels="2" bitrate="126" language="English" languageCode="eng" audioChannelLayout="stereo" profile="lc" requiredBandwidths="126,126,126,126,126,126,126,126" samplingRate="44100" displayTitle="English (AAC Stereo)"/><Stream id="14363" streamType="3" codec="srt" index="2" bitrate="0" language="English" languageCode="eng" requiredBandwidths="1,1,1,1,1,1,1,1" displayTitle="English (SRT)"/></Part></Media><Extras size="0"> </Extras></Video></MediaContainer>
That was the wrong Plex DB: it's a similar file like the myvideoXXX.db in the Kodi userdata folder.
Please share the entire XML - that seems to be only an excerpt
Ah ok.
plex.zip
This is all that comes up when I click View XML on an episode:
Copy paste everything, not just the "Video" piece 😉
<MediaContainer size="1" allowSync="1" identifier="com.plexapp.plugins.library" librarySectionID="2" librarySectionTitle="TV Shows" librarySectionUUID="6bb27055-d7ca-4f9b-ba66-0ca051c016dc" mediaTagPrefix="/system/bundle/media/flags/" mediaTagVersion="1544804462"><Video ratingKey="3880" key="/library/metadata/3880" skipParent="1" grandparentRatingKey="3875" guid="com.plexapp.agents.thetvdb://281614/4/4?lang=en" librarySectionTitle="TV Shows" librarySectionID="2" librarySectionKey="/library/sections/2" type="episode" title="Just the Fat, Ma'am" grandparentKey="/library/metadata/3875" grandparentTitle="Angie Tribeca" parentTitle="Season 4" contentRating="TV-14" summary="Tribeca is sent undercover to investigate a string of dead models from "Popular Magazine." The only catch, the fingerprints on all of the bodies belong to dead Peruvian men. The remainder of the team heads to Peru to investigate." index="4" parentIndex="4" viewOffset="1109710" viewCount="2" lastViewedAt="1546305702" year="2018" thumb="/library/metadata/3880/thumb/1546229435" art="/library/metadata/3875/art/1546229435" grandparentThumb="/library/metadata/3875/thumb/1546229435" grandparentArt="/library/metadata/3875/art/1546229435" grandparentTheme="/library/metadata/3875/theme/1546229435" duration="1262495" originallyAvailableAt="2018-12-29" addedAt="1546142127" updatedAt="1546229435"><Media videoResolution="1080" id="5656" duration="1262495" bitrate="4690" width="1920" height="1080" aspectRatio="1.78" audioChannels="2" audioCodec="aac" videoCodec="h264" container="mkv" videoFrameRate="24p" audioProfile="lc" videoProfile="high"><Part accessible="1" exists="1" id="5668" key="/library/parts/5668/1546138051/file.mkv" duration="1262495" file="Z:\Downloads\TV\Angie Tribeca\Angie Tribeca-S04E04.mkv" size="740205051" audioProfile="lc" container="mkv" deepAnalysisVersion="2" indexes="sd" requiredBandwidths="7265,5614,5131,5131,5131,5131,5131,5131" videoProfile="high"><Stream id="14361" streamType="1" default="1" codec="h264" index="0" bitrate="4690" language="English" languageCode="eng" bitDepth="8" chromaLocation="left" chromaSubsampling="4:2:0" colorRange="tv" colorSpace="bt709" frameRate="23.976" hasScalingMatrix="0" height="1080" level="41" profile="high" refFrames="4" requiredBandwidths="7139,5488,5024,5024,5024,5024,5024,5024" scanType="progressive" width="1920" displayTitle="1080p (H.264)"/><Stream id="14362" streamType="2" selected="1" default="1" codec="aac" index="1" channels="2" bitrate="126" language="English" languageCode="eng" audioChannelLayout="stereo" profile="lc" requiredBandwidths="126,126,126,126,126,126,126,126" samplingRate="44100" displayTitle="English (AAC Stereo)"/><Stream id="14363" streamType="3" codec="srt" index="2" bitrate="0" language="English" languageCode="eng" requiredBandwidths="1,1,1,1,1,1,1,1" displayTitle="English (SRT)"/></Part></Media><Extras size="0"> </Extras></Video></MediaContainer>
Weird, the paste cuts it off
Safe the text as a file, then upload the file
paha, freaking Plex for some reason does not include the season info in the XML! More here: https://forums.plex.tv/t/parentratingkey-not-in-episode-xml-when-seasons-are-hidden/300553
On it...
U da man :-)
OK, I can't really fix this on the PlexKodiConnect side. Until Plex fixes this issue, you need to do the following
Workaround until Plex fixes this issue
Using Plex Web, edit your TV Shows library to Show
Seasons
If not all but only some TV shows are missing episodes
Using Plex Web, navigate to the TV show missing its episodes. Hit the edit button at the top right of the screen
In the Advanced
tab, make sure that for Seasons
either Library default
is selected or Show
and NOT Hide
. Be sure to hit Safe Changes.
Having changed the Plex settings, you need to reset the Kodi database
In Kodi, navigate to the PKC settings, Advanced
. Choose Reset the Kodi database
and hit Yes, then No
Done and fixed after db rebuild. Thank You Croneter!!!
Thank you for this croneter. I hope the issue gets fixed soon so user intervention isn't needed.
Hi, I'm new to the codebase and having experienced this myself, I thought I'd have a poke around, so please forgive my silly questions :-) I see that if Plex seasons are hidden (for an individual show or for the library) then the parentRatingKey
attribute will be missing in the Plex XML response, which means that the episode_data
function will return a float:nan for the second key (TV season ID), not None
as the parent_id
function says, although that may be beside the point. Anyway, I wonder if hacking parent_id
to return the grantparentRatingKey
attribute when it's an episode with a hidden season will work, or just push the bug somewhere else...?
e.g. something like
diff --git a/resources/lib/plex_api.py b/resources/lib/plex_api.py
index f3e86c76..b8147751 100644
--- a/resources/lib/plex_api.py
+++ b/resources/lib/plex_api.py
@@ -636,6 +636,10 @@ class API(object):
"""
Returns the 'parentRatingKey' as a string or None
"""
+ # If Plex is hiding seasons for this show, return show key instead.
+ if self.plex_type() == v.PLEX_TYPE_EPISODE and 'parentRatingKey' not in self.items:
+ return self.grandparent_id()
+
return cast(int, self.item.get('parentRatingKey'))
def grandparent_id(self):
I don't know - did you test it successfully? Pull request are always welcome :wink:
Hehee... what's the worst that could happen, right? I'll see if I can have a go by hacking it "in production" and seeing what happens. Worst case is I have to rebuild my Kodi instance from scratch, which doesn't actually take that long. (or back up the ~/.kodi directory I guess)