Make sure not to annoy users have purchased FileBot

This commit is contained in:
Reinhard Pointner 2017-03-11 03:37:46 +08:00
parent cbde057f7b
commit 3ef7cc141e
1 changed files with 25 additions and 10 deletions

View File

@ -46,6 +46,16 @@ public enum SupportDialog {
return "Please Donate";
}
@Override
public boolean feelingLucky(int sessionRenameCount, int totalRenameCount, int currentRevision, int lastSupportRevision, int supportRevisionCount) {
// annoy users that chose not to purchase FileBot
if (this == Donation && sessionRenameCount > 0 && "Windows 10".equals(System.getProperty("os.name"))) {
return true;
}
return super.feelingLucky(sessionRenameCount, totalRenameCount, currentRevision, lastSupportRevision, supportRevisionCount);
}
@Override
String getURI() {
return getDonateURL();
@ -78,6 +88,21 @@ public enum SupportDialog {
return "Please write a Review";
}
@Override
public boolean feelingLucky(int sessionRenameCount, int totalRenameCount, int currentRevision, int lastSupportRevision, int supportRevisionCount) {
// ask for reviews at most once per revision
if (currentRevision <= lastSupportRevision) {
return false;
}
// ask for reviews only when a significant number of files have been processed
if (sessionRenameCount < 3 || totalRenameCount < 3000) {
return false;
}
return super.feelingLucky(sessionRenameCount, totalRenameCount, currentRevision, lastSupportRevision, supportRevisionCount);
}
@Override
String getURI() {
return getAppStoreLink();
@ -86,16 +111,6 @@ public enum SupportDialog {
};
public boolean feelingLucky(int sessionRenameCount, int totalRenameCount, int currentRevision, int lastSupportRevision, int supportRevisionCount) {
// ask for reviews at most once per revision
if (isAppStore() && currentRevision <= lastSupportRevision) {
return false;
}
// ask for reviews only when a significant number of files have been processed
if (isAppStore() && (sessionRenameCount < 5 || totalRenameCount < 5000)) {
return false;
}
// ask for reviews at most every once in a while
if (Math.random() <= 0.777) {
return false;