From 6f57c6e3139fe166fb566334f669b7b9559b857c Mon Sep 17 00:00:00 2001 From: jvoisin Date: Sun, 1 Sep 2019 17:16:49 +0200 Subject: [PATCH] Remove an unused/unuseable/half-done cache --- .../controller/SubsonicRESTController.java | 18 ------------------ 1 file changed, 18 deletions(-) diff --git a/airsonic-main/src/main/java/org/airsonic/player/controller/SubsonicRESTController.java b/airsonic-main/src/main/java/org/airsonic/player/controller/SubsonicRESTController.java index 9e87f4fe..9b7969ec 100644 --- a/airsonic-main/src/main/java/org/airsonic/player/controller/SubsonicRESTController.java +++ b/airsonic-main/src/main/java/org/airsonic/player/controller/SubsonicRESTController.java @@ -33,7 +33,6 @@ import org.airsonic.player.domain.PlayQueue; import org.airsonic.player.i18n.LocaleResolver; import org.airsonic.player.service.*; import org.airsonic.player.service.search.IndexType; -import org.airsonic.player.util.Pair; import org.airsonic.player.util.StringUtil; import org.airsonic.player.util.Util; import org.apache.commons.lang.StringUtils; @@ -56,7 +55,6 @@ import javax.servlet.http.HttpServletRequestWrapper; import javax.servlet.http.HttpServletResponse; import java.util.*; -import java.util.concurrent.ConcurrentHashMap; import static org.airsonic.player.security.RESTRequestParameterProcessingFilter.decrypt; import static org.springframework.web.bind.ServletRequestUtils.*; @@ -139,7 +137,6 @@ public class SubsonicRESTController { @Autowired private LocaleResolver localeResolver; - private final Map bookmarkCache = new ConcurrentHashMap(); private final JAXBWriter jaxbWriter = new JAXBWriter(); private static final String NOT_YET_IMPLEMENTED = "Not yet implemented"; @@ -1276,11 +1273,6 @@ public class SubsonicRESTController { child.setIsVideo(mediaFile.isVideo()); child.setPath(getRelativePath(mediaFile, settingsService)); - org.airsonic.player.domain.Bookmark bookmark = bookmarkCache.get(new BookmarkKey(username, mediaFile.getId())); - if (bookmark != null) { - child.setBookmarkPosition(bookmark.getPositionMillis()); - } - if (mediaFile.getAlbumArtist() != null && mediaFile.getAlbumName() != null) { Album album = albumDao.getAlbum(mediaFile.getAlbumArtist(), mediaFile.getAlbumName()); if (album != null) { @@ -2394,14 +2386,4 @@ public class SubsonicRESTController { return message; } } - - private static class BookmarkKey extends Pair { - private BookmarkKey(String username, int mediaFileId) { - super(username, mediaFileId); - } - - static BookmarkKey forBookmark(org.airsonic.player.domain.Bookmark b) { - return new BookmarkKey(b.getUsername(), b.getMediaFileId()); - } - } }