// Path: src/app/musicplayer/util/Resources.java
// public final class Resources {
// 
//     public static final String FXML = "/app/musicplayer/view/";
//     public static final String IMG = "/app/musicplayer/util/img/";
//     public static final String CSS = "/app/musicplayer/util/css/";
//     public static String JAR;
//     public static final String APIBASE = "http://ws.audioscrobbler.com/2.0/?";
//     public static final String APIKEY = "57ee3318536b23ee81d6b27e36997cde";
// 
//     private Resources() {}
// }


import java.awt.Color;
import java.awt.image.BufferedImage;
import java.io.File;
import java.net.URL;
import java.net.URLEncoder;
import java.util.ArrayList;
import javax.imageio.ImageIO;
import javax.xml.stream.XMLInputFactory;
import javax.xml.stream.XMLStreamReader;
import app.musicplayer.util.Resources;
import javafx.beans.property.ObjectProperty;
import javafx.beans.property.SimpleObjectProperty;
import javafx.scene.image.Image;
package app.musicplayer.model;




/**
 * Model class for an Artist
 *
 */
public final class Artist implements Comparable<Artist> {

    private String title;
    private ArrayList<Album> albums;
    private Image artistImage;
    private SimpleObjectProperty<Image> artistImageProperty;

    /**
     * Constructor for the Artist class.
     * Creates an artist object and obtains the artist artwork.
     *
     * @param title Artist name
     * @param albums List of artist albums
     */
    public Artist(String title, ArrayList<Album> albums) {
        this.title = title;
        this.albums = albums;
        this.artistImageProperty = new SimpleObjectProperty<>(getArtistImage());
    }

    /**
     * Gets the artist title.
     * @return artist title
     */
    public String getTitle() {
        return this.title;
    }

    /**
     * Gets array list of artist albums
     * @return artist albums
     */
    public ArrayList<Album> getAlbums() {
        return new ArrayList<>(this.albums);
    }

    public ObjectProperty<Image> artistImageProperty() {
        return this.artistImageProperty;
    }

    /**
     * Gets images for artists
     * @return artist image
     */
    public Image getArtistImage() {
        if (artistImage == null) {
            try {
// Path: src/app/musicplayer/util/Resources.java
// public final class Resources {
// 
//     public static final String FXML = "/app/musicplayer/view/";
//     public static final String IMG = "/app/musicplayer/util/img/";
//     public static final String CSS = "/app/musicplayer/util/css/";
//     public static String JAR;
//     public static final String APIBASE = "http://ws.audioscrobbler.com/2.0/?";
//     public static final String APIKEY = "57ee3318536b23ee81d6b27e36997cde";
// 
//     private Resources() {}
// }


// Path: src/app/musicplayer/model/Artist.java
import java.awt.Color;
import java.awt.image.BufferedImage;
import java.io.File;
import java.net.URL;
import java.net.URLEncoder;
import java.util.ArrayList;
import javax.imageio.ImageIO;
import javax.xml.stream.XMLInputFactory;
import javax.xml.stream.XMLStreamReader;
import app.musicplayer.util.Resources;
import javafx.beans.property.ObjectProperty;
import javafx.beans.property.SimpleObjectProperty;
import javafx.scene.image.Image;

package app.musicplayer.model;




/**
 * Model class for an Artist
 *
 */
public final class Artist implements Comparable<Artist> {

    private String title;
    private ArrayList<Album> albums;
    private Image artistImage;
    private SimpleObjectProperty<Image> artistImageProperty;

    /**
     * Constructor for the Artist class.
     * Creates an artist object and obtains the artist artwork.
     *
     * @param title Artist name
     * @param albums List of artist albums
     */
    public Artist(String title, ArrayList<Album> albums) {
        this.title = title;
        this.albums = albums;
        this.artistImageProperty = new SimpleObjectProperty<>(getArtistImage());
    }

    /**
     * Gets the artist title.
     * @return artist title
     */
    public String getTitle() {
        return this.title;
    }

    /**
     * Gets array list of artist albums
     * @return artist albums
     */
    public ArrayList<Album> getAlbums() {
        return new ArrayList<>(this.albums);
    }

    public ObjectProperty<Image> artistImageProperty() {
        return this.artistImageProperty;
    }

    /**
     * Gets images for artists
     * @return artist image
     */
    public Image getArtistImage() {
        if (artistImage == null) {
            try {
                File file = new File(Resources.JAR + "/img/" + this.title + ".jpg");