bool CPluginDirectory::GetPluginResult(const CStdString& strPath, CFileItem &resultItem) { CURL url(strPath); CPluginDirectory* newDir = new CPluginDirectory(); bool success = newDir->StartScript(strPath, false); if (success) { // update the play path, saving the old one as needed if (!resultItem.HasProperty("original_listitem_url")) resultItem.SetProperty("original_listitem_url", resultItem.m_strPath); resultItem.m_strPath = newDir->m_fileResult->m_strPath; resultItem.SetMimeType(newDir->m_fileResult->GetMimeType(false)); } delete newDir; return success; }
bool CPluginDirectory::GetPluginResult(const std::string& strPath, CFileItem &resultItem) { CURL url(strPath); CPluginDirectory newDir; bool success = newDir.StartScript(strPath, false); if (success) { // update the play path and metadata, saving the old one as needed if (!resultItem.HasProperty("original_listitem_url")) resultItem.SetProperty("original_listitem_url", resultItem.GetPath()); resultItem.SetPath(newDir.m_fileResult->GetPath()); resultItem.SetMimeType(newDir.m_fileResult->GetMimeType()); resultItem.UpdateInfo(*newDir.m_fileResult); if (newDir.m_fileResult->HasVideoInfoTag() && newDir.m_fileResult->GetVideoInfoTag()->m_resumePoint.IsSet()) resultItem.m_lStartOffset = STARTOFFSET_RESUME; // resume point set in the resume item, so force resume } return success; }