hotfix
This commit is contained in:
@@ -428,10 +428,10 @@ func (c *Cache) setTorrent(t *CachedTorrent) {
|
||||
// keep the one with the most recent added date
|
||||
|
||||
// Save the most recent torrent
|
||||
mergedFiles := mergeFiles(t, o) // Useful for merging files across multiple torrents, while keeping the most recent
|
||||
if o.AddedOn.After(t.AddedOn) {
|
||||
t = o
|
||||
}
|
||||
mergedFiles := mergeFiles(t, o) // Useful for merging files across multiple torrents, while keeping the most recent
|
||||
t.Files = mergedFiles
|
||||
|
||||
}
|
||||
@@ -445,10 +445,10 @@ func (c *Cache) setTorrents(torrents map[string]*CachedTorrent) {
|
||||
c.torrents.Store(t.Id, torrentKey)
|
||||
if o, ok := c.torrentsNames.Load(torrentKey); ok && o.Id != t.Id {
|
||||
// Save the most recent torrent
|
||||
mergedFiles := mergeFiles(t, o) // Useful for merging files across multiple torrents, while keeping the most recent
|
||||
if o.AddedOn.After(t.AddedOn) {
|
||||
t = o
|
||||
}
|
||||
mergedFiles := mergeFiles(t, o)
|
||||
t.Files = mergedFiles
|
||||
}
|
||||
c.torrentsNames.Store(torrentKey, t)
|
||||
|
||||
+2
-1
@@ -109,12 +109,13 @@ func (q *QBit) ProcessFiles(torrent *Torrent, debridTorrent *debrid.Torrent, arr
|
||||
if ok {
|
||||
q.logger.Info().Msgf("Using internal webdav for %s", debridTorrent.Debrid)
|
||||
// Use webdav to download the file
|
||||
timer := time.Now()
|
||||
|
||||
if err := cache.AddTorrent(debridTorrent); err != nil {
|
||||
q.logger.Error().Msgf("Error adding torrent to cache: %v", err)
|
||||
q.MarkAsFailed(torrent)
|
||||
return
|
||||
}
|
||||
timer := time.Now()
|
||||
rclonePath := filepath.Join(debridTorrent.MountPath, cache.GetTorrentFolder(debridTorrent)) // /mnt/remote/realdebrid/MyTVShow
|
||||
torrentFolderNoExt := utils.RemoveExtension(debridTorrent.Name)
|
||||
|
||||
|
||||
@@ -349,7 +349,7 @@ func (h *Handler) ServeHTTP(w http.ResponseWriter, r *http.Request) {
|
||||
Err(err).
|
||||
Str("path", r.URL.Path).
|
||||
Msg("Could not fetch download link")
|
||||
http.Error(w, "Could not fetch download link", http.StatusServiceUnavailable)
|
||||
http.Error(w, "Could not fetch download link", http.StatusPreconditionFailed)
|
||||
return
|
||||
}
|
||||
if link == "" {
|
||||
|
||||
Reference in New Issue
Block a user