forked from j62/ctbrec
1
0
Fork 0

Ignore models for disabled sites in LocalRecorder

This commit is contained in:
0xboobface 2018-10-26 14:16:17 +02:00
parent 5cd8ae3cff
commit 4e0fb6aaf0
5 changed files with 21 additions and 1 deletions

View File

@ -34,4 +34,5 @@ public interface Model {
public boolean follow() throws IOException; public boolean follow() throws IOException;
public boolean unfollow() throws IOException; public boolean unfollow() throws IOException;
public void setSite(Site site); public void setSite(Site site);
public Site getSite();
} }

View File

@ -55,7 +55,11 @@ public class LocalRecorder implements Recorder {
public LocalRecorder(Config config) { public LocalRecorder(Config config) {
this.config = config; this.config = config;
config.getSettings().models.stream().forEach((m) -> { config.getSettings().models.stream().forEach((m) -> {
models.add(m); if(m.getSite().isEnabled()) {
models.add(m);
} else {
LOG.info("{} disabled -> ignoring {}", m.getSite().getName(), m.getName());
}
}); });
recording = true; recording = true;

View File

@ -180,4 +180,9 @@ public class ChaturbateModel extends AbstractModel {
throw new IllegalArgumentException("Site has to be an instance of Chaturbate"); throw new IllegalArgumentException("Site has to be an instance of Chaturbate");
} }
} }
@Override
public Site getSite() {
return site;
}
} }

View File

@ -303,4 +303,9 @@ public class MyFreeCamsModel extends AbstractModel {
throw new IllegalArgumentException("Site has to be an instance of MyFreeCams"); throw new IllegalArgumentException("Site has to be an instance of MyFreeCams");
} }
} }
@Override
public Site getSite() {
return site;
}
} }

View File

@ -142,4 +142,9 @@ public class JavaFxModel extends AbstractModel {
public void setSite(Site site) { public void setSite(Site site) {
delegate.setSite(site); delegate.setSite(site);
} }
@Override
public Site getSite() {
return delegate.getSite();
}
} }