FIX: [JSON] streamdetails are never retrieved #1233

Merged
merged 1 commit into from Aug 2, 2012

2 participants

@koying
Team Kodi member

No description provided.

@Montellese Montellese commented on the diff Aug 1, 2012
xbmc/interfaces/json-rpc/VideoLibrary.cpp
}
- if (additionalInfo)
+ if (additionalInfo || streamdetails)
@Montellese
Team Kodi member

I don't like this. It means that whenever someone just wants to retrieve the streamdetails we will also query the database for the cast, sets and other information that require extra queries. Either make an extra if-condition-block for the streamdetails or add an "if (additionalInfo)" in front of the videodatabase.GetFooInfo() call (not only here but also for episodes and musicvideos).

@koying
Team Kodi member
koying added a note Aug 1, 2012

You're right on the principle, but isn't GetMovieInfo creating the VideoInfoTag needed by GetStreamDetails?

@Montellese
Team Kodi member

Sorry didn't get any email notification on your response. No the CVideoInfoTag object already exists in the CFileItemPtr from the list and both GetMovieInfo and GetStreamDetails just alter its details if necessary.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
@Montellese Montellese and 1 other commented on an outdated diff Aug 1, 2012
xbmc/video/VideoInfoTag.h
@@ -133,6 +133,7 @@ class CVideoInfoTag : public IArchivable, public ISerializable, public ISortable
int m_iIdSeason;
CFanart m_fanart;
CStreamDetails m_streamDetails;
+ bool m_streamDetailsLoaded;
@Montellese
Team Kodi member

I don't really see any benefit from this. In JSON-RPC every CVideoInfoTag object is only retrieved once from the database then serialized into JSON and thrown away. In the GUI listings the thumbloader already checks against m_streamDetails.HasItems() before it tries to retrieve streamdetails so IMO there is no benefit in this extra member variable.

@koying
Team Kodi member
koying added a note Aug 1, 2012

It's just a cheap protection vs unnecessary StreamDetails queries.

Note that checking streamDetails.HasItems() only tells whether stream details exists in the class. If there are none, it could mean that none exists in the DB OR that they have not been loaded yet, so, normally, is not sufficient to tell that GetStreamDetails is not necessary.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
@koying
Team Kodi member

@Montellese Updated as requested

@Montellese Montellese was assigned Aug 2, 2012
@Montellese Montellese merged commit 839738a into xbmc:master Aug 2, 2012
@Montellese
Team Kodi member

Thanks for the quick fix.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment