Rename album name to album title.
authorDavid ‘Bombe’ Roden <bombe@pterodactylus.net>
Sun, 10 Apr 2011 18:02:21 +0000 (20:02 +0200)
committerDavid ‘Bombe’ Roden <bombe@pterodactylus.net>
Wed, 13 Apr 2011 04:40:49 +0000 (06:40 +0200)
src/main/java/net/pterodactylus/sone/core/Core.java
src/main/java/net/pterodactylus/sone/data/Album.java
src/main/java/net/pterodactylus/sone/web/CreateAlbumPage.java

index 3a0a722..06a1467 100644 (file)
@@ -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());
                        }
index 601e68d..a0a85de 100644 (file)
@@ -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. */
index 5382253..afe95b7 100644 (file)
@@ -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());
                }