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

Release candidate 1.8.0 #453

Merged
merged 24 commits into from
Jan 3, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
24 commits
Select commit Hold shift + click to select a range
17e2dda
ci: add version number to docker tags, update docs (#445)
vicwomg Dec 28, 2024
e370d58
feat: run pikaraoke on a single port
vicwomg Dec 25, 2024
e6bf477
feat: add parameter for full buffering approach
vicwomg Dec 26, 2024
1625e98
fix: improve browser warning message
vicwomg Dec 26, 2024
f4bdd00
fix: improve playback loop by using process exit codes
vicwomg Dec 26, 2024
ea09b72
fix: alpha bar not showing on files screen
vicwomg Dec 26, 2024
f074cee
fix: splash menu iframe doesn't load over https
vicwomg Dec 26, 2024
4122096
fix: support concurrent splash screens #448 (#451)
vicwomg Dec 28, 2024
6aeb4f6
feat: add timestamp to splash screen (#452)
vicwomg Dec 28, 2024
9a64c92
fix: track wont restart while paused
vicwomg Dec 28, 2024
75232f9
feat: allow CLI arg to specify transcode buffer size
vicwomg Dec 28, 2024
a654541
feat: support realtime(ish) notifications on splash screen
vicwomg Dec 29, 2024
e4132c5
perf: only transcode files when necessary
vicwomg Dec 29, 2024
2cc61b5
perf: optimize docker build and arg handling
vicwomg Dec 30, 2024
7efa463
feat: fade volume transition on skip/play/pause #180
vicwomg Dec 30, 2024
2691376
fix: chunked stream failures on raspberry pi (#454)
vicwomg Dec 31, 2024
363964b
feat: background music, score screen, limit queue, stored prefs
vicwomg Jan 2, 2025
1453c53
docs: simplify README, deprecate unused files
vicwomg Jan 2, 2025
41ab291
fix: audit / clean up translations
vicwomg Jan 2, 2025
8885141
feat: add more user preferences to info screen
vicwomg Jan 3, 2025
b710a91
fix: song restarts if now_playing status changes during score
vicwomg Jan 3, 2025
bb5e0d4
fix: media file path incorrect on windows
vicwomg Jan 3, 2025
8134e2c
feat: allow randomized background music from user-specified dir
vicwomg Jan 3, 2025
3985511
fix: change buffer_size to be measured in kb
vicwomg Jan 3, 2025
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
8 changes: 7 additions & 1 deletion .github/workflows/release-please.yml
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,12 @@ jobs:
- name: Add Poetry to PATH
run: echo "/opt/poetry/bin" >> $GITHUB_PATH

- name: Extract version number
id: get_version
run: |
version=$(sed -n 's/^version = "\(.*\)"/\1/p' pyproject.toml)
echo "VERSION=$version" >> $GITHUB_ENV

- name: Install Package
run: poetry install --no-interaction --no-ansi

Expand All @@ -89,4 +95,4 @@ jobs:
with:
platforms: linux/amd64,linux/arm64
push: true
tags: vicwomg/pikaraoke:latest
tags: vicwomg/pikaraoke:latest,vicwomg/pikaraoke:${{ env.VERSION }}
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -8,4 +8,5 @@ dist/
songs/
qrcode.png
.DS_Store
config.ini
docker-compose.yml
19 changes: 11 additions & 8 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -2,20 +2,23 @@
FROM python:3.12-slim-bullseye

# Install required packages
RUN apt-get update --allow-releaseinfo-change
RUN apt-get install ffmpeg wireless-tools -y
RUN apt-get update --allow-releaseinfo-change && \
apt-get install -y --no-install-recommends ffmpeg wireless-tools && \
apt-get clean && \
pip install poetry && \
rm -rf /var/lib/apt/lists/*

WORKDIR /app

# Copy minimum required files into the image
COPY pyproject.toml ./
COPY pikaraoke ./pikaraoke
COPY docs ./docs

# Install pikaraoke
RUN pip install .
# Only install main dependencies for better docker caching
RUN poetry install --only main

COPY docker/entrypoint.sh ./
RUN chmod +x entrypoint.sh
# Copy the rest of the files and install the remaining deps in a separate layer
COPY pikaraoke ./pikaraoke
RUN poetry install

ENTRYPOINT ["./entrypoint.sh"]
ENTRYPOINT ["poetry", "run", "pikaraoke", "-d", "/app/pikaraoke-songs/", "--headless"]
1 change: 1 addition & 0 deletions code_quality/.pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,7 @@ repos:
- id: requirements-txt-fixer
name: Sort requirements.txt
- id: check-added-large-files
args: [--maxkb=3000]
- id: check-case-conflict
- id: check-merge-conflict
- id: end-of-file-fixer
Expand Down
16 changes: 16 additions & 0 deletions docker/build_arm64_amd64.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
#!/bin/bash

# Check if at least one argument is provided
if [ $# -lt 1 ]; then
echo "Usage: $0 <tag> [additional docker build arguments]"
echo "Can only be run from the project root directory"
exit 1
fi

# The first argument is the tag
TAG=$1

# Shift the arguments so that $2 becomes $1, $3 becomes $2, etc.
shift

docker buildx build --platform linux/arm64,linux/amd64 . -t $TAG "$@"
14 changes: 7 additions & 7 deletions docker/docker-compose.yml.example
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
services:
pikaraoke:
image: pikaraoke:latest
image: vicwomg/pikaraoke:latest
container_name: PiKaraoke
# Below Host network mode may work better on some systems and replace manual IP configuration. Does not work on OSX
## Below Host network mode may work better on some systems and replace manual IP configuration. Does not work on OSX
# network_mode: host
environment:
EXTRA_ARGS: --url http://<YOUR_LAN_IP>:5555 # Replace with your LAN IP or DNS url, not necesary if using network_mode: host
## add additional command line args if needed in example below: debug level logging, manually specified URL
command: -l10 --url http://<YOUR_LAN_IP>
volumes:
- </PATH/TO/LOCAL/SONGS/DIR>:/app/pikaraoke-songs # Replace with local dir. Insures your songs are persisted outside the container
- </PATH/TO/LOCAL/SONGS/DIR>:/app/pikaraoke-songs # Replace with local dir. to persist songs outside the container
restart: unless-stopped
## Forward host port 80 to the pikaraoke web interface on 5555, adjust host port as necessary
ports:
- "5555:5555" # Forward the port for the web interface
- "5556:5556" # Forward the port for the ffmpeg video stream interface
- "80:5555"
7 changes: 0 additions & 7 deletions docker/entrypoint.sh

This file was deleted.

82 changes: 34 additions & 48 deletions docs/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,18 +21,18 @@ If you want to support this project with a little monetary tip, it's much apprec
| **Feature** | **Description** |
| --------------------------- | ------------------------------------------------------------- |
| Web Interface | Multiple users can queue tracks from their smartphones |
| Player/Splash Screen | Connection QR code and "Next up" display |
| Searching/Browsing | Browse a local song library |
| Player/Splash Screen | Connection QR code and song queue metadata |
| Searching/Browsing | Search and rowse a local song library |
| Adding New Songs | Add new songs from Youtube |
| mp3 + cdg Support | Includes compressed .zip bundles |
| mp3 + cdg Support | CDG file support, supports compressed .zip bundles |
| Playback Controls | Pause, Skip, Restart, and volume control |
| File Management | Advanced editing of downloaded file names |
| Queue Management | Manage the song queue and change the order |
| Key Change / Pitch Shifting | Adjust the pitch of songs |
| File Management | Advanced editing of downloaded file names |
| Admin Mode | Lock down features with admin mode |
| Headless Mode | Run a dedicated server and stream pikaraoke to remote browser |
| Headless Mode | Run a dedicated pikaraoke server and stream to remote browser |

## Supported Devices / OS
## Supported Devices / OS / Platforms

- Raspberry Pi
- Requires a Raspberry Pi Model 3 or higher
Expand All @@ -42,11 +42,23 @@ If you want to support this project with a little monetary tip, it's much apprec
- Windows
- Linux

## Get Started
## Docker instructions

For Docker users, you can get going with one command. The deployed images includes everything you need to run in headless mode:

```sh
docker run vicwomg/pikaraoke:latest
```

For more information, [see official Dockerhub repo](https://hub.docker.com/repository/docker/vicwomg/pikaraoke)

## Native installation

### Install required programs

Pikaraoke requires Python 3.9 or greater. You can check your current version by running `python --version`. [Python downloads](https://www.python.org/downloads/)
Pikaraoke requires Python 3.9 or greater. You can check your current version by running `python --version`.

[Python downloads](https://www.python.org/downloads/)

#### Raspberry Pi OS / Linux distros with `apt`:

Expand All @@ -56,51 +68,23 @@ sudo apt-get install chromium-browser -y
sudo apt-get install chromium-chromedriver -y
```

Chromium/Chromdriver is optional if you're running with the `--headless` option.

#### Windows / OSX / Linux:

- FFmpeg 6.0 or greater: [FFmpeg downloads](https://ffmpeg.org/download.html)
- Chrome Browser: [Chrome](http://google.com/chrome) (only required for headed mode)

### Install pikaraoke

#### Create a virtual environment (optional)

Using a virtual environment (venv) is recommended to prevent conflicts with other global python packages.

You may find it more convenient to skip these steps, which allows you to launch pikaraoke without activating a venv first, but you run the risk of package conflicts.

If you don't install a lot of python projects with pip, that skipping venv is probably be fine. The choice is yours. See [the python documentation](https://docs.python.org/3/library/venv.html) for more details on venv.
### Install pikaraoke via pip

Raspberry Pi/Linux/OSX:

```sh
# Create a .venv directory in the homedir
python -m venv ~/.venv
# Activate your virtual environment
source ~/.venv/bin/activate
```

Windows (Powershell terminal):

```batch
:: Create a venv in Windows in your homedir
cd $HOME
python -m venv .venv
.venv\Scripts\activate
```

You should see a "(venv)" prefix in your terminal prompt if the venv is successfully activated.

#### Install pikaraoke via pip

Next, install pikaraoke from PyPi on the host into your venv:
Globally or within a virtual env:

```sh
# Install pikaraoke from PyPi
pip install pikaraoke
```

Note: if you did not use a venv, you may need to add the `--break-system-packages` parameter to ignore the warning and install pikaraoke and its dependencies globally.
Note: if you did not use a venv, you may need to add the `--break-system-packages` parameter to ignore the warning and install pikaraoke and its dependencies globally. You may experience package conflicts if you have other python programs installed.

### Run

Expand All @@ -113,8 +97,7 @@ pikaraoke

This will start pikaraoke in headed mode, and open Chrome browser with the splash screen. You can then connect to the QR code via your mobile device and start downloading and queueing songs.

Virtual env users: note that if you close your terminal between launches, you'll need to run:
`source ~/.venv/bin/activate` or `.venv\Scripts\activate` (windows) before launching pikaraoke again.
Virtual env users: note that if you close your terminal between launches, you'll need to reactivate your venv before running pikaraoke.

### More Options

Expand Down Expand Up @@ -151,13 +134,16 @@ poetry install
poetry run pikaraoke
```

See the [Pikaraoke development guide](https://github.com/vicwomg/pikaraoke/wiki/Pikaraoke-development-guide) for more details.
If you don't want to install poetry, you can alternately install pikaraoke directly from the source code root:

#### Run from repository (legacy)
```sh
pip install .
```

See [README](../scripts/README.md) for how to install pikaraoke cloning this repo and using the
scripts. This is a legacy method and may no longer work.
See the [Pikaraoke development guide](https://github.com/vicwomg/pikaraoke/wiki/Pikaraoke-development-guide) for more details.

## Troubleshooting
## Troubleshooting and guides

See the [TROUBLESHOOTING wiki](https://github.com/vicwomg/pikaraoke/wiki/FAQ-&-Troubleshooting) for help with issues.

There are also some great guides [on the wiki](https://github.com/vicwomg/pikaraoke/wiki/) to running pikaraoke in all manner of bizarre places including Android, Chromecast, and embedded TVs!
14 changes: 13 additions & 1 deletion pikaraoke/_TRANSLATION.md
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ when translating.
## Rebuilding translations

After modifying the templates or code and marking new strings for translation,
run
from the ./pikaraoke subdirectory, run

```shell
$ pybabel extract -F babel.cfg -o messages.pot --add-comments="MSG:" --strip-comment-tags --sort-by-file .
Expand All @@ -51,6 +51,12 @@ The update command will update each languages `translations/<lang>/LC_MESSAGES/m
file, which is what a translator for a particular language will see. The python app consumes `messages.mo` files,
which are binary files created by the compile step.

Note: 'Fuzzy' messages are marked with a #, fuzzy line above the msgid line, and are the result of a merge where a message is deemed slightly changed from the previous version. These will be ignored by the translation until they are addressed! A message marked as fuzzy is supposed to be looked at by a human to make sure the translation doesn't need updating, after which the human translator removes that flag. Often line break changes will trigger these, if you want to force compilation, run:

```shell
$ pybabel compile -f -d translations
```

In order to start translating a new language, use

```shell
Expand All @@ -65,4 +71,10 @@ As well as editing the `constants.py` `LANGUAGES` mapping to make that language
Currently I have it set based on the Accept-Language header sent with each request,
[which can be modified using this guide][accept-language-chrome].

## Testing a language

You can force a language locale on a given webpage by adding the lang query to the end of the URL. Example: `http://localhost:5555/?lang=pt_BR`

This will work for HTML endpoints, but for translations within python code (flashed messages, splash screen notifications), the host's locale is used.

[accept-language-chrome]: https://support.google.com/pixelslate/answer/173424?hl=en&co=GENIE.Platform%3DDesktop
Loading
Loading