File tree 2 files changed +36
-21
lines changed
2 files changed +36
-21
lines changed Original file line number Diff line number Diff line change @@ -1675,38 +1675,41 @@ void announceTrackerResultsToListener(DownloadTrackerListener l) {
1675
1675
{
1676
1676
String class_name = getTrackingName ( result );
1677
1677
1678
- if ( class_name != null ){
1678
+ String plugin_id ;
1679
+
1680
+ if ( class_name == null ){
1681
+
1682
+ plugin_id = "azbpdhdtracker" ;
1683
+
1684
+ }else {
1685
+
1686
+ if ( class_name .equalsIgnoreCase ( "I2P" )){
1687
+
1688
+ plugin_id = "azneti2phelper" ;
1689
+
1690
+ }else {
1691
+
1692
+ plugin_id = class_name ;
1693
+ }
1694
+ }
1695
+
1696
+ boolean skip_announce = false ;
1697
+
1698
+ if ( plugin_id != null ){
1679
1699
1680
1700
Map all_opts = download_manager .getDownloadState ().getMapAttribute ( DownloadManagerState .AT_PLUGIN_OPTIONS );
1681
1701
1682
1702
if ( all_opts != null ){
1683
1703
1684
- Map opts = (Map )all_opts .get ( class_name .toLowerCase ( Locale .US ));
1704
+ Map opts = (Map )all_opts .get ( plugin_id .toLowerCase ( Locale .US ));
1685
1705
1686
1706
if ( opts != null ){
1687
1707
1688
1708
Number e = (Number )opts .get ( "enableannounce" );
1689
1709
1690
1710
if ( e != null && e .intValue () == 0 ){
1691
1711
1692
- boolean inform = false ;
1693
-
1694
- try {
1695
- peer_listeners_mon .enter ();
1696
-
1697
- inform = announce_response_map .remove ( class_name ) != null ;
1698
-
1699
- }finally {
1700
-
1701
- peer_listeners_mon .exit ();
1702
- }
1703
-
1704
- if ( inform ){
1705
-
1706
- download_manager .informTPSChanged ();
1707
- }
1708
-
1709
- return ;
1712
+ skip_announce = true ;
1710
1713
}
1711
1714
}
1712
1715
}
@@ -1762,7 +1765,10 @@ void announceTrackerResultsToListener(DownloadTrackerListener l) {
1762
1765
}
1763
1766
}
1764
1767
1765
- download_manager .setAnnounceResult ( result );
1768
+ if ( !skip_announce ){
1769
+
1770
+ download_manager .setAnnounceResult ( result );
1771
+ }
1766
1772
1767
1773
if ( new_entry ){
1768
1774
Original file line number Diff line number Diff line change 843
843
throw ( new Exception ( "Plugin id parameter missing" ));
844
844
}
845
845
846
+ if ( plugin_id .equalsIgnoreCase ( "dht" )){
847
+
848
+ plugin_id = "azbpdhdtracker" ;
849
+
850
+ }else if ( plugin_id .equalsIgnoreCase ( "I2P" )){
851
+
852
+ plugin_id = "azneti2phelper" ;
853
+ }
854
+
846
855
PluginInterface pi = plugin_interface .getPluginManager ().getPluginInterfaceByID ( plugin_id );
847
856
848
857
if ( pi == null ){
You can’t perform that action at this time.
0 commit comments