Пример #1
0
 public static String getThumbUri(ICoverArt cover) {
   if (cover.getThumbnail() != null) {
     return cover.getThumbnail();
   }
   final String hex = Crc32.formatAsHexLowerCase(cover.getCrc());
   return THUMB_PREFIX + hex.charAt(0) + "/" + hex + ".tbn";
 }
Пример #2
0
 /**
  * If no album thumb CRC is found, try to get the thumb of the album's directory.
  *
  * @return 0-char CRC32
  */
 public int getFallbackCrc() {
   if (localPath != null) {
     final String lp = localPath;
     return Crc32.computeLowerCase(lp.substring(0, lp.length() - 1));
   } else {
     return 0;
   }
 }
Пример #3
0
 public static String getFallbackThumbUri(ICoverArt cover) {
   final int crc = cover.getFallbackCrc();
   if (crc != 0) {
     final String hex = Crc32.formatAsHexLowerCase(crc);
     return THUMB_PREFIX + hex.charAt(0) + "/" + hex + ".tbn";
   } else {
     return null;
   }
 }
Пример #4
0
 /**
  * Returns the CRC of the album on which the thumb name is based upon.
  *
  * @return CRC32
  */
 public long getCrc() {
   if (thumbID == 0) {
     thumbID = Crc32.computeLowerCase((name + artist));
   }
   return thumbID;
 }
 /**
  * Returns CRC for episode thumb. From FileItem.cpp(2597):
  *
  * <pre>
  * 	CStdString strCRC;
  * strCRC.Format("%sepisode%i",GetVideoInfoTag()->m_strFileNameAndPath.c_str(),GetVideoInfoTag()->m_iEpisode);
  * return GetCachedThumb(strCRC,g_settings.GetVideoThumbFolder(),true);
  * </pre>
  */
 public int getFallbackCrc() {
   return Crc32.computeLowerCase(artUrl);
 }
 public long getCrc() {
   return Crc32.computeLowerCase(artUrl);
 }