@Override public void onFileShared(FileSharedEvent fileSharedEvent) { log.debug("Received FileSharedEvent with allLink " + fileSharedEvent.getAllLink()); // this implementations only works for phex sharer events, change to // adapt to new share implementations AllLink updatedAllLink = fileSharedEvent.getAllLink(); String downloadId = updatedAllLink.getHashCode(); musicEntityService.updateDownloadString(downloadId, updatedAllLink.toString()); }
private void shareTracks(List<Track> tracks) { log.info("Files to be shared: " + tracks.size()); for (Track track : tracks) { if (interrupted.get()) { log.info("Interrupted while making share"); return; } if (musicEntityService.isFileAvailable(track)) { share(track); } } }
private void share() { shareTracks(musicEntityService.getAllTracks()); }