Rename album name to album title.
[Sone.git] / src / main / java / net / pterodactylus / sone / web / CreateAlbumPage.java
index 7b51fb5..afe95b7 100644 (file)
@@ -58,11 +58,13 @@ public class CreateAlbumPage extends SoneTemplatePage {
                                templateContext.set("nameMissing", true);
                                return;
                        }
+                       String description = request.getHttpRequest().getPartAsStringFailsafe("description", 256).trim();
                        Sone currentSone = getCurrentSone(request.getToadletContext());
                        String parentId = request.getHttpRequest().getPartAsStringFailsafe("parent", 36);
                        Album parent = webInterface.getCore().getAlbum(parentId, false);
                        Album album = webInterface.getCore().createAlbum(currentSone, parent);
-                       album.setName(name);
+                       album.setTitle(name).setDescription(description);
+                       webInterface.getCore().saveSone(currentSone);
                        throw new RedirectException("imageBrowser.html?album=" + album.getId());
                }
        }