Skip to content

Commit

Permalink
unify nickname and id
Browse files Browse the repository at this point in the history
  • Loading branch information
carlosuc3m committed Nov 12, 2024
1 parent 7070a45 commit e07324a
Showing 1 changed file with 3 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -424,13 +424,14 @@ public ModelDescriptor selectByID(String modelID) {
Entry<String, ModelDescriptor> modelEntry = this.listAllModels(false).entrySet().stream()
.filter(ee -> {
String id = ee.getValue().getModelID();
String nickname = ee.getValue().getNickname();
if (id.length() - id.replace("/", "").length() == 2) {
id = id.substring(0, id.lastIndexOf("/"));
}
if (modelID.length() - modelID.replace("/", "").length() == 2) {
return modelID.substring(0, modelID.lastIndexOf("/")).equals(id);
return modelID.substring(0, modelID.lastIndexOf("/")).equals(id) || modelID.equals(nickname);
}
return modelID.equals(id);
return modelID.equals(id) || modelID.equals(nickname);
}).findFirst().orElse(null);
if (modelEntry != null)
return modelEntry.getValue();
Expand Down

0 comments on commit e07324a

Please sign in to comment.