// rsTemp.getString("artistName"), rsTemp.getString("albumName"), rsTemp
// .getString("genre"), rsTemp.getString("track"), rsTemp
// .getInt("length"), rsTemp.getInt("artistID"), rsTemp
// .getInt("albumID"), rsTemp.getInt("checked") == 1 ? true
// : false, rsTemp.getString("path")));
tracks.add(new Track(rsTemp.getInt("id")));
}
rsTemp.close();
} catch (SQLException e) {
e.printStackTrace();
return;
}
((TrackTable)trackTable).setTracksInLib(tracks);
}else {//ein "echter" interpret wurde selektiert.
rsTemp = PhoenixCore.DBCON.executeOnLib("SELECT al.id, al.name from albums as al " +//alben vom interpreten holen
"inner join artists as a on a.id = al.artist where al.artist = "
+selectedArtist.getId()+" order by lower(al.name) asc");
try {
while(rsTemp.next()) {
alben.add(new Album(rsTemp.getInt("id"), rsTemp.getString("name")));
length++;
}
rsTemp.close();
} catch (SQLException e) {
e.printStackTrace();
return;
}
alb = new Album[length+1][1];
alb[0][0]=(new Album(0, "Alle("+length+")", selectedArtist.getId(), selectedArtist.getName()));
length++;
for (int i=1; i<length; i++) {
alb[i][0] = alben.get(i-1);
}
//alben-tabelle aktualisieren
String[] cols = {"Alben"};
DefaultTableModel model = new DefaultTableModel(alb, cols);
albums.setModel(model);
albums.setFillsViewportHeight(true);
//albums.repaint();
((JViewport)albums.getParent()).setViewPosition(new Point(0, 0));
//track-table aktualisieren.
List<Track> tracks = new ArrayList<Track>();
rsTemp = PhoenixCore.DBCON.executeOnLib("select t.id, t.name, ar.id as artistID, t.album as albumID, " +//titel vom interpreten holen
"t.genre, t.track, t.length, t.checked, t.path, ar.name as artistName, al.name as albumName " +
"from tracks t inner join albums al on t.album=al.id inner join artists ar on al.artist=ar.id " +
"where ar.name='"+selectedArtist.getName().replace("'", "''")+"' order by lower(albumName), t.track asc");
try {
while(rsTemp.next()) {
// tracks.add(new Track(rsTemp.getInt("id"), rsTemp.getString("name"),
// rsTemp.getString("artistName"), rsTemp.getString("albumName"), rsTemp
// .getString("genre"), rsTemp.getString("track"), rsTemp
// .getInt("length"), rsTemp.getInt("artistID"), rsTemp
// .getInt("albumID"), rsTemp.getInt("checked") == 1 ? true
// : false, rsTemp.getString("path")));
tracks.add(new Track(rsTemp.getInt("id")));
}
rsTemp.close();
} catch (SQLException e) {
e.printStackTrace();
return;