Use unique IDs for images
[Sone.git] / src / main / java / net / pterodactylus / sone / data / impl / ImageImpl.java
index 2df98b1..b385cfd 100644 (file)
@@ -25,6 +25,7 @@ import static com.google.common.base.Preconditions.checkState;
 import java.util.UUID;
 
 import net.pterodactylus.sone.data.Album;
+import net.pterodactylus.sone.data.IdBuilder;
 import net.pterodactylus.sone.data.Image;
 import net.pterodactylus.sone.data.Sone;
 
@@ -39,6 +40,8 @@ import com.google.common.hash.Hashing;
  */
 public class ImageImpl implements Image {
 
+       private final IdBuilder idBuilder = new IdBuilder();
+
        /** The ID of the image. */
        private final String id;
 
@@ -88,6 +91,11 @@ public class ImageImpl implements Image {
 
        @Override
        public String getId() {
+               return idBuilder.buildId(sone.getId(), id);
+       }
+
+       @Override
+       public String getInternalId() {
                return id;
        }