From 7c1defc68416b2c641efb76ca96b941c5509a86f Mon Sep 17 00:00:00 2001 From: Mukhtar Akere Date: Thu, 22 May 2025 20:03:07 +0100 Subject: [PATCH] Add timer for non-webdav adds --- pkg/qbit/torrent.go | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/pkg/qbit/torrent.go b/pkg/qbit/torrent.go index 6d1bca4..e75855a 100644 --- a/pkg/qbit/torrent.go +++ b/pkg/qbit/torrent.go @@ -110,10 +110,11 @@ func (q *QBit) ProcessFiles(torrent *Torrent, debridTorrent *debridTypes.Torrent // Check if debrid supports webdav by checking cache if isSymlink { + timer := time.Now() cache, useWebdav := svc.Debrid.Caches[debridTorrent.Debrid] if useWebdav { q.logger.Info().Msgf("Using internal webdav for %s", debridTorrent.Debrid) - timer := time.Now() + // Use webdav to download the file if err := cache.AddTorrent(debridTorrent); err != nil { @@ -125,12 +126,12 @@ func (q *QBit) ProcessFiles(torrent *Torrent, debridTorrent *debridTypes.Torrent rclonePath := filepath.Join(debridTorrent.MountPath, cache.GetTorrentFolder(debridTorrent)) // /mnt/remote/realdebrid/MyTVShow torrentFolderNoExt := utils.RemoveExtension(debridTorrent.Name) torrentSymlinkPath, err = q.createSymlinksWebdav(debridTorrent, rclonePath, torrentFolderNoExt) // /mnt/symlinks/{category}/MyTVShow/ - q.logger.Info().Msgf("Adding %s took %s", debridTorrent.Name, time.Since(timer)) } else { // User is using either zurg or debrid webdav torrentSymlinkPath, err = q.ProcessSymlink(torrent) // /mnt/symlinks/{category}/MyTVShow/ } + q.logger.Info().Msgf("Adding %s took %s", debridTorrent.Name, time.Since(timer)) } else { torrentSymlinkPath, err = q.ProcessManualFile(torrent) }