Add support for selecting Amazon region in metadata settings
This commit is contained in:
committed by
Aditya Chandel
parent
a181c72a85
commit
25e59323f3
+1
@@ -13,6 +13,7 @@ public class MetadataProviderSettings {
|
||||
public static class Amazon {
|
||||
private boolean enabled;
|
||||
private String cookie;
|
||||
private String domain;
|
||||
}
|
||||
|
||||
@Data
|
||||
|
||||
+1
@@ -65,6 +65,7 @@ public class SettingPersistenceHelper {
|
||||
MetadataProviderSettings.Amazon defaultAmazon = new MetadataProviderSettings.Amazon();
|
||||
defaultAmazon.setEnabled(true);
|
||||
defaultAmazon.setCookie(null);
|
||||
defaultAmazon.setDomain("com");
|
||||
|
||||
MetadataProviderSettings.Google defaultGoogle = new MetadataProviderSettings.Google();
|
||||
defaultGoogle.setEnabled(true);
|
||||
|
||||
+1
-2
@@ -209,8 +209,7 @@ public class AmazonBookParser implements BookParser {
|
||||
}
|
||||
|
||||
String encodedSearchTerm = searchTerm.toString().replace(" ", "+");
|
||||
String url = "https://www.amazon.com/s?k=" + encodedSearchTerm;
|
||||
|
||||
String url = "https://www.amazon." + appSettingService.getAppSettings().getMetadataProviderSettings().getAmazon().getDomain() + "/s?k=" + encodedSearchTerm;
|
||||
log.info("Query URL: {}", url);
|
||||
return url;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user