diff --git a/.github/workflows/build_docker_images.yml b/.github/workflows/build_docker_images.yml index 62ffa26..8bbb573 100644 --- a/.github/workflows/build_docker_images.yml +++ b/.github/workflows/build_docker_images.yml @@ -25,12 +25,12 @@ jobs: steps: # Get the repository's code - name: Checkout - uses: actions/checkout@v3 + uses: actions/checkout@v4 # Generate docker tags - name: Docker meta id: meta - uses: docker/metadata-action@v4 + uses: docker/metadata-action@v5 with: images: ghcr.io/dmunozv04/isponsorblocktv, dmunozv04/isponsorblocktv tags: | @@ -42,36 +42,35 @@ jobs: # https://github.com/docker/setup-qemu-action - name: Set up QEMU - uses: docker/setup-qemu-action@v2 + uses: docker/setup-qemu-action@v3 # https://github.com/docker/setup-buildx-action - name: Set up Docker Buildx id: buildx - uses: docker/setup-buildx-action@v2 + uses: docker/setup-buildx-action@v3 - name: Login to DockerHub - # if: github.event_name != 'pull_request' - uses: docker/login-action@v2 + if: github.event_name != 'pull_request' + uses: docker/login-action@v3 with: username: ${{ secrets.DOCKERHUB_USERNAME }} password: ${{ secrets.DOCKERHUB_TOKEN }} - name: Login to GHCR - # if: github.event_name != 'pull_request' - uses: docker/login-action@v2 + if: github.event_name != 'pull_request' + uses: docker/login-action@v3 with: registry: ghcr.io username: ${{ github.repository_owner }} password: ${{ secrets.GITHUB_TOKEN }} - name: Build and push - uses: docker/build-push-action@v4 + uses: docker/build-push-action@v5 with: context: . platforms: linux/amd64, linux/arm64, linux/arm/v7 - # push: ${{ github.event_name != 'pull_request' }} + push: ${{ github.event_name != 'pull_request' }} tags: ${{ steps.meta.outputs.tags }} labels: ${{ steps.meta.outputs.labels }} cache-from: type=registry,ref=ghcr.io/dmunozv04/isponsorblocktv:buildcache # Only cache if it's not a pull request - # cache-to: ${{ github.event_name != 'pull_request' && 'type=registry,ref=ghcr.io/dmunozv04/isponsorblocktv:buildcache,mode=max' || '' }} - cache-to: type=registry,ref=ghcr.io/dmunozv04/isponsorblocktv:buildcache,mode=max \ No newline at end of file + cache-to: ${{ github.event_name != 'pull_request' && 'type=registry,ref=ghcr.io/dmunozv04/isponsorblocktv:buildcache,mode=max' || '' }} diff --git a/.github/workflows/release_pypi.yml b/.github/workflows/release_pypi.yml index 43c9298..180d5b9 100644 --- a/.github/workflows/release_pypi.yml +++ b/.github/workflows/release_pypi.yml @@ -22,9 +22,9 @@ jobs: steps: - name: Checkout - uses: actions/checkout@v3 + uses: actions/checkout@v4 - name: Set up Python - uses: actions/setup-python@v3 + uses: actions/setup-python@v5 with: python-version: '3.11' - name: Install dependencies diff --git a/.github/workflows/update_docker_readme.yml b/.github/workflows/update_docker_readme.yml index ccf6c37..12a3e62 100644 --- a/.github/workflows/update_docker_readme.yml +++ b/.github/workflows/update_docker_readme.yml @@ -22,7 +22,7 @@ jobs: # Update description - name: Update repo description - uses: peter-evans/dockerhub-description@v3 + uses: peter-evans/dockerhub-description@v4 with: username: ${{ secrets.DOCKERHUB_USERNAME }} password: ${{ secrets.DOCKERHUB_TOKEN }} diff --git a/Dockerfile b/Dockerfile index 5947838..e2067f6 100644 --- a/Dockerfile +++ b/Dockerfile @@ -16,12 +16,12 @@ COPY requirements.txt . RUN apk add --no-cache gcc musl-dev && \ pip install --upgrade pip wheel && \ - pip install --user -r requirements.txt && \ + pip install -r requirements.txt && \ pip uninstall -y pip wheel && \ apk del gcc musl-dev && \ - python3 -m compileall -b -f /root/.local/lib/python3.11/site-packages && \ - find /root/.local/lib/python3.11/site-packages -name "*.py" -type f -delete && \ - find /root/.local/lib/python3.11/ -name "__pycache__" -type d -exec rm -rf {} + + python3 -m compileall -b -f /usr/local/lib/python3.11/site-packages && \ + find /usr/local/lib/python3.11/site-packages -name "*.py" -type f -delete && \ + find /usr/local/lib/python3.11/ -name "__pycache__" -type d -exec rm -rf {} + FROM base @@ -29,7 +29,7 @@ ENV PIP_NO_CACHE_DIR=off iSPBTV_docker=True iSPBTV_data_dir=data TERM=xterm-256c COPY requirements.txt . -COPY --from=dep_installer /root/.local /root/.local +COPY --from=dep_installer /usr/local /usr/local WORKDIR /app diff --git a/pyproject.toml b/pyproject.toml index c497a20..cd9e702 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,6 +1,6 @@ [project] name = "iSponsorBlockTV" -version = "2.0.7" +version = "2.0.8" authors = [ {"name" = "dmunozv04"} ] diff --git a/src/iSponsorBlockTV/main.py b/src/iSponsorBlockTV/main.py index b624d00..bb8f1a2 100644 --- a/src/iSponsorBlockTV/main.py +++ b/src/iSponsorBlockTV/main.py @@ -52,13 +52,13 @@ class DeviceListener: # Main subscription loop async def loop(self): lounge_controller = self.lounge_controller - while not lounge_controller.linked(): - try: - self.logger.debug("Refreshing auth") - await lounge_controller.refresh_auth() - except: - await asyncio.sleep(10) while not self.cancelled: + while not lounge_controller.linked(): + try: + self.logger.debug("Refreshing auth") + await lounge_controller.refresh_auth() + except: + await asyncio.sleep(10) while not (await self.is_available()) and not self.cancelled: await asyncio.sleep(10) try: