diff --git a/.github/workflows/docker.yml b/.github/workflows/docker.yml index 245767e..39d081b 100644 --- a/.github/workflows/docker.yml +++ b/.github/workflows/docker.yml @@ -18,11 +18,8 @@ jobs: - name: Get version id: get_version run: | - echo "All tags:" - git tag LATEST_TAG=$(git tag | sort -V | tail -n1) echo "latest_tag=${LATEST_TAG}" >> $GITHUB_ENV - echo "Found tag: ${LATEST_TAG}" - name: Set up QEMU uses: docker/setup-qemu-action@v3 diff --git a/pkg/debrid/realdebrid.go b/pkg/debrid/realdebrid.go index 0dab3e4..413dfd1 100644 --- a/pkg/debrid/realdebrid.go +++ b/pkg/debrid/realdebrid.go @@ -10,6 +10,7 @@ import ( gourl "net/url" "os" "path/filepath" + "slices" "strconv" "strings" ) @@ -167,6 +168,7 @@ func (r *RealDebrid) CheckStatus(torrent *Torrent, isSymlink bool) (*Torrent, er var data structs.RealDebridTorrentInfo err = json.Unmarshal(resp, &data) status := data.Status + fmt.Println("RD STATUS: ", status) name := common.RemoveInvalidChars(data.OriginalFilename) torrent.Name = name // Important because some magnet changes the name torrent.Folder = name @@ -179,6 +181,7 @@ func (r *RealDebrid) CheckStatus(torrent *Torrent, isSymlink bool) (*Torrent, er torrent.Links = data.Links torrent.Status = status torrent.Debrid = r + downloading_status := []string{"downloading", "magnet_conversion", "queued", "compressing", "uploading"} if status == "error" || status == "dead" || status == "magnet_error" { return torrent, fmt.Errorf("torrent: %s has error: %s", torrent.Name, status) } else if status == "waiting_files_selection" { @@ -211,7 +214,7 @@ func (r *RealDebrid) CheckStatus(torrent *Torrent, isSymlink bool) (*Torrent, er } } break - } else if status == "downloading" { + } else if slices.Contains(downloading_status, status) { if !r.DownloadUncached { return torrent, fmt.Errorf("torrent: %s not cached", torrent.Name) }