forked from j62/ctbrec
Ignore models for disabled sites in LocalRecorder
This commit is contained in:
parent
5cd8ae3cff
commit
4e0fb6aaf0
|
@ -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();
|
||||||
}
|
}
|
|
@ -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;
|
||||||
|
|
|
@ -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;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -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;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -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();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue