@Override public void actionPerformed(ActionEvent e) { File file = BTDownloadMediator.instance().getSelectedDownloaders()[0].getSaveLocation(); if (file.isDirectory() && LibraryUtils.directoryContainsASinglePlayableFile(file, 4)) { try { file = file.listFiles()[0]; } catch (Throwable t) { file = null; } } if (file != null && MediaPlayer.isPlayableFile(file)) { MediaPlayer.instance().loadMedia(new MediaSource(file), true, false, false); } }
@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])); }