@@ -13,7 +13,6 @@ import {
1313 IUpdateActionBadgeTextMessage ,
1414 TestNotificationMessage
1515} from "../models/messages" ;
16- import { RTASettings } from "../models/settings" ;
1716import { SerializedTorrent , Torrent , TorrentUploadConfig } from "../models/torrent" ;
1817import { TorrentAddingResult , TorrentWebUI , WebUISettings } from "../models/webui" ;
1918import { updateBadgeText } from "./action" ;
@@ -22,6 +21,7 @@ import { downloadTorrent } from "./download";
2221import { showNotification } from "./notifications" ;
2322import { serializeSettings , convertTorrentToSerialized , convertSerializedToTorrent , deserializeSettings } from "./serializer" ;
2423import { Settings } from "./settings" ;
24+ import { addTrailingSlash } from "./utils" ;
2525import { initiateWebUis } from "./webuis" ;
2626
2727
@@ -212,7 +212,7 @@ function downloadAndAddTorrentToWebUi(webUi: TorrentWebUI, url: string, config:
212212 true ,
213213 settings . notificationsDurationMs ,
214214 settings . notificationsSoundEnabled ,
215- webUi . createBaseUrl ( ) ) ;
215+ addTrailingSlash ( webUi . createBaseUrl ( ) ) ) ;
216216 } ) ;
217217 } else {
218218 console . error ( "No WebUI found for addTorrentMessage:" , message ) ;
@@ -221,7 +221,7 @@ function downloadAndAddTorrentToWebUi(webUi: TorrentWebUI, url: string, config:
221221 true ,
222222 settings . notificationsDurationMs ,
223223 settings . notificationsSoundEnabled ,
224- webUi . createBaseUrl ( ) ) ;
224+ addTrailingSlash ( webUi . createBaseUrl ( ) ) ) ;
225225 }
226226 } ) ;
227227}
@@ -259,7 +259,7 @@ function getAutoLabelDirResultForConfig(torrent: Torrent, webUiSettings: WebUISe
259259
260260function sendTorrentToWebUi ( webUi : TorrentWebUI , torrent : Torrent , config : TorrentUploadConfig | null ) {
261261 new Settings ( ) . loadSettings ( ) . then ( settings => {
262- const webUiUrl = webUi . createBaseUrl ( ) ;
262+ const webUiUrl = addTrailingSlash ( webUi . createBaseUrl ( ) ) ;
263263 webUi . sendTorrent ( torrent , config ) . then ( ( torrentAddingResult : TorrentAddingResult ) => {
264264 console . log ( `Torrent sent successfully: ${ torrent . name } to -> ${ webUi . name } ` ) ;
265265 if ( settings . notificationsEnabled ) {
0 commit comments