diff --git a/.gitea/workflows/ci.yml b/.gitea/workflows/ci.yml new file mode 100644 index 0000000..e960200 --- /dev/null +++ b/.gitea/workflows/ci.yml @@ -0,0 +1,55 @@ +name: CI/CD + +on: + push: + branches: [master, main] + pull_request: + branches: [master, main] + workflow_dispatch: + +permissions: + contents: read + actions: write + +jobs: + build-and-push: + name: Build & Push Docker Image + runs-on: ubuntu-latest + if: github.ref == 'refs/heads/main' && github.event_name == 'push' + outputs: + image_tag: ${{ steps.meta.outputs.tag }} + steps: + - name: Checkout code + uses: actions/checkout@v4 + + - name: Set up QEMU + uses: docker/setup-qemu-action@v3 + + - name: Set up Docker Buildx + uses: docker/setup-buildx-action@v3 + + - name: Generate image metadata + id: meta + run: | + SHORT_SHA=$(echo "${{ github.sha }}" | cut -c1-7) + echo "tag=${SHORT_SHA}" >> $GITHUB_OUTPUT + echo "Image will be tagged: ${SHORT_SHA}" + + - name: Login to registry + run: | + echo "${{ secrets.REGISTRY_PASSWORD }}" | docker login registry.johnogle.info -u ${{ secrets.REGISTRY_USERNAME }} --password-stdin + + - name: Build and push Docker image + uses: docker/build-push-action@v5 + with: + context: . + platforms: linux/amd64,linux/arm64 + push: true + tags: | + registry.johnogle.info/johno/decypharr:${{ steps.meta.outputs.tag }} + registry.johnogle.info/johno/decypharr:latest + cache-from: type=gha + cache-to: type=gha,mode=max + build-args: | + VERSION=${{ steps.meta.outputs.tag }} + CHANNEL=dev diff --git a/.gitignore b/.gitignore index d8f61a3..83dd261 100644 --- a/.gitignore +++ b/.gitignore @@ -19,4 +19,11 @@ auth.json node_modules/ .venv/ .stignore -.stfolder/** \ No newline at end of file +.stfolder/** + +# Gas Town (added by gt) +.runtime/ +.claude/ +.logs/ +.beads/ +state.json diff --git a/pkg/wire/torrent.go b/pkg/wire/torrent.go index 8e169bb..cfd887b 100644 --- a/pkg/wire/torrent.go +++ b/pkg/wire/torrent.go @@ -270,6 +270,12 @@ func (s *Store) partialTorrentUpdate(t *Torrent, debridTorrent *types.Torrent) * if math.IsNaN(progress) || math.IsInf(progress, 0) { progress = 0 } + // When debrid reports download complete, force progress to 100% to ensure + // IsReady() returns true. This fixes a race condition where TorBox can report + // DownloadFinished=true but Progress < 1.0, causing state to stay "downloading". + if debridTorrent.Status == "downloaded" { + progress = 1.0 + } sizeCompleted := int64(float64(totalSize) * progress) var speed int64