Remove bad references to Recommender.

master
Nekojimi 9 months ago
parent 571139a59c
commit ab26e65fdb
  1. 32
      src/main/java/moe/nekojimi/chords/Chords.java
  2. 3
      src/main/java/moe/nekojimi/chords/Downloader.java

@ -56,7 +56,7 @@ public final class Chords extends ListenerAdapter
private final Downloader downloader;
private final Searcher searcher;
private final QueueManager queueManager;
private Recommender recommender;
// private Recommender recommender;
private JDA jda;
private final Map<String, Command> commands = new HashMap<>();
@ -356,15 +356,15 @@ public final class Chords extends ListenerAdapter
public void setRecommenderEnabled(boolean enabled)
{
if (recommender == null && enabled)
{
recommender = new Recommender();
downloader.addSource(recommender);
} else if (recommender != null && !enabled)
{
downloader.removeSource(recommender);
recommender = null;
}
// if (recommender == null && enabled)
// {
//// recommender = new Recommender();
// downloader.addSource(recommender);
// } else if (recommender != null && !enabled)
// {
//// downloader.removeSource(recommender);
// recommender = null;
// }
}
public MusicHandler getMusicHandler()
@ -427,10 +427,10 @@ public final class Chords extends ListenerAdapter
return playlists;
}
public Recommender getRecommender()
{
return recommender;
}
// public Recommender getRecommender()
// {
// return recommender;
// }
private class DownloaderMessageHandler implements BiConsumer<TrackRequest, Exception>
{
@ -514,8 +514,8 @@ public final class Chords extends ListenerAdapter
else
jda.getPresence().setActivity(null);
if (recommender != null)
recommender.addSeed(track);
// if (recommender != null)
// recommender.addSeed(track);
}
}

@ -41,6 +41,7 @@ public class Downloader extends QueueThing<TrackRequest, Track>
private static final Pattern FORMAT_PATTERN = Pattern.compile("^([\\w]+)\\s+([\\w]+)\\s+(\\w+ ?\\w*)\\s+(.*)$");
public static final Pattern DESTINATION_PATTERN = Pattern.compile("Destination: (.*\\.wav)");
public static final Pattern PROGRESS_PATTERN = Pattern.compile("\\[download\\].*?([\\d\\.]+)%");
private static final Pattern INFO_JSON_PATTERN = Pattern.compile("Writing video metadata as JSON to: (.*\\.info\\.json)");
private static final Pattern ETA_PATTERN = Pattern.compile("\\[download\\].*?ETA\\s+(\\d{1,2}:\\d{2})");
private static final Pattern DOWNLOAD_ITEM_PATTERN = Pattern.compile("\\[download\\] Downloading item (\\d+) of (\\d+)");
@ -230,7 +231,7 @@ public class Downloader extends QueueThing<TrackRequest, Track>
List<Track> ret = new ArrayList<>();
try
{
String cmd = Chords.getSettings().getYtdlCommand() + " --skip-download --print-json " + request.getUrl().toString();
String cmd = Chords.getSettings().getYtdlCommand() + " --skip-download --write-info-json " + request.getUrl().toString();
Process exec = runCommand(cmd, INFO_TIMEOUT);
InputStream input = exec.getInputStream();

Loading…
Cancel
Save