Add Search on NR Tool
This commit is contained in:
parent
a973306869
commit
42b4b00c88
|
@ -112,6 +112,7 @@ public class ModelMenuContributor {
|
||||||
addNotes(menu, selectedModels);
|
addNotes(menu, selectedModels);
|
||||||
addPortrait(menu, selectedModels);
|
addPortrait(menu, selectedModels);
|
||||||
addOpenOnCamGirlFinder(menu, selectedModels);
|
addOpenOnCamGirlFinder(menu, selectedModels);
|
||||||
|
addOpenOnNrToolFinder(menu, selectedModels);
|
||||||
}
|
}
|
||||||
|
|
||||||
public ModelMenuContributor afterwards(Runnable callback) {
|
public ModelMenuContributor afterwards(Runnable callback) {
|
||||||
|
@ -153,8 +154,6 @@ public class ModelMenuContributor {
|
||||||
menu.getItems().add(openInBrowser);
|
menu.getItems().add(openInBrowser);
|
||||||
}
|
}
|
||||||
|
|
||||||
// CB (old): https://roomimg.stream.highwebmedia.com/ri/emiilycampbell.jpg?1745301588
|
|
||||||
// CB (new): https://thumb.live.mmcdn.com/ri/emiilycampbell.jpg
|
|
||||||
private void addOpenOnCamGirlFinder(ContextMenu menu, List<Model> selectedModels) {
|
private void addOpenOnCamGirlFinder(ContextMenu menu, List<Model> selectedModels) {
|
||||||
var openOnCamGirlFinder = new MenuItem("Search on CamGirlFinder");
|
var openOnCamGirlFinder = new MenuItem("Search on CamGirlFinder");
|
||||||
openOnCamGirlFinder.setOnAction(e -> {
|
openOnCamGirlFinder.setOnAction(e -> {
|
||||||
|
@ -172,6 +171,27 @@ public class ModelMenuContributor {
|
||||||
menu.getItems().add(openOnCamGirlFinder);
|
menu.getItems().add(openOnCamGirlFinder);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@SuppressWarnings("unused") // Remove when NR Tool accepts image URL and below is updated
|
||||||
|
private void addOpenOnNrToolFinder(ContextMenu menu, List<Model> selectedModels) {
|
||||||
|
var openOnNrToolFinder = new MenuItem("Search on NRTool");
|
||||||
|
openOnNrToolFinder.setOnAction(e -> {
|
||||||
|
for (Model model : selectedModels) {
|
||||||
|
String preview = model.getPreview();
|
||||||
|
// Remove following line whenever NR Tool can accept image URLs
|
||||||
|
preview = null;
|
||||||
|
if (preview != null && !preview.isEmpty()) {
|
||||||
|
String query = URLEncoder.encode(preview, UTF_8);
|
||||||
|
// Adjust whenever URL API implemented
|
||||||
|
DesktopIntegration.open("https://nrtool.to/nrtool/search?s=" + query);
|
||||||
|
} else {
|
||||||
|
String query = URLEncoder.encode(model.getName(), UTF_8);
|
||||||
|
DesktopIntegration.open("https://nrtool.to/nrtool/search?s=" + query);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
});
|
||||||
|
menu.getItems().add(openOnNrToolFinder);
|
||||||
|
}
|
||||||
|
|
||||||
private void addCopyUrl(ContextMenu menu, List<Model> selectedModels) {
|
private void addCopyUrl(ContextMenu menu, List<Model> selectedModels) {
|
||||||
if (selectedModels == null || selectedModels.isEmpty()) {
|
if (selectedModels == null || selectedModels.isEmpty()) {
|
||||||
return;
|
return;
|
||||||
|
|
Loading…
Reference in New Issue