Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix M3U index fetching to base 0 #96

Merged
merged 4 commits into from
Aug 24, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 20 additions & 4 deletions .github/workflows/pr-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,16 +18,32 @@ jobs:
with:
redis-version: "latest"

- name: Login to GitHub Container Registry
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.repository_owner }}
password: ${{ secrets.GHCR_PAT }}

- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
with:
driver-opts: |
image=moby/buildkit:master
network=host

- name: Docker - Build / Push
id: docker_build
- name: Docker - Metadata
id: meta
uses: docker/metadata-action@v5
with:
images: |
ghcr.io/${{ github.repository }}
tags: type=raw,value=pr-${{ github.event.number }}
flavor: latest=false

- name: Docker - Build and Push
uses: docker/build-push-action@v5
with:
push: false
tags: ${{ github.run_id }}
push: true
tags: ${{ steps.meta.outputs.tags }}

2 changes: 0 additions & 2 deletions stream_handler.go
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,6 @@ func proxyStream(m3uIndex int, resp *http.Response, r *http.Request, w http.Resp

bufferMbInt, err := strconv.Atoi(os.Getenv("BUFFER_MB"))
if err != nil || bufferMbInt < 0 {
log.Printf("Invalid BUFFER_MB value: %v. Defaulting to 1KB buffer\n", err)
bufferMbInt = 0
}
buffer := make([]byte, 1024)
Expand Down Expand Up @@ -204,4 +203,3 @@ func streamHandler(w http.ResponseWriter, r *http.Request, db *database.Instance
}
}
}

2 changes: 1 addition & 1 deletion utils/env.go
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ func GetM3UIndexes() []int {
if err != nil {
continue
}
m3uIndexes = append(m3uIndexes, index)
m3uIndexes = append(m3uIndexes, index-1)
}
}
return m3uIndexes
Expand Down