Load styles for track.
authorDavid ‘Bombe’ Roden <bombe@pterodactylus.net>
Thu, 19 Apr 2012 15:47:45 +0000 (17:47 +0200)
committerDavid ‘Bombe’ Roden <bombe@pterodactylus.net>
Thu, 19 Apr 2012 15:47:45 +0000 (17:47 +0200)
src/main/java/net/pterodactylus/demoscenemusic/data/DataManager.java

index 482e717..405d71a 100644 (file)
@@ -218,6 +218,18 @@ public class DataManager {
 
                });
 
+               private final Memoizer<Void> stylesMemoizer = new Memoizer<Void>(new Callable<Void>() {
+
+                       @Override
+                       public Void call() throws Exception {
+                               if (!hasValue("styles")) {
+                                       value("styles", Collection.class).set(getStylesByTrack(id()));
+                               }
+                               return null;
+                       }
+
+               });
+
                /**
                 * @param id
                 */
@@ -239,7 +251,7 @@ public class DataManager {
                 */
                @Override
                public Collection<Style> styles() {
-                       // TODO Auto-generated method stub
+                       stylesMemoizer.get();
                        return super.styles();
                }