@@ -68,6 +68,11 @@ public boolean isTrafficRefill() {
6868 return account_trafficRefill ;
6969 }
7070
71+ /**
72+ * Set this to true if we expect this account to automatically get fresh traffic every X time (typically every day). </br>
73+ * Set this to false if no auto refill is expected e.g. account contains static amount of bought traffic so once used up, the account
74+ * stays empty.
75+ */
7176 public void setTrafficRefill (boolean account_trafficRefill ) {
7277 this .account_trafficRefill = account_trafficRefill ;
7378 }
@@ -499,9 +504,9 @@ public List<String> setMultiHostSupportV2(final PluginForHost multiHostPlugin, f
499504 plugins .add (hit );
500505 }
501506 }
502- final List <String > finalresults = new ArrayList <String >();
507+ final List <String > finalresults_old = new ArrayList <String >();
503508 /* TODO: Return this once refactoring is done. */
504- final List <MultiHostHost > finalresults2 = new ArrayList <MultiHostHost >();
509+ final List <MultiHostHost > finalresults_new = new ArrayList <MultiHostHost >();
505510 final HashSet <String > unassignedMultiHostSupport = new HashSet <String >();
506511 cleanListLoop : for (final Entry <String , MultiHostHost > entry : cleanList .entrySet ()) {
507512 final String maindomainCleaned = entry .getKey ();
@@ -510,14 +515,14 @@ public List<String> setMultiHostSupportV2(final PluginForHost multiHostPlugin, f
510515 if (plugins == null ) {
511516 mhost .setStatus (MultihosterHostStatus .DEACTIVATED_JDOWNLOADER_UNSUPPORTED );
512517 unassignedMultiHostSupport .add (maindomainCleaned );
513- finalresults2 .add (mhost );
518+ finalresults_new .add (mhost );
514519 continue cleanListLoop ;
515520 }
516521 /* Remove dupes based on the results we already have */
517522 final Iterator <LazyHostPlugin > iterator = plugins .iterator ();
518523 do {
519524 final LazyHostPlugin plugin = iterator .next ();
520- if (finalresults .contains (plugin .getHost ())) {
525+ if (finalresults_old .contains (plugin .getHost ())) {
521526 plugins .remove (plugin );
522527 }
523528 } while (iterator .hasNext ());
@@ -576,22 +581,22 @@ public List<String> setMultiHostSupportV2(final PluginForHost multiHostPlugin, f
576581 if (printNonWorkingHosts && !hostIsWorkingAccordingToMultihost ) {
577582 logger .info ("Non working host: " + mhost );
578583 }
579- if (!DebugMode .TRUE_IN_IDE_ELSE_FALSE && !hostIsWorkingAccordingToMultihost ) {
580- // TODO: Remove this check
581- logger .info ("Skipping non working host in stable: " + mhost .getName ());
582- continue cleanListLoop ;
583- }
584584 final String pluginHost = finalplugin .getHost ();
585585 if (multiHostPlugin != null && pluginHost .equals (multiHostPlugin .getHost ())) {
586586 /*
587- * Some mmultihosts put their own domain in the list of supported hosts. However, this is nowhere needed so let's not add it
587+ * Some multihosts put their own domain in the list of supported hosts. However, this is nowhere needed so let's not add it
588588 * to the final list.
589589 */
590590 continue cleanListLoop ;
591- } else if (finalresults .contains (pluginHost )) {
591+ } else if (finalresults_old .contains (pluginHost )) {
592592 continue cleanListLoop ;
593593 }
594- finalresults .add (pluginHost );
594+ if (!DebugMode .TRUE_IN_IDE_ELSE_FALSE && !hostIsWorkingAccordingToMultihost ) {
595+ // TODO: Remove this check
596+ logger .info ("Skipping non working host in stable: " + mhost .getName ());
597+ } else {
598+ finalresults_old .add (pluginHost );
599+ }
595600 final String [] siteSupportedNames = finalplugin .getSitesSupported ();
596601 if (siteSupportedNames != null && siteSupportedNames .length > 0 ) {
597602 /* Add all domains we know to list of supported domains. */
@@ -603,7 +608,7 @@ public List<String> setMultiHostSupportV2(final PluginForHost multiHostPlugin, f
603608 /* Set plugin domain as first domain */
604609 mhost .getDomains ().remove (pluginHost );
605610 mhost .getDomains ().add (0 , pluginHost );
606- finalresults2 .add (mhost );
611+ finalresults_new .add (mhost );
607612 }
608613 /**
609614 * Remove all "double" entries from remaining list of unmatched entries to avoid wrong log output. </br>
@@ -647,7 +652,7 @@ public List<String> setMultiHostSupportV2(final PluginForHost multiHostPlugin, f
647652 }
648653 }
649654 }
650- if (finalresults .isEmpty ()) {
655+ if (finalresults_old .isEmpty ()) {
651656 if (logger != null ) {
652657 logger .info ("Failed to find ANY usable results" );
653658 }
@@ -657,24 +662,24 @@ public List<String> setMultiHostSupportV2(final PluginForHost multiHostPlugin, f
657662 /* Log final results if wanted. */
658663 final boolean logValidResults = false ;
659664 if (logger != null && logValidResults ) {
660- logger .info ("Found real hosts: " + finalresults .size ());
661- for (final String host : finalresults ) {
665+ logger .info ("Found real hosts: " + finalresults_old .size ());
666+ for (final String host : finalresults_old ) {
662667 logger .finest ("Found host: " + host );
663668 }
664669 }
665670 /* sorting will now work properly since they are all pre-corrected to lowercase. */
666- Collections .sort (finalresults , new NaturalOrderComparator ());
667- this .setProperty (PROPERTY_MULTIHOST_SUPPORT , new CopyOnWriteArrayList <String >(finalresults ));
671+ Collections .sort (finalresults_old , new NaturalOrderComparator ());
672+ this .setProperty (PROPERTY_MULTIHOST_SUPPORT , new CopyOnWriteArrayList <String >(finalresults_old ));
668673 if (DebugMode .TRUE_IN_IDE_ELSE_FALSE ) {
669- Collections .sort (finalresults2 , new Comparator <MultiHostHost >() {
674+ Collections .sort (finalresults_new , new Comparator <MultiHostHost >() {
670675 @ Override
671676 public int compare (MultiHostHost o1 , MultiHostHost o2 ) {
672677 return o1 .getDomain ().compareToIgnoreCase (o2 .getDomain ());
673678 }
674679 });
675- multihostSupportV2 = new CopyOnWriteArrayList <MultiHostHost >(finalresults2 );
680+ multihostSupportV2 = new CopyOnWriteArrayList <MultiHostHost >(finalresults_new );
676681 }
677- return finalresults ;
682+ return finalresults_old ;
678683 }
679684
680685 protected List <MultiHostHost > multihostSupportV2 = null ;
0 commit comments