Skip to content
Closed
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
27 changes: 15 additions & 12 deletions .env.example
Original file line number Diff line number Diff line change
@@ -1,17 +1,20 @@
TMDB_API_KEY=<your_tmdb_api_key>
PORT=8000
ADDON_ID=com.bimal.watchly
ADDON_NAME=Watchly
REDIS_URL=redis://redis:6379/0
TOKEN_TTL_SECONDS=0
ANNOUNCEMENT_HTML=
TOKEN_SALT=change-me # generate secure salt...

# app setup
APP_ENV="development" # available values are ["development", "production"]
HOST_NAME=<your_addon_url>
RECOMMENDATION_SOURCE_ITEMS_LIMIT=10 # fetches recent watched/loved 10 movies and series to recommend based on those
TOKEN_SALT=change-me
# generate some very long random string preferrably using cryptography libraries
PORT=8000

# redis
REDIS_MAX_CONNECTIONS=20
REDIS_CONNECTIONS_THRESHOLD=100

# UPDATER
CATALOG_UPDATE_MODE=cron # Available options: cron, interval
# cron updates catalogs at specified times
# interval updates in specific intervals
CATALOG_UPDATE_CRON_SCHEDULES=[{"hour": 12, "minute": 0, "id": "catalog_refresh_noon"},{"hour": 0, "minute": 0, "id": "catalog_refresh_midnight"}]
AUTO_UPDATE_CATALOGS=True
CATALOG_REFRESH_INTERVAL_SECONDS=6*60*60

# AI Catalog name generation
GEMINI_API_KEY=<your_gemini_api_key>
DEFAULT_GEMINI_MODEL="gemma-3-27b-it"
15 changes: 4 additions & 11 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -1,43 +1,39 @@
name: Build and Push Docker Image

env:
DOCKER_BUILDKIT: 1
COMPOSE_DOCKER_CLI_BUILD: 1

on:
push:
branches:
- main
paths:
- 'app/core/version.py'
- 'pyproject.toml'

concurrency:
group: ${{ github.head_ref || github.run_id }}
cancel-in-progress: true

jobs:
build-and-push:
runs-on: ubuntu-latest
permissions:
id-token: write
contents: write

steps:
- name: Checkout code
uses: actions/checkout@v5

- uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.CR_TOKEN }}

- name: Set up QEMU
uses: docker/setup-qemu-action@v3
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Set up Python
uses: actions/setup-python@v6
with:
python-version: '3.11'

- name: Read version from version.py
id: get-version
run: |
Expand All @@ -49,14 +45,12 @@ jobs:
fi
echo "VERSION=${VERSION}" >> $GITHUB_OUTPUT
echo "Read version: ${VERSION}"

- name: Set Docker image tag
id: set-tag
run: |
VERSION="${{ steps.get-version.outputs.VERSION }}"
echo "IMAGE_TAG=${VERSION}" >> $GITHUB_OUTPUT
echo "Building Docker image with version: ${VERSION}"

- name: Build and Push Docker image
working-directory: "./"
run: |
Expand All @@ -68,7 +62,6 @@ jobs:
# Also tag as latest
docker tag ghcr.io/${REPO_NAME}:${IMAGE_TAG} ghcr.io/${REPO_NAME}:latest
docker push ghcr.io/${REPO_NAME}:latest

- name: Create and Push Git Tag
run: |
VERSION="${{ steps.get-version.outputs.VERSION }}"
Expand Down
6 changes: 0 additions & 6 deletions .github/workflows/linter.yml
Original file line number Diff line number Diff line change
@@ -1,29 +1,23 @@
name: Linter

# Enable Buildkit and let compose use it to speed up image building
env:
DOCKER_BUILDKIT: 1
COMPOSE_DOCKER_CLI_BUILD: 1

on:
pull_request:
push:

concurrency:
group: ${{ github.head_ref || github.run_id }}
cancel-in-progress: true

jobs:
linter:
runs-on: ubuntu-latest
steps:
- name: Checkout Code Repository
uses: actions/checkout@v5

- name: Set up Python
uses: actions/setup-python@v6
with:
python-version: '3.11'

- name: Run pre-commit
uses: pre-commit/[email protected]
18 changes: 3 additions & 15 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
name: Create GitHub Release

on:
workflow_run:
workflows: ["Build and Push Docker Image"]
Expand All @@ -9,37 +8,30 @@ on:
- main
push:
tags:
- '*' # Also trigger on manual tag pushes


- '*' # Also trigger on manual tag pushes
jobs:
release:
runs-on: ubuntu-latest
# Only run if the triggering workflow succeeded
if: ${{ github.event_name == 'push' || github.event.workflow_run.conclusion == 'success' }}

permissions:
packages: write
contents: write

steps:
- name: Checkout repository
uses: actions/checkout@v5
with:
fetch-depth: 0 # Fetch all history for all tags and branches
fetch-tags: true # Fetch all tags
fetch-depth: 0 # Fetch all history for all tags and branches
fetch-tags: true # Fetch all tags
ref: ${{ github.event.workflow_run.head_branch || github.ref }}

- name: Set up Python
uses: actions/setup-python@v6
with:
python-version: '3.11'

- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install openai pydantic

- name: Get current tag
id: get-tag
run: |
Expand All @@ -63,13 +55,11 @@ jobs:
echo "TAG_NAME=${TAG_NAME}" >> $GITHUB_OUTPUT
echo "Current tag from push: ${TAG_NAME}"
fi

- name: Checkout tag commit
run: |
TAG_NAME="${{ steps.get-tag.outputs.TAG_NAME }}"
git checkout ${TAG_NAME} || git checkout -b temp-${TAG_NAME} ${TAG_NAME}
echo "Checked out tag: ${TAG_NAME}"

- name: Run Python script to generate release notes
id: generate_release_notes
env:
Expand All @@ -80,12 +70,10 @@ jobs:
echo "Running generate_release_notes.py"
python scripts/generate_release_notes.py
echo "Script completed"

- name: Debug Outputs
run: |
echo "Version: ${{ steps.generate_release_notes.outputs.version }}"
echo "Release Notes: ${{ steps.generate_release_notes.outputs.release_notes }}"

- name: Create GitHub Release
uses: actions/create-release@v1
env:
Expand Down
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -46,3 +46,4 @@ logs/
# python notebooks
*/ipynb_checkpoints/
*.ipynb
.vercel
10 changes: 4 additions & 6 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
default_stages: [pre-commit]
exclude: '^misc/|^data/|^docs/'

repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.6.0
Expand All @@ -16,28 +15,27 @@ repos:
- id: check-case-conflict
- id: check-docstring-first
- id: detect-private-key

- repo: https://github.com/asottile/pyupgrade
rev: v3.15.2
hooks:
- id: pyupgrade
args: [--py311-plus]

- repo: https://github.com/psf/black
rev: 24.4.0
hooks:
- id: black

- repo: https://github.com/PyCQA/isort
rev: 5.13.2
hooks:
- id: isort

- repo: https://github.com/PyCQA/flake8
rev: 7.0.0
hooks:
- id: flake8

- repo: https://github.com/google/yamlfmt
rev: v0.11.0
hooks:
- id: yamlfmt
# sets up .pre-commit-ci.yaml to ensure pre-commit dependencies stay up to date
ci:
autoupdate_schedule: weekly
Expand Down
Loading
Loading