Exemple #1
0
	SxThumb::SxThumb(sp_image* image, string path) {
        m_dll = new DllLibspotify();
        m_dll->Load();

		m_isLoaded = false;
		m_image = image;
        sp_link *link = m_dll->sp_link_create_from_image(image);
		char linkString[256];
        m_dll->sp_link_as_string(link, linkString, 256);
		CStdString linkStringClean = linkString;
		linkStringClean.Remove(':');
        m_dll->sp_link_release(link);
		m_file = path + linkStringClean.c_str() + ".jpg";
		if (XFILE::CFile::Exists(m_file, true)) {
			m_isLoaded = true;
		} else {
		  CStdString pathS(m_file);
		  bool recache;
		  CStdString cached(CTextureCache::Get().CheckCachedImage(pathS,true,recache));
		  if (!cached.IsEmpty() && !recache) {
			//Logger::printOut("Thumb already in XBMC cache, no need to download again");
			m_file = cached;
			m_imageIsFromCache = true;
			m_isLoaded = true;
		  } else {
			m_imageIsFromCache = false;
            m_dll->sp_image_add_load_callback(m_image, &cb_imageLoaded, this);
		  }
		}

		m_references = 1;

	}
Exemple #2
0
void CPVRRecording::UpdatePath(void)
{
  CStdString strTitle = m_strTitle;
  CStdString strDatetime = m_recordingTime.GetAsSaveString();
  strTitle.Replace('/','-');
  strTitle.Remove('?');

  if (m_strDirectory != "")
    m_strFileNameAndPath.Format("pvr://recordings/%s/%s/%s.pvr",
        m_strDirectory.c_str(), strDatetime.c_str(), strTitle.c_str());
  else
    m_strFileNameAndPath.Format("pvr://recordings/%s/%s.pvr",
        strDatetime.c_str(), strTitle.c_str());
}