forked from j62/ctbrec
Make sure, that the model ID is set
This commit is contained in:
parent
8a8327a2a5
commit
eedb237923
|
@ -193,13 +193,7 @@ public class Streamate extends AbstractSite {
|
|||
Matcher m = Pattern.compile("https?://.*?streamate.com/cam/([^/]*?)/?").matcher(url);
|
||||
if (m.matches()) {
|
||||
String modelName = m.group(1);
|
||||
StreamateModel model = (StreamateModel) createModel(modelName);
|
||||
try {
|
||||
model.loadModelInfo();
|
||||
} catch (IOException e) {
|
||||
LOG.error("Couldn't load model info. This can cause problems with saving / loading the model");
|
||||
}
|
||||
return model;
|
||||
return createModel(modelName);
|
||||
} else {
|
||||
return super.createModelFromUrl(url);
|
||||
}
|
||||
|
|
|
@ -330,6 +330,13 @@ public class StreamateModel extends AbstractModel {
|
|||
|
||||
@Override
|
||||
public void writeSiteSpecificData(JsonWriter writer) throws IOException {
|
||||
if(id == null) {
|
||||
try {
|
||||
loadModelInfo();
|
||||
} catch (IOException e) {
|
||||
LOG.error("Couldn't load model ID for {}. This can cause problems with saving / loading the model", getName());
|
||||
}
|
||||
}
|
||||
writer.name("id").value(id);
|
||||
}
|
||||
}
|
Loading…
Reference in New Issue