private void updateTracks() {
MusiqueTrackListModel musiqueModel = (MusiqueTrackListModel) lstMusiqueTracks.getModel();
DiscogsTrackListModel discogsModel = (DiscogsTrackListModel) lstDiscogsTracks.getModel();
ReleaseTracklistingModel rtm = DiscogsModelUtil.getReleaseTracklistingModel(release);
for (int i = 0; i < musiqueModel.getSize() && i < discogsModel.getSize(); i++) {
Track musiqueTrack = musiqueModel.getEx(i);
org.discogs.model.Track discogsTrack = discogsModel.getEx(i);
TrackData trackData = musiqueTrack.getTrackData();
String albumArtist = DiscogsModelUtil.getReleaseArtistDescription(
release.getArtists(), chckbxUseanv.isSelected(), false);
String trackArtist = DiscogsModelUtil.getReleaseArtistDescription(
discogsTrack.getArtists(), chckbxUseanv.isSelected(), false);
trackData.setTagFieldValues(FieldKey.ALBUM_ARTIST, albumArtist);
trackData.setTagFieldValues(FieldKey.ALBUM, release.getTitle());
trackData.setTagFieldValues(FieldKey.RECORD_LABEL, "");
trackData.setTagFieldValues(FieldKey.CATALOG_NO, "");
for (LabelRelease label : release.getLabelReleases()) {
trackData.addRecordLabel(label.getLabelName());
trackData.addCatalogNo(label.getCatalogNumber());
}
trackData.setTagFieldValues(FieldKey.YEAR, DiscogsModelUtil.getReleaseDateDescription(release));
trackData.setTagFieldValues(FieldKey.GENRE, "");
for (String style : release.getStyles()) {
trackData.addGenre(style);
}
trackData.setTagFieldValues(FieldKey.ARTIST, Util.firstNotEmpty(trackArtist, albumArtist));
trackData.setTagFieldValues(FieldKey.TITLE, DiscogsModelUtil.getTrackTitleCleared(discogsTrack.getTitle()));
trackData.setTagFieldValues(FieldKey.TRACK, rtm.getTrackTrack(discogsTrack));
trackData.setTagFieldValues(FieldKey.TRACK_TOTAL, rtm.getTrackTrackTotal(discogsTrack));
trackData.setTagFieldValues(FieldKey.DISC_NO, rtm.getTrackDisc(discogsTrack));
trackData.setTagFieldValues(FieldKey.DISC_TOTAL, rtm.getTrackDiscTotal(discogsTrack));
}
}