public String getChangeUser() { this.changeUser = super.getString("CHANGE_USER"); return changeUser; }
public String getChangeSummary() { this.changeSummary = super.getString("CHANGE_SUMMARY"); return changeSummary; }
public String getChangeIp() { this.changeIp = super.getString("CHANGE_IP"); return changeIp; }
public static List<Library> getCachedTracks() { String cacheDir = SETTINGS.findFirst("id = ?", 1).getString("storage_path"); log.info("cache dir = " + cacheDir); // remove the tracks that aren't in the cache directory from the list List<Library> tracks = LIBRARY.findAll(); List<Library> cachedTracks = new ArrayList<>(); for (int i = 0; i < tracks.size(); i++) { Library song = tracks.get(i); File filePath = new File(song.getString("file_path")); String parent = filePath.getParentFile().getAbsolutePath(); // IE, if this is in the cache dir, this gets added if (parent.equals(cacheDir)) { cachedTracks.add(song); } } return cachedTracks; }
public static String removeSong(Library song) { String cacheDir = SETTINGS.findFirst("id = ?", 1).getString("storage_path"); return removeSong(song, cacheDir); }
public static String clearCache() { List<Library> cachedTracks = getCachedTracks(); String cacheDir = SETTINGS.findFirst("id = ?", 1).getString("storage_path"); for (Library song : cachedTracks) { log.info("Song removed from cache: " + song.getString("file_path")); removeSong(song, cacheDir); } String msg = "Songs removed from cache: " + cachedTracks.size(); log.info(msg); return msg; }
public static String removeArtist(String artistMBID) { List<Library> songs = LIBRARY.find("artist_mbid = ?", artistMBID); String cacheDir = SETTINGS.findFirst("id = ?", 1).getString("storage_path"); for (Library song : songs) { removeSong(song, cacheDir); } return "Artist : " + artistMBID + " deleted from library"; }