Add method to save an artist.
[demoscenemusic.git] / src / main / java / net / pterodactylus / demoscenemusic / data / DataManager.java
index a6f5a54..42952f9 100644 (file)
@@ -168,6 +168,21 @@ public class DataManager {
        }
 
        /**
+        * Saves the given artist.
+        *
+        * @param artist
+        *            The artist to save
+        * @throws DatabaseException
+        *             if a database error occurs
+        */
+       public void saveArtist(Artist artist) throws DatabaseException {
+               Query query = new Query(Type.UPDATE, "ARTISTS");
+               query.addValueField(new ValueField("NAME", new StringParameter(artist.getName())));
+               query.addWhereClause(new ValueFieldWhereClause(new ValueField("ID", new StringParameter(artist.getId()))));
+               database.update(query);
+       }
+
+       /**
         * Returns all remix artists involved in the track with the given ID.
         *
         * @param trackId