@Override public void actionPerformed(ActionEvent e) { BTDownload[] downloaders = BTDownloadMediator.instance().getSelectedDownloaders(); List<File> playlistFiles = new ArrayList<File>(downloaders.length); for (BTDownload d : downloaders) { if (!d.isCompleted()) { return; } playlistFiles.add(d.getSaveLocation()); } LibraryUtils.asyncAddToPlaylist(playlist, playlistFiles.toArray(new File[0])); GUIMediator.instance().setWindow(GUIMediator.Tabs.LIBRARY); }
@Override public void actionPerformed(ActionEvent e) { BTDownload[] downloaders = BTDownloadMediator.instance().getSelectedDownloaders(); List<File> playlistFiles = new ArrayList<File>(downloaders.length); for (BTDownload d : downloaders) { if (!d.isCompleted()) { return; } File downloadFolder = new File(d.getSaveLocation(), d.getDisplayName()); if (downloadFolder.exists()) { playlistFiles.add(downloadFolder); } } LibraryUtils.createNewPlaylist(playlistFiles.toArray(new File[0])); }
@Override public void actionPerformed(ActionEvent e) { BTDownload[] downloaders = BTDownloadMediator.instance().getSelectedDownloaders(); if (downloaders != null && downloaders.length > 0) { try { final BTDownload downloader = downloaders[0]; File saveLocation = downloader.getSaveLocation(); if (downloader instanceof BittorrentDownload) { BittorrentDownload btDownload = (BittorrentDownload) downloader; saveLocation = new File(btDownload.getSaveLocation(), btDownload.getName()); } System.out.println("Sending to iTunes " + saveLocation.getAbsolutePath()); iTunesMediator.instance().scanForSongs(saveLocation); } catch (Exception ex) { ex.printStackTrace(); } } }