+ query.addWhereClause(new ValueFieldWhereClause(new ValueField("TRACK_ARTISTS.ARTIST", new StringParameter(artistId))));
+ return loadTrackProperties(database.getMultiple(query, trackCreator));
+ }
+
+ /**
+ * Returns all tracks that were released at the party with the given ID.
+ *
+ * @param partyId
+ * The ID of the party
+ * @return All tracks that were released at the given party
+ * @throws DatabaseException
+ * if a database error occurs
+ */
+ public Collection<Track> getTracksByParty(String partyId) throws DatabaseException {
+ Query query = new Query(Type.SELECT, "TRACKS");
+ query.addField(new Field("TRACKS.*"));
+ query.addJoin(new Join(JoinType.INNER, "PARTY_TRACKS", new Field("PARTY_TRACKS.TRACK"), new Field("TRACKS.ID")));
+ query.addWhereClause(new ValueFieldWhereClause(new ValueField("PARTY_TRACKS.PARTY", new StringParameter(partyId))));
+ return loadTrackProperties(database.getMultiple(query, trackCreator));
+ }
+
+ /**
+ * Loads the properties for the given track.
+ *
+ * @param track
+ * The track for which to load the properties
+ * @return The track with the properties loaded
+ * @throws DatabaseException
+ * if a database error occurs
+ */
+ public Track loadTrackProperties(Track track) throws DatabaseException {
+ return loadProperties(track, "TRACK_PROPERTIES", "TRACK");
+ }
+
+ /**
+ * Loads the properties for the given tracks.
+ *
+ * @param tracks
+ * The tracks for which to load the properties
+ * @return The tracks with the properties loaded
+ * @throws DatabaseException
+ * if a database error occurs
+ */
+ public List<Track> loadTrackProperties(List<Track> tracks) throws DatabaseException {
+ return loadProperties(tracks, "TRACK_PROPERTIES", "TRACK");
+ }
+
+ /**
+ * Creates a new track with the given name.
+ *
+ * @param name
+ * The name of the track
+ * @return The created track
+ * @throws DatabaseException
+ * if a database error occurs
+ */
+ public Track createTrack(String name) throws DatabaseException {
+ Query query = new Query(Type.INSERT, "TRACKS");
+ String id = UUID.randomUUID().toString();
+ query.addValueField(new ValueField("ID", new StringParameter(id)));
+ query.addValueField(new ValueField("NAME", new StringParameter(name)));
+ database.insert(query);
+ return getTrackById(id);
+ }
+
+ /**
+ * Saves the given track. This also saves all relationships of the track.
+ *
+ * @param track
+ * The track to save
+ * @throws DatabaseException
+ * if a database error occurs
+ */
+ public void saveTrack(Track track) throws DatabaseException {
+ Query query = new Query(Type.UPDATE, "TRACKS");
+ query.addValueField(new ValueField("TRACKS.NAME", new StringParameter(track.getName())));
+ query.addValueField(new ValueField("TRACKS.REMIX", new StringParameter(track.getRemix())));
+ query.addWhereClause(new ValueFieldWhereClause(new ValueField("TRACKS.ID", new StringParameter(track.getId()))));
+ database.update(query);
+ /* store artist information. */
+ track.getArtists(); /* prefetch artists. */
+ query = new Query(Type.DELETE, "TRACK_ARTISTS");
+ query.addWhereClause(new ValueFieldWhereClause(new ValueField("TRACK_ARTISTS.TRACK", new StringParameter(track.getId()))));
+ database.update(query);
+ for (int index = 0; index < track.getArtists().size(); ++index) {
+ query = new Query(Type.INSERT, "TRACK_ARTISTS");
+ query.addValueField(new ValueField("TRACK_ARTISTS.TRACK", new StringParameter(track.getId())));
+ query.addValueField(new ValueField("TRACK_ARTISTS.ARTIST", new StringParameter(track.getArtists().get(index).getId())));
+ query.addValueField(new ValueField("TRACK_ARTISTS.DISPLAY_ORDER", new IntegerParameter(index + 1)));
+ database.insert(query);
+ }
+
+ /* store party links. */
+ Collection<Party> parties = track.getParties(); /* prefetch parties. */
+ query = new Query(Type.DELETE, "PARTY_TRACKS");
+ query.addWhereClause(new ValueFieldWhereClause(new ValueField("PARTY_TRACKS.TRACK", new StringParameter(track.getId()))));
+ database.update(query);
+ for (Party party : parties) {
+ query = new Query(Type.INSERT, "PARTY_TRACKS");
+ query.addValueField(new ValueField("PARTY_TRACKS.TRACK", new StringParameter(track.getId())));
+ query.addValueField(new ValueField("PARTY_TRACKS.PARTY", new StringParameter(party.getId())));
+ database.insert(query);
+ }
+
+ /* store properties. */
+ saveProperties(track.getProperties(), "TRACK_PROPERTIES", "TRACK", track.getId());
+ }
+
+ /**
+ * Returns the derivative with the given ID.
+ *
+ * @param id
+ * The ID of the derivatives to load
+ * @return The derivative with the given ID
+ * @throws DatabaseException
+ * if a database error occurs
+ */
+ public TrackDerivative getTrackDerivativeById(String id) throws DatabaseException {
+ Query query = new Query(Type.SELECT, "TRACK_DERIVATIVES");
+ query.addField(new Field("TRACK_DERIVATIVES.*"));
+ query.addWhereClause(new ValueFieldWhereClause(new ValueField("TRACK_DERIVATIVES.ID", new StringParameter(id))));
+ return loadTrackDerivativeProperties(database.getSingle(query, trackDerivativeCreator));
+ }
+
+ /**
+ * Returns the derivatives for the given track.
+ *
+ * @param trackId
+ * The track ID to get the derivatives for
+ * @return The derivatives for the given track
+ * @throws DatabaseException
+ * if a database error occurs
+ */
+ public Collection<TrackDerivative> getTrackDerivativesByTrack(String trackId) throws DatabaseException {
+ Query query = new Query(Type.SELECT, "TRACK_DERIVATIVES");
+ query.addField(new Field("TRACK_DERIVATIVES.*"));
+ query.addWhereClause(new ValueFieldWhereClause(new ValueField("TRACK_DERIVATIVES.TRACK", new StringParameter(trackId))));
+ return loadTrackDerivativeProperties(database.getMultiple(query, trackDerivativeCreator));
+ }
+
+ /**
+ * Creates a new derivative for the given track.
+ *
+ * @param track
+ * The track to create the derivative for
+ * @return The created derivative
+ * @throws DatabaseException
+ * if a database error occurs
+ */
+ public TrackDerivative createTrackDerivative(Track track) throws DatabaseException {
+ Query query = new Query(Type.INSERT, "TRACK_DERIVATIVES");
+ String id = UUID.randomUUID().toString();
+ query.addValueField(new ValueField("TRACK_DERIVATIVES.ID", new StringParameter(id)));
+ query.addValueField(new ValueField("TRACK_DERIVATIVES.TRACK", new StringParameter(track.getId())));
+ database.insert(query);
+ return getTrackDerivativeById(id);
+ }
+
+ /**
+ * Loads the properties for the given track derivative.
+ *
+ * @param trackDerivative
+ * The track derivative to load the properties for
+ * @return The track derivative with its properties loaded
+ * @throws DatabaseException
+ * if a database error occurs
+ */
+ public TrackDerivative loadTrackDerivativeProperties(TrackDerivative trackDerivative) throws DatabaseException {
+ return loadProperties(trackDerivative, "TRACK_DERIVATIVE_PROPERTIES", "TRACK_DERIVATIVE");
+ }
+
+ /**
+ * Loads the properties for the given track derivatives.
+ *
+ * @param trackDerivatives
+ * The track derivatives to load the properties for
+ * @return The track derivatives with their properties loaded
+ * @throws DatabaseException
+ * if a database error occurs
+ */
+ public List<TrackDerivative> loadTrackDerivativeProperties(List<TrackDerivative> trackDerivatives) throws DatabaseException {
+ return loadProperties(trackDerivatives, "TRACK_DERIVATIVE_PROPERTIES", "TRACK_DERIVATIVE");
+ }
+
+ /**
+ * Saves the given track derivative. As a track derivative does not have any
+ * attributes of its own only its properties are saved.
+ *
+ * @param trackDerivative
+ * The track derivative to save
+ * @throws DatabaseException
+ * if a database error occurs
+ */
+ public void saveTrackDerivate(TrackDerivative trackDerivative) throws DatabaseException {
+ saveProperties(trackDerivative.getProperties(), "TRACK_DERIVATIVE_PROPERTIES", "TRACK_DERIVATIVE", trackDerivative.getId());
+ }
+
+ /**
+ * Removes the given track derivative and all its properties from the
+ * database.
+ *
+ * @param trackDerivative
+ * The track derivative to remove
+ * @throws DatabaseException
+ * if a database error occurs
+ */
+ public void removeTrackDerivative(TrackDerivative trackDerivative) throws DatabaseException {
+ Query query = new Query(Type.DELETE, "TRACK_DERIVATIVES");
+ query.addWhereClause(new ValueFieldWhereClause(new ValueField("TRACK_DERIVATIVES.ID", new StringParameter(trackDerivative.getId()))));
+ database.update(query);
+ /* remove the properties. */
+ saveProperties(new Properties().set("dirty", "true").removeAll(), "TRACK_DERIVATIVE_PROPERTIES", "TRACK_DERIVATIVE", trackDerivative.getId());
+ }
+
+ /**
+ * Returns all groups.
+ *
+ * @return All groups
+ * @throws DatabaseException
+ * if a database error occurs
+ */
+ public Collection<Group> getAllGroups() throws DatabaseException {
+ Query query = new Query(Type.SELECT, "GROUPS");
+ query.addField(new Field("GROUPS.*"));
+ return loadGroupProperties(database.getMultiple(query, groupCreator));
+ }
+
+ /**
+ * Returns the group with the given ID.
+ *
+ * @param groupId
+ * The ID of the group
+ * @return The group with the given ID, or {@code null} if no such group
+ * exists
+ * @throws DatabaseException
+ * if a database error occurs
+ */
+ public Group getGroupById(String groupId) throws DatabaseException {
+ Query query = new Query(Type.SELECT, "GROUPS");
+ query.addField(new Field("GROUPS.*"));
+ query.addWhereClause(new ValueFieldWhereClause(new ValueField("GROUPS.ID", new StringParameter(groupId))));
+ return loadGroupProperties(database.getSingle(query, groupCreator));
+ }
+
+ /**
+ * Returns all groups the artist with the given ID belongs to.
+ *
+ * @param artistId
+ * The ID of the artist
+ * @return All groups the artist belongs to
+ * @throws DatabaseException
+ * if a database error occurs
+ */
+ public Collection<Group> getGroupsByArtist(String artistId) throws DatabaseException {
+ Query query = new Query(Type.SELECT, "GROUPS");
+ query.addField(new Field("GROUPS.*"));
+ query.addJoin(new Join(JoinType.INNER, "GROUP_ARTISTS", new Field("GROUPS.ID"), new Field("GROUP_ARTISTS.GROUP_")));
+ query.addWhereClause(new ValueFieldWhereClause(new ValueField("GROUP_ARTISTS.ARTIST", new StringParameter(artistId))));
+ return database.getMultiple(query, groupCreator);
+ }
+
+ /**
+ * Loads the properties of the given group.
+ *
+ * @param group
+ * The group to load the properties for
+ * @return The group with its properties loaded
+ * @throws DatabaseException
+ * if a database error occurs
+ */
+ public Group loadGroupProperties(Group group) throws DatabaseException {
+ return loadProperties(group, "GROUP_PROPERTIES", "GROUP_ID");
+ }
+
+ /**
+ * Loads the properties of the given groups.
+ *
+ * @param groups
+ * The groups to load the properties for
+ * @return The groups with their properties loaded
+ * @throws DatabaseException
+ * if a database error occurs
+ */
+ public Collection<Group> loadGroupProperties(List<Group> groups) throws DatabaseException {
+ return loadProperties(groups, "GROUP_PROPERTIES", "GROUP_ID");
+ }
+
+ /**
+ * Creates a group with the given name.
+ *
+ * @param name
+ * The name of the new group
+ * @return The new group
+ * @throws DatabaseException
+ * if a database error occurs
+ */
+ public Group createGroup(String name) throws DatabaseException {
+ Query query = new Query(Type.INSERT, "GROUPS");
+ String id = UUID.randomUUID().toString();
+ query.addValueField(new ValueField("ID", new StringParameter(id)));
+ query.addValueField(new ValueField("NAME", new StringParameter(name)));
+ database.insert(query);
+ return getGroupById(id);
+ }
+
+ /**
+ * Saves the given group.
+ *
+ * @param group
+ * The group to save
+ * @throws DatabaseException
+ * if a database error occurs
+ */
+ public void saveGroup(Group group) throws DatabaseException {
+ Query query = new Query(Type.UPDATE, "GROUPS");
+ query.addValueField(new ValueField("NAME", new StringParameter(group.getName())));
+ query.addWhereClause(new ValueFieldWhereClause(new ValueField("ID", new StringParameter(group.getId()))));
+ database.update(query);
+ /* save properties. */
+ saveGroupProperties(group);
+ }
+
+ /**
+ * Saves the properties of the given group.
+ *
+ * @param group
+ * The group whose properties to save
+ * @throws DatabaseException
+ * if a database error occurs
+ */
+ public void saveGroupProperties(Group group) throws DatabaseException {
+ saveProperties(group.getProperties(), "GROUP_PROPERTIES", "GROUP_ID", group.getId());
+ }
+
+ /**
+ * Returns all styles for the track with the given ID.
+ *
+ * @param trackId
+ * The ID of the track
+ * @return All styles for the given track
+ * @throws DatabaseException
+ * if a database error occurs
+ */
+ public Collection<Style> getStylesByTrack(String trackId) throws DatabaseException {
+ Query query = new Query(Type.SELECT, "STYLES");
+ query.addField(new Field("STYLES.*"));
+ query.addJoin(new Join(JoinType.INNER, "TRACK_STYLES", new Field("STYLES.ID"), new Field("TRACK_STYLES.STYLE")));
+ query.addWhereClause(new ValueFieldWhereClause(new ValueField("TRACK_STYLES.TRACK", new StringParameter(trackId))));
+ return database.getMultiple(query, styleCreator);
+ }
+
+ /**
+ * Returns all parties.
+ *
+ * @return All parties
+ * @throws DatabaseException
+ * if a database error occurs
+ */
+ public Collection<Party> getAllParties() throws DatabaseException {
+ Query query = new Query(Type.SELECT, "PARTIES");
+ query.addField(new Field("PARTIES.*"));
+ return loadPartyProperties(database.getMultiple(query, partyCreator));
+ }
+
+ /**
+ * Returns all parties that the track with the given ID was released at.
+ *
+ * @param trackId
+ * The ID of the track
+ * @return All parties the track was released at
+ * @throws DatabaseException
+ * if a database error occurs
+ */
+ public Collection<Party> getPartiesByTrackId(String trackId) throws DatabaseException {
+ Query query = new Query(Type.SELECT, "PARTIES");
+ query.addField(new Field("PARTIES.*"));
+ query.addJoin(new Join(JoinType.INNER, "PARTY_TRACKS", new Field("PARTY_TRACKS.PARTY"), new Field("PARTIES.ID")));
+ query.addWhereClause(new ValueFieldWhereClause(new ValueField("PARTY_TRACKS.TRACK", new StringParameter(trackId))));
+ return loadPartyProperties(database.getMultiple(query, partyCreator));
+ }
+
+ /**
+ * Returns the party with the given ID.
+ *
+ * @param partyId
+ * The ID of the party
+ * @return The party with the given ID
+ * @throws DatabaseException
+ * if a database error occurs
+ */
+ public Party getPartyById(String partyId) throws DatabaseException {
+ Query query = new Query(Type.SELECT, "PARTIES");
+ query.addField(new Field("PARTIES.*"));
+ query.addWhereClause(new ValueFieldWhereClause(new ValueField("PARTIES.ID", new StringParameter(partyId))));
+ return loadPartyProperties(database.getSingle(query, partyCreator));
+ }
+
+ /**
+ * Loads the properties of the given party.
+ *
+ * @param party
+ * The party to load the properties for
+ * @return The party with its properties loaded
+ * @throws DatabaseException
+ * if a database error occurs
+ */
+ public Party loadPartyProperties(Party party) throws DatabaseException {
+ return loadProperties(party, "PARTY_PROPERTIES", "PARTY");
+ }
+
+ /**
+ * Loads the properties of the given parties.
+ *
+ * @param parties
+ * The parties to load the properties for
+ * @return The parties with their properties loaded
+ * @throws DatabaseException
+ * if a database error occurs
+ */
+ public List<Party> loadPartyProperties(List<Party> parties) throws DatabaseException {
+ return loadProperties(parties, "PARTY_PROPERTIES", "PARTY");
+ }
+
+ /**
+ * Saves the given party.
+ *
+ * @param party
+ * The party to save
+ * @throws DatabaseException
+ * if a database error occurs
+ */
+ public void saveParty(Party party) throws DatabaseException {
+ Query query = new Query(Type.UPDATE, "PARTIES");
+ query.addValueField(new ValueField("NAME", new StringParameter(party.getName())));
+ query.addWhereClause(new ValueFieldWhereClause(new ValueField("ID", new StringParameter(party.getId()))));
+ database.update(query);
+ savePartyProperties(party);
+ }
+
+ /**
+ * Saves the properties of the given party.
+ *
+ * @param party
+ * The party whose properties to save
+ * @throws DatabaseException
+ * if a database error occurs
+ */
+ public void savePartyProperties(Party party) throws DatabaseException {
+ saveProperties(party.getProperties(), "PARTY_PROPERTIES", "PARTY", party.getId());
+ }
+
+ /**
+ * Creates a new party with the given name.
+ *
+ * @param name
+ * The name of the party
+ * @return The new party
+ * @throws DatabaseException
+ * if a database error occurs
+ */
+ public Party createParty(String name) throws DatabaseException {
+ Query query = new Query(Type.INSERT, "PARTIES");
+ String id = UUID.randomUUID().toString();
+ query.addValueField(new ValueField("ID", new StringParameter(id)));
+ query.addValueField(new ValueField("NAME", new StringParameter(name)));
+ database.insert(query);
+ return getPartyById(id);
+ }
+
+ /**
+ * Returns the user with the given name.
+ *
+ * @param username
+ * The name of the user
+ * @return The user, or {@code null} if the user does not exist
+ * @throws DatabaseException
+ * if a database error occurs
+ */
+ public User getUserByName(String username) throws DatabaseException {
+ Query query = new Query(Type.SELECT, "USERS");
+ query.addField(new Field("USERS.*"));
+ query.addWhereClause(new ValueFieldWhereClause(new ValueField("USERS.NAME", new StringParameter(username))));
+ return database.getSingle(query, userCreator);
+ }
+
+ /**
+ * Returns the user connected with the given OpenID.
+ *
+ * @param openId
+ * The OpenID to find the user for
+ * @return The user connected with the given OpenID, or {@code null} if
+ * there is no such user
+ * @throws DatabaseException
+ * if a database error occurs
+ */
+ public User getUserByOpenId(String openId) throws DatabaseException {
+ Query query = new Query(Type.SELECT, "USERS");
+ query.addField(new Field("USERS.*"));
+ query.addJoin(new Join(JoinType.INNER, "USER_OPENIDS", new Field("USER_OPENIDS.USER"), new Field("USERS.ID")));
+ query.addWhereClause(new ValueFieldWhereClause(new ValueField("USER_OPENIDS.OPENID", new StringParameter(openId))));
+ return database.getSingle(query, userCreator);
+ }
+
+ /**
+ * Returns all OpenIDs connected with the user with the given ID.
+ *
+ * @param userId
+ * The ID of the user
+ * @return All OpenIDs connected with the given user
+ * @throws DatabaseException
+ * if a database error occurs
+ */
+ public Collection<String> getOpenIdsByUser(String userId) throws DatabaseException {
+ Query query = new Query(Type.SELECT, "USER_OPENIDS");
+ query.addField(new Field("USER_OPENIDS.*"));
+ query.addWhereClause(new ValueFieldWhereClause(new ValueField("USER_OPENIDS.USER", new StringParameter(userId))));
+ return database.getMultiple(query, new StringCreator("USER_OPENIDS.OPENID"));
+ }
+
+ //
+ // PRIVATE METHODS
+ //
+
+ /**
+ * Loads the properties for the given object.
+ *
+ * @param <T>
+ * The type of the object
+ * @param object
+ * The object
+ * @param table
+ * The table to load the properties from
+ * @param type
+ * The type of the object (“ARTIST,” “TRACK,” etc.)
+ * @return The object with its properties loaded
+ * @throws DatabaseException
+ * if a database error occurs
+ */
+ private <T extends Base> T loadProperties(final T object, final String table, String type) throws DatabaseException {
+ if (object == null) {
+ return null;
+ }
+ Query query = new Query(Type.SELECT, table);
+ query.addField(new Field(table + ".PROPERTY"));
+ query.addField(new Field(table + ".VALUE"));
+ query.addWhereClause(new ValueFieldWhereClause(new ValueField(type, new StringParameter(object.getId()))));
+ database.process(query, new ResultProcessor() {
+
+ @Override
+ public void processResult(ResultSet resultSet) throws SQLException {
+ if (resultSet.isFirst()) {
+ object.getProperties().removeAll();
+ }
+ object.getProperties().set(resultSet.getString(table + ".PROPERTY"), resultSet.getString(table + ".VALUE"));
+ }
+
+ });
+ return object;
+ }
+
+ /**
+ * Loads the properties for the given objects.
+ *
+ * @param <T>
+ * The type of the object
+ * @param objects
+ * The objects
+ * @param table
+ * The table to load the properties from
+ * @param type
+ * The type of the object (“ARTIST,” “TRACK,” etc.)
+ * @return The object with its properties loaded
+ * @throws DatabaseException
+ * if a database error occurs
+ */
+ private <T extends Base> List<T> loadProperties(List<T> objects, final String table, final String type) throws DatabaseException {
+ final Map<String, T> objectMap = new HashMap<String, T>();
+ final Set<String> firstObjects = new HashSet<String>();
+ for (T object : objects) {
+ objectMap.put(object.getId(), object);
+ firstObjects.add(object.getId());
+ }
+ Query query = new Query(Type.SELECT, table);
+ query.addField(new Field(table + "." + type));
+ query.addField(new Field(table + ".PROPERTY"));
+ query.addField(new Field(table + ".VALUE"));
+ OrWhereClause whereClause = new OrWhereClause();
+ for (T object : objects) {
+ whereClause.add(new ValueFieldWhereClause(new ValueField(type, new StringParameter(object.getId()))));
+ }
+ query.addWhereClause(whereClause);
+ database.process(query, new ResultProcessor() {
+
+ @Override
+ public void processResult(ResultSet resultSet) throws SQLException {
+ String id = resultSet.getString(table + "." + type);
+ T object = objectMap.get(id);
+ if (firstObjects.remove(id)) {
+ object.getProperties().removeAll();
+ }
+ object.getProperties().set(resultSet.getString(table + ".PROPERTY"), resultSet.getString(table + ".VALUE"));
+ }
+
+ });
+ return objects;
+ }
+
+ /**
+ * {@link Artist} implementation that retrieves some attributes (such as
+ * {@link #getGroups()}, and {@link #getTracks()}) from the
+ * {@link DataManager} on demand.
+ *
+ * @author <a href="mailto:bombe@pterodactylus.net">David ‘Bombe’ Roden</a>
+ */
+ private class LazyArtist extends DefaultArtist {
+
+ /** Memoizer for the tracks by this artist. */
+ private final Memoizer<Void> tracksMemoizer = new Memoizer<Void>(new Callable<Void>() {
+
+ @Override
+ public Void call() throws DatabaseException {
+ if (!hasValue("tracks")) {
+ getValue("tracks", Collection.class).set(getTracksByArtist(getId()));
+ }
+ return null;
+ }
+ });
+
+ /** Memoizer for the groups of this artist. */
+ private final Memoizer<Void> groupsMemoizer = new Memoizer<Void>(new Callable<Void>() {
+
+ @Override
+ public Void call() throws Exception {
+ if (!hasValue("groups")) {
+ getValue("groups", Collection.class).set(getGroupsByArtist(getId()));
+ }
+ return null;
+ }
+
+ });
+
+ /**
+ * Creates a new lazy artist.
+ *
+ * @param id
+ * The ID of the artist
+ */
+ public LazyArtist(String id) {
+ super(id);
+ }
+
+ //
+ // DEFAULTARTIST METHODS
+ //
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ public Collection<Group> getGroups() {
+ groupsMemoizer.get();
+ return super.getGroups();
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ public Collection<Track> getTracks() {
+ tracksMemoizer.get();
+ return super.getTracks();
+ }
+