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);
|
Matcher m = Pattern.compile("https?://.*?streamate.com/cam/([^/]*?)/?").matcher(url);
|
||||||
if (m.matches()) {
|
if (m.matches()) {
|
||||||
String modelName = m.group(1);
|
String modelName = m.group(1);
|
||||||
StreamateModel model = (StreamateModel) createModel(modelName);
|
return 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;
|
|
||||||
} else {
|
} else {
|
||||||
return super.createModelFromUrl(url);
|
return super.createModelFromUrl(url);
|
||||||
}
|
}
|
||||||
|
|
|
@ -330,6 +330,13 @@ public class StreamateModel extends AbstractModel {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void writeSiteSpecificData(JsonWriter writer) throws IOException {
|
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);
|
writer.name("id").value(id);
|
||||||
}
|
}
|
||||||
}
|
}
|
Loading…
Reference in New Issue