Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
22 commits
Select commit Hold shift + click to select a range
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
42 changes: 42 additions & 0 deletions .devcontainer/devcontainer.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
{
"name": "Streamrip - Python 3",
"image": "mcr.microsoft.com/devcontainers/python:3",
"remoteUser": "vscode",
"remoteEnv": {
"DOCKERHUB_TOKEN": "${localEnv:DOCKERHUB_TOKEN}"
},
"postCreateCommand": "bash .devcontainer/post-create.sh",
"mounts": [
"source=/mnt/music,target=/mnt/music,type=bind,consistency=cached",
"source=${localEnv:HOME}/.ssh,target=/home/vscode/.ssh,type=bind,consistency=cached",
"source=/var/run/docker.sock,target=/var/run/docker.sock,type=bind,consistency=cached"
],
"customizations": {
"vscode": {
"settings": {
"terminal.integrated.profiles.linux": {
"bash": {
"path": "/bin/bash",
"icon": "terminal-bash",
"args": [
"-l"
]
}
}
},
"extensions": [
"gruntfuggly.todo-tree",
"heartacker.git-graph-ai",
"ms-python.python",
"ms-python.vscode-pylance",
"ryanluker.vscode-coverage-gutters",
"meezilla.json",
"yzhang.markdown-all-in-one",
"foxundermoon.shell-format",
"shardulm94.trailing-spaces",
"github.copilot",
"github.copilot-chat"
]
}
}
}
15 changes: 15 additions & 0 deletions .devcontainer/install-gh-copilot.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
sudo mkdir -p -m 755 /etc/apt/keyrings
curl -fsSL https://cli.github.com/packages/githubcli-archive-keyring.gpg \
| sudo tee /etc/apt/keyrings/githubcli-archive-keyring.gpg >/dev/null
sudo chmod go+r /etc/apt/keyrings/githubcli-archive-keyring.gpg
sudo mkdir -p -m 755 /etc/apt/sources.list.d
echo "deb [arch=$(dpkg --print-architecture) signed-by=/etc/apt/keyrings/githubcli-archive-keyring.gpg] https://cli.github.com/packages stable main" \
| sudo tee /etc/apt/sources.list.d/github-cli.list >/dev/null
sudo apt update
sudo apt install gh

curl -fsSL https://gh.io/copilot-install | bash
copilot plugin marketplace add https://github.com/ayghri/i-have-adhd.git
copilot plugin marketplace add https://github.com/obra/superpowers.git
copilot plugin add i-have-adhd@i-have-adhd
copilot plugin add superpowers@superpowers-dev
17 changes: 17 additions & 0 deletions .devcontainer/post-create.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
#!/usr/bin/env bash
#pip3 install -r requirements.txt
#pip3 install -r requirements-dev.txt

# setup streamrip dependencies and install rip command
pip install poetry
poetry install
poetry update

# Move in project's virtual env (to activate rip command)
echo -e "\nalias venv=\"source \\\$(poetry env info -p)/bin/activate\"" >> ~/.bashrc
# alias venv="source \$(poetry env info -p)/bin/activate"

# install Docker cli part, to build and push images
sudo apt update && sudo apt --assume-yes upgrade && sudo apt --assume-yes install docker-cli

./install-gh-copilot.sh
5 changes: 1 addition & 4 deletions .github/workflows/ruff.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,4 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: chartboost/ruff-action@v1
- uses: chartboost/ruff-action@v1
with:
args: 'format --check'
- uses: astral-sh/ruff-action@v3
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -21,3 +21,5 @@ StreamripDownloads
/.mypy_cache
.DS_Store
pyrightconfig.json
/.vscode
.worktrees/
26 changes: 26 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
FROM alpine:latest

# Install python3 + pip, system-wide
RUN apk update \
&& apk upgrade \
&& apk add py3-pip \
&& apk cache clean \
&& mkdir /music /config /app \
&& pip install poetry --break-system-packages

COPY poetry.lock pyproject.toml README.md requirements.txt requirements-dev.txt /app/
COPY streamrip/ /app/streamrip/
COPY shell/streamrip.sh ./
RUN chmod +x streamrip.sh
WORKDIR /app

# Create a group and user
RUN adduser -S Amadeus -G users -u 1029 \
&& chown -R Amadeus:users /app /music /config

WORKDIR /app
USER Amadeus
RUN poetry install

ENTRYPOINT ["sh", "-c"]
CMD ["/streamrip.sh"]
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ A scriptable stream downloader for Qobuz, Tidal, Deezer and SoundCloud.
- Supports downloads of Spotify and Apple Music playlists through [last.fm](https://www.last.fm)
- Automatically converts files to a preferred format
- Has a database that stores the downloaded tracks' IDs so that repeats are avoided
- Tracks with old or replaced IDs are resolved through a replacement table so known downloads still skip
- Concurrency and rate limiting
- Interactive search for all sources
- Highly customizable through the config file
Expand Down
61 changes: 61 additions & 0 deletions docs/superpowers/plans/2026-11-21-config-version-suffix.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
# Config Version Suffix Implementation Plan

> **For agentic workers:** REQUIRED SUB-SKILL: Use superpowers:subagent-driven-development (recommended) or superpowers:executing-plans to implement this plan task-by-task. Steps use checkbox (`- [ ]`) syntax for tracking.

**Goal:** Mark fork configs as `2.2.0-sla` and automatically migrate upstream `2.2.0` configs without losing shared user settings.

**Architecture:** Reuse the exact config-version comparison and existing config updater. Keep the application/package version unchanged; the bundled config template supplies defaults for fork-specific keys.

**Tech Stack:** Python, TOML, pytest.

**Spec:** `docs/superpowers/specs/2026-11-21-config-version-suffix-design.md`

## Global Constraints

- The config version is `2.2.0-sla`.
- The app/package version remains unchanged.
- Migration preserves shared config values and adds new fields from the fork template.

## Review Focus

- An upstream `2.2.0` config without fork fields triggers migration: cover with `test_config_file_update`.
- Migration preserves existing shared settings and supplies playlist defaults: assert in `test_config_file_update`.
- The version test accepts the `-sla` suffix while still checking the package version: cover with `tests/test_versions.py`.

---

### Task 1: Mark and migrate fork configs

**Files:**
- Modify: `streamrip/config.py` — set `CURRENT_CONFIG_VERSION`.
- Modify: `streamrip/config.toml` — set the bundled template's `[misc].version`.
- Modify: `tests/test_config.toml` — keep the sample config aligned with the fork version.
- Modify: `tests/test_config_old.toml` — model an upstream `2.2.0` config lacking fork fields.
- Modify: `tests/test_config.py` — assert migration version, preserved values, and fork-field defaults.
- Modify: `tests/test_versions.py` — accept a hyphenated suffix in config versions.

**Interfaces:**
- Consumes: `Config._update_file(old_path, new_path)` and the existing shared-key migration behavior.
- Produces: `CURRENT_CONFIG_VERSION == "2.2.0-sla"`; matching bundled/sample config versions; migration of `2.2.0` configs to the fork template.

- [ ] **Step 1: Add regression assertions**

Update `tests/test_config_old.toml` to use version `2.2.0`. In `test_config_file_update`, assert the resulting `[misc].version` is `2.2.0-sla`, existing shared values such as `downloads.folder` are retained, and `filepaths.playlist_format` / `filepaths.m3u8_format` receive the template values.

Update `tests/test_versions.py`'s version regex to accept an optional `-` suffix while retaining the existing package-version consistency assertion.

- [ ] **Step 2: Run the focused tests and confirm the regression**

Run: `pytest tests/test_config.py::test_config_file_update tests/test_versions.py -q`

Expected: FAIL because the migration still writes `2.2.0` instead of `2.2.0-sla`.

- [ ] **Step 3: Implement the config version**

Set `CURRENT_CONFIG_VERSION` in `streamrip/config.py` and `[misc].version` in `streamrip/config.toml` and `tests/test_config.toml` to `2.2.0-sla`. Leave `pyproject.toml` and `streamrip/__init__.py` versions unchanged.

- [ ] **Step 4: Run focused config tests**

Run: `pytest tests/test_config.py tests/test_versions.py -q`

Expected: PASS, including migration of the upstream-version fixture with shared values retained and new fork fields populated.
27 changes: 27 additions & 0 deletions docs/superpowers/specs/2026-11-21-config-version-suffix-design.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
# Config Version Suffix Design

## Intent

Distinguish Streamrip's fork-specific config from upstream config and ensure
existing configs are migrated when the fork adds required config fields.

## Approaches

- **Append `-sla` to the config version (chosen):** Reuse the existing exact
version check and migration path. This also distinguishes the fork config.
- **Add a separate flavor field:** This would need new parsing and
compatibility behavior, and would not trigger the current migration by itself.

## Design

Set the config version to `2.2.0-sla` in both `CURRENT_CONFIG_VERSION` and the
bundled config template. Leave the app/package version unchanged. Update the
version test pattern to accept the suffix and add a focused regression test
showing that an upstream-version config is migrated, shared user settings are
preserved, and fork-specific fields receive template defaults.

## Scope and constraints

This changes only config identification and migration coverage. Switching to
upstream may discard fork-only config values because upstream's template does
not include those keys. No unrelated config behavior is changed.
Loading