- Album parent = webInterface.getCore().getAlbum(parentId, false);
- if (parentId.equals("")) {
- parent = currentSone.getRootAlbum();
- }
- Album album = webInterface.getCore().createAlbum(currentSone, parent);
+ Album parent = parentId.equals("") ? currentSone.getRootAlbum() : webInterface.getCore().getAlbum(parentId).get();
+ Album album = parent.newAlbumBuilder().randomId().build();