From 4b7e393ce9ab125313937362ad5c5630ebc613e2 Mon Sep 17 00:00:00 2001 From: TMD20 <109320934+TMD20@users.noreply.github.com> Date: Mon, 14 Nov 2022 12:18:08 -0600 Subject: [PATCH] fix(actions): watch dir check torrent suffix (#540) Update run.go Make conditional for generating random torrent name more specific --- internal/action/run.go | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/internal/action/run.go b/internal/action/run.go index 36fe50a..e147c7e 100644 --- a/internal/action/run.go +++ b/internal/action/run.go @@ -91,6 +91,7 @@ func (s *service) RunAction(action *domain.Action, release domain.Release) ([]st Filter: release.Filter.Name, Indexer: release.Indexer, InfoHash: release.TorrentHash, + Size: release.Size, Status: domain.ReleasePushStatusApproved, Action: action.Name, @@ -177,7 +178,7 @@ func (s *service) watchFolder(action domain.Action, release domain.Release) erro newFileName := watchFolderArgs // if watchFolderArgs does not contain .torrent, create - if !strings.Contains(watchFolderArgs, ".torrent") { + if !strings.HasSuffix(watchFolderArgs, ".torrent") { _, tmpFileName := filepath.Split(release.TorrentTmpFile) newFileName = filepath.Join(watchFolderArgs, tmpFileName+".torrent")