Skip to content

Commit

Permalink
2024.1a minor bugfixes
Browse files Browse the repository at this point in the history
  • Loading branch information
DoubleDee73 committed Jan 25, 2024
1 parent 4c314ee commit 0ba69e0
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 4 deletions.
2 changes: 0 additions & 2 deletions src/yass/YassSongList.java
Original file line number Diff line number Diff line change
Expand Up @@ -2356,7 +2356,6 @@ public void setSelectionGenre(String genre) {
* @param tags The new selectionGenre value
*/
public void setSelectionTags(String tags, boolean isSelected) {
System.out.println("setSelectionTags " + tags);
int[] rows = getSelectedRows();
boolean changed = false;
for (int row : rows) {
Expand Down Expand Up @@ -3210,7 +3209,6 @@ public synchronized void storeSongDetails(YassSong s, YassTable t) {
t.setAudio(s.getMP3());
}
t.setTags(s.getTags());

String tmp = prop.getProperty("temp-dir");
String title = YassSong.toFilename(s.getTitle());
String artist = YassSong.toFilename(s.getArtist());
Expand Down
9 changes: 7 additions & 2 deletions src/yass/YassTable.java
Original file line number Diff line number Diff line change
Expand Up @@ -965,6 +965,9 @@ public boolean setTags(String tag) {
return true;
}
if (r == null) {
if (StringUtils.isEmpty(tag)) {
return false;
}
r = new YassRow("#", TAGS.getTagName(), tag, "", "");
YassRow v = tm.getCommentRow(GENRE);
if (v == null) {
Expand Down Expand Up @@ -4194,6 +4197,7 @@ public int insertRowsAt(String trstring, int startRow, boolean before) {
int rowCounter = before ? 0 : 1;
int pasteBeat = -1;
int currentBeat = 0;
int lengthInt = 0;
boolean hasPageBreak = false;
for (String line : lines) {
String[] currentRow = line.split("\t");
Expand All @@ -4207,7 +4211,7 @@ public int insertRowsAt(String trstring, int startRow, boolean before) {
String txt = currentRow.length > 4 ? currentRow[4] : "";
txt = txt.replace(' ', YassRow.SPACE);
int beatInt = Integer.parseInt(beat);
int lengthInt = StringUtils.isNumeric(length) ? Integer.parseInt(length) : 0;
lengthInt = StringUtils.isNumeric(length) ? Integer.parseInt(length) : 0;
boolean isSep = type.equals("-");
if (isSep && length.length() > 0) {
length = Integer.toString(lengthInt + startBeat);
Expand All @@ -4223,7 +4227,8 @@ public int insertRowsAt(String trstring, int startRow, boolean before) {
if (pasteBeat == -1) {
pasteBeat = existingRowsToAppend.get(0).getBeatInt() - 1;
} else {
pasteBeat = pasteBeat + ((existingRowsToAppend.get(0).getBeatInt() - pasteBeat) / 2);
int lastNoteEnding = currentBeat + lengthInt;
pasteBeat = lastNoteEnding + ((existingRowsToAppend.get(0).getBeatInt() - lastNoteEnding) / 2);
}
tm.addRow(new YassRow("-", Integer.toString(pasteBeat), StringUtils.EMPTY, StringUtils.EMPTY,
StringUtils.EMPTY));
Expand Down

0 comments on commit 0ba69e0

Please sign in to comment.