import net.pterodactylus.sone.database.AlbumBuilder;
import net.pterodactylus.sone.database.Database;
import net.pterodactylus.sone.database.DatabaseException;
+import net.pterodactylus.sone.database.ImageBuilder;
import net.pterodactylus.sone.database.PostBuilder;
import net.pterodactylus.sone.database.PostProvider;
import net.pterodactylus.sone.database.PostReplyBuilder;
return database.getAlbum(albumId).orNull();
}
+ public ImageBuilder imageBuilder() {
+ return database.newImageBuilder();
+ }
+
/**
* Returns the image with the given ID, creating it if necessary.
*
logger.log(Level.WARNING, String.format("Downloaded Sone %s contains image %s with invalid dimensions (%s, %s)!", sone, imageId, imageWidthString, imageHeightString));
return null;
}
- Image image = core.getImage(imageId).modify().setSone(sone).setKey(imageKey).setCreationTime(creationTime).update();
+ Image image = core.imageBuilder().withId(imageId).build().modify().setSone(sone).setKey(imageKey).setCreationTime(creationTime).update();
image = image.modify().setTitle(imageTitle).setDescription(imageDescription).update();
image = image.modify().setWidth(imageWidth).setHeight(imageHeight).update();
album.addImage(image);