Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[python] Add setContentLookup method #7757

Merged
merged 1 commit into from Aug 15, 2015
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
1 change: 1 addition & 0 deletions xbmc/FileItem.cpp
Expand Up @@ -425,6 +425,7 @@ void CFileItem::Initialize()
m_iHasLock = 0;
m_bCanQueue = true;
m_specialSort = SortSpecialNone;
m_doContentLookup = true;
}

void CFileItem::Reset()
Expand Down
9 changes: 8 additions & 1 deletion xbmc/FileItem.h
Expand Up @@ -417,7 +417,13 @@ class CFileItem :
\brief Some sources do not support HTTP HEAD request to determine i.e. mime type
\return false if HEAD requests have to be avoided
*/
bool ContentLookup() { return true; };
bool ContentLookup() { return m_doContentLookup; };

/*!
*\brief Lookup via HTTP HEAD request might not be needed, use this setter to
* disable ContentLookup.
*/
void SetContentLookup(bool enable) { m_doContentLookup = enable; };

/* general extra info about the contents of the item, not for display */
void SetExtraInfo(const std::string& info) { m_extrainfo = info; };
Expand Down Expand Up @@ -490,6 +496,7 @@ class CFileItem :
bool m_bLabelPreformated;
std::string m_mimetype;
std::string m_extrainfo;
bool m_doContentLookup;
MUSIC_INFO::CMusicInfoTag* m_musicInfoTag;
CVideoInfoTag* m_videoInfoTag;
EPG::CEpgInfoTagPtr m_epgInfoTag;
Expand Down
6 changes: 6 additions & 0 deletions xbmc/interfaces/legacy/ListItem.cpp
Expand Up @@ -236,6 +236,12 @@ namespace XBMCAddon
item->SetMimeType(mimetype);
}

void ListItem::setContentLookup(bool enable)
{
LOCKGUI;
item->SetContentLookup(enable);
}

String ListItem::getdescription()
{
return item->GetLabel();
Expand Down
12 changes: 11 additions & 1 deletion xbmc/interfaces/legacy/ListItem.h
Expand Up @@ -341,10 +341,20 @@ namespace XBMCAddon
* \n
* mimetype : string or unicode - mimetype.\n
* \n
* *If known prehand, this can avoid Kodi doing HEAD requests to http servers to figure out file type.\n
* If known prehand, this can (but does not have to) avoid HEAD requests
* being sent to HTTP servers to figure out file type.\n
*/
void setMimeType(const String& mimetype);

/**
* setContentLookup(enable) -- Enable or disable content lookup for item.
*
* If disabled, HEAD requests to e.g determine mime type will not be sent.
*
* enable : bool
*/
void setContentLookup(bool enable);

/**
* setSubtitles() -- Sets subtitles for this listitem.\n
*
Expand Down