Plex XML API Inconsistent

I’ve noticed a strangeness with the Plex XML API. I drill into a metadata node for an item and fetch it’s XML, for example: http://localhost:32400/library/metadata/4695



The Video element has an attribute viewCount=1 and has no lastViewedAt attribute. When I reload the same page, the lastViewedAt attribute appears in the xml.



I’ve seen this happen with the guid attribute also. I happen the have the entire xml for the guid example:



first time I load the xml:



[xml]<?xml version="1.0" encoding="UTF-8"?>





















[/xml]



Second time:



[xml]<?xml version="1.0" encoding="UTF-8"?>





















[/xml]



All I did was reload the page. The first version doesn’t have a guid attribute while the second one does.

My code now does something like this:


<br />
xml = getXml();<br />
lastViewedTime = getLastViewedTimeFromXml(xml);<br />
if (lastViewedTime == "") {<br />
  xml = getXml();<br />
  lastViewedTime = getLastViewedTimeFromXml(xml);<br />
}<br />




Which works but seems like a silly thing to have to do.

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