Skip to content

Commit 2fa13bc

Browse files
[Issue GerryFerdinandus#24] WebTorrent do not have '/announce'
This issue is introduce in 1.33.beta 5fcc46b
1 parent dd5953b commit 2fa13bc

File tree

1 file changed

+25
-11
lines changed

1 file changed

+25
-11
lines changed

source/code/main.pas

Lines changed: 25 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -344,7 +344,7 @@ procedure TFormTrackerModify.MenuItemOnlineCheckSubmitNewTrackonClick(Sender: TO
344344
if SendStatus then
345345
begin
346346
//Succesful upload
347-
PopupStr := format('Successful upload of %d unique tracker URL',[TrackerSendCount]);
347+
PopupStr := format('Successful upload of %d unique tracker URL', [TrackerSendCount]);
348348
Application.MessageBox(
349349
PChar(@PopupStr[1]),
350350
'', MB_ICONINFORMATION + MB_OK);
@@ -409,7 +409,15 @@ procedure TFormTrackerModify.MenuItemOnlineCheckDownloadNewTrackonClick(
409409
function TFormTrackerModify.TrackerWithURLAndAnnounce(
410410
const TrackerURL: UTF8String): boolean;
411411
begin
412-
Result := ValidTrackerURL(TrackerURL) and TrackerURLWithAnnounce(TrackerURL);
412+
Result := ValidTrackerURL(TrackerURL);
413+
if Result then
414+
begin
415+
//Web Torrent does not have 'announce'
416+
if not WebTorrentTrackerURL(TrackerURL) then
417+
begin
418+
Result := TrackerURLWithAnnounce(TrackerURL);
419+
end;
420+
end;
413421
end;
414422

415423
procedure TFormTrackerModify.MenuTrackersDeleteTrackersWithStatusClick(
@@ -1047,24 +1055,30 @@ function TFormTrackerModify.CopyUserInputNewTrackersToList: boolean;
10471055
if TrackerStr = '' then
10481056
continue;
10491057

1050-
//All the tracker must end with '/announce'
1051-
Result := TrackerURLWithAnnounce(TrackerStr);
1052-
if not Result then
1058+
Result := ValidTrackerURL(TrackerStr);
1059+
if Result then
10531060
begin
1054-
ErrorStr := 'ERROR: Tracker URL must end with /announce';
1055-
//do not continue the for loop
1056-
break;
1061+
//Web Torrent does not have 'announce'
1062+
if not WebTorrentTrackerURL(TrackerStr) then
1063+
begin
1064+
Result := TrackerURLWithAnnounce(TrackerStr);
1065+
if not Result then
1066+
begin
1067+
ErrorStr := 'ERROR: Tracker URL must end with /announce';
1068+
end;
1069+
end;
1070+
end
1071+
else
1072+
begin
1073+
ErrorStr := 'ERROR: Tracker URL must begin with http:// or udp://';
10571074
end;
10581075

1059-
//All the tracker must begin with 'http(s)://' or 'udp://'
1060-
Result := ValidTrackerURL(TrackerStr);
10611076
if Result then
10621077
begin
10631078
AddButIngnoreDuplicates(FTrackerList.TrackerAddedByUserList, TrackerStr);
10641079
end
10651080
else
10661081
begin
1067-
ErrorStr := 'ERROR: Tracker URL must begin with http:// or udp://';
10681082
//do not continue the for loop
10691083
break;
10701084
end;

0 commit comments

Comments
 (0)