From: David ‘Bombe’ Roden Date: Sun, 10 Apr 2011 18:02:21 +0000 (+0200) Subject: Rename album name to album title. X-Git-Tag: beta-freefall-0.6.2-1~56 X-Git-Url: https://git.pterodactylus.net/?a=commitdiff_plain;h=7dfc9c778882083632f916b178a241f06c2a08fe;p=Sone.git Rename album name to album title. --- diff --git a/src/main/java/net/pterodactylus/sone/core/Core.java b/src/main/java/net/pterodactylus/sone/core/Core.java index 3a0a722..06a1467 100644 --- a/src/main/java/net/pterodactylus/sone/core/Core.java +++ b/src/main/java/net/pterodactylus/sone/core/Core.java @@ -1327,14 +1327,14 @@ public class Core implements IdentityListener, UpdateListener { if (albumId == null) { break; } - String albumName = configuration.getStringValue(albumPrefix + "/Name").getValue(null); + String albumTitle = configuration.getStringValue(albumPrefix + "/Title").getValue(null); String albumDescription = configuration.getStringValue(albumPrefix + "/Description").getValue(null); String albumParentId = configuration.getStringValue(albumPrefix + "/Parent").getValue(null); - if ((albumName == null) || (albumDescription == null)) { + if ((albumTitle == null) || (albumDescription == null)) { logger.log(Level.WARNING, "Invalid album found, aborting load!"); return; } - Album album = getAlbum(albumId).setSone(sone).setName(albumName).setDescription(albumDescription); + Album album = getAlbum(albumId).setSone(sone).setTitle(albumTitle).setDescription(albumDescription); if (albumParentId != null) { Album parentAlbum = getAlbum(albumParentId, false); if (parentAlbum == null) { @@ -1483,7 +1483,7 @@ public class Core implements IdentityListener, UpdateListener { for (Album album : albums) { String albumPrefix = sonePrefix + "/Albums/" + albumCounter++; configuration.getStringValue(albumPrefix + "/ID").setValue(album.getId()); - configuration.getStringValue(albumPrefix + "/Name").setValue(album.getName()); + configuration.getStringValue(albumPrefix + "/Title").setValue(album.getTitle()); configuration.getStringValue(albumPrefix + "/Description").setValue(album.getDescription()); configuration.getStringValue(albumPrefix + "/Parent").setValue(album.getParent() == null ? null : album.getParent().getId()); } diff --git a/src/main/java/net/pterodactylus/sone/data/Album.java b/src/main/java/net/pterodactylus/sone/data/Album.java index 601e68d..a0a85de 100644 --- a/src/main/java/net/pterodactylus/sone/data/Album.java +++ b/src/main/java/net/pterodactylus/sone/data/Album.java @@ -45,8 +45,8 @@ public class Album implements Fingerprintable { /** The parent album. */ private Album parent; - /** The name of this album. */ - private String name; + /** The title of this album. */ + private String title; /** The description of this album. */ private String description; @@ -220,24 +220,24 @@ public class Album implements Fingerprintable { } /** - * Returns the name of this album. + * Returns the title of this album. * - * @return The name of this album + * @return The title of this album */ - public String getName() { - return name; + public String getTitle() { + return title; } /** - * Sets the name of this album. + * Sets the title of this album. * - * @param name - * The name of this album + * @param title + * The title of this album * @return This album */ - public Album setName(String name) { - Validation.begin().isNotNull("Album Name", name).check(); - this.name = name; + public Album setTitle(String title) { + Validation.begin().isNotNull("Album Title", title).check(); + this.title = title; return this; } @@ -275,7 +275,7 @@ public class Album implements Fingerprintable { StringBuilder fingerprint = new StringBuilder(); fingerprint.append("Album("); fingerprint.append("ID(").append(id).append(')'); - fingerprint.append("Name(").append(name).append(')'); + fingerprint.append("Title(").append(title).append(')'); fingerprint.append("Description(").append(description).append(')'); /* add nested albums. */ diff --git a/src/main/java/net/pterodactylus/sone/web/CreateAlbumPage.java b/src/main/java/net/pterodactylus/sone/web/CreateAlbumPage.java index 5382253..afe95b7 100644 --- a/src/main/java/net/pterodactylus/sone/web/CreateAlbumPage.java +++ b/src/main/java/net/pterodactylus/sone/web/CreateAlbumPage.java @@ -63,7 +63,7 @@ public class CreateAlbumPage extends SoneTemplatePage { String parentId = request.getHttpRequest().getPartAsStringFailsafe("parent", 36); Album parent = webInterface.getCore().getAlbum(parentId, false); Album album = webInterface.getCore().createAlbum(currentSone, parent); - album.setName(name).setDescription(description); + album.setTitle(name).setDescription(description); webInterface.getCore().saveSone(currentSone); throw new RedirectException("imageBrowser.html?album=" + album.getId()); }