示例#1
0
  // ClientTrack(int trackID, String trackName, String path, int albumID, int artistID,int length,
  // int trackNo) {
  public ArrayList<ClientTrack> matchLyrics(String searchLyrics, int artistID, int albumID) {
    CavaResultSet rs = trackDatabase.getLyricsSmart(artistID, albumID);
    ArrayList<ClientTrack> toReturn = new ArrayList<ClientTrack>();
    ClientTrack tempTrack;
    String lyrics, trackName, path;
    int trackID, _albumID, _artistID, length, trackNo;
    searchLyrics = cleanSearchTerm(searchLyrics);
    while (rs.fetchRow()) {
      lyrics = rs.fetchString(1);
      trackID = rs.fetchInt(2);
      trackName = rs.fetchString(3);
      path = rs.fetchString(4);
      _albumID = rs.fetchInt(5);
      _artistID = rs.fetchInt(6);
      length = rs.fetchInt(7);
      trackNo = rs.fetchInt(8);

      // System.out.println("LYRICS:\n|"+lyrics+"|");
      if (lyrics != null) {
        if (dmp.fuzzyMatch(searchLyrics, lyrics, 0) != -1 && lyrics != null) {
          // System.out.println(lyrics);
          tempTrack =
              new ClientTrack(trackID, trackName, path, _albumID, _artistID, length, trackNo);
          toReturn.add(tempTrack);
        }
      }
    }
    return toReturn;
  }