Improves performance and accuracy of the song list.

Most of the problem was sorting stuff.
This commit is contained in:
Markil3
2021-09-14 13:26:25 -06:00
parent 849771853c
commit 2e8b65ca9c
7 changed files with 599 additions and 273 deletions

View File

@@ -4,6 +4,8 @@
package edu.regis.universeplayer.data;
import java.util.Arrays;
import javax.swing.ImageIcon;
public class Album implements Comparable<Album>
@@ -20,13 +22,22 @@ public class Album implements Comparable<Album>
@Override
public int compareTo(Album o)
{
if (o != null)
if (o != null && o.name != null)
{
return this.name.compareTo(o.name);
return this.name.compareToIgnoreCase(o.name);
}
else
{
return -1;
}
}
@Override
public String toString()
{
return "Album{" +
"name='" + name + '\'' +
", artists=" + Arrays.toString(artists) +
'}';
}
}