Copy options when rescuing Sone.
authorDavid ‘Bombe’ Roden <bombe@pterodactylus.net>
Sat, 2 Feb 2013 21:47:22 +0000 (22:47 +0100)
committerDavid ‘Bombe’ Roden <bombe@pterodactylus.net>
Sat, 2 Feb 2013 21:47:22 +0000 (22:47 +0100)
src/main/java/net/pterodactylus/sone/core/Core.java
src/main/java/net/pterodactylus/sone/data/Sone.java

index 9fe41ac..0571e0d 100644 (file)
@@ -1091,6 +1091,7 @@ public class Core extends AbstractService implements SoneProvider, PostProvider,
                                }
                        }
                        synchronized (sones) {
+                               sone.setOptions(storedSone.get().getOptions());
                                sones.put(sone.getId(), sone);
                        }
                }
index 9d9d2d7..a609982 100644 (file)
@@ -228,7 +228,7 @@ public class Sone implements Fingerprintable, Comparable<Sone> {
        private final List<Album> albums = new CopyOnWriteArrayList<Album>();
 
        /** Sone-specific options. */
-       private final Options options = new Options();
+       private Options options = new Options();
 
        /**
         * Creates a new Sone.
@@ -895,6 +895,17 @@ public class Sone implements Fingerprintable, Comparable<Sone> {
                return options;
        }
 
+       /**
+        * Sets the options of this Sone.
+        *
+        * @param options
+        *            The options of this Sone
+        */
+       /* TODO - remove this method again, maybe add an option provider */
+       public void setOptions(Options options) {
+               this.options = options;
+       }
+
        //
        // FINGERPRINTABLE METHODS
        //