Mopidy-Jukebox 1.0.0__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- mopidy_jukebox-1.0.0/.github/workflows/ci.yml +186 -0
- mopidy_jukebox-1.0.0/.gitignore +10 -0
- mopidy_jukebox-1.0.0/LICENSE +21 -0
- mopidy_jukebox-1.0.0/PKG-INFO +97 -0
- mopidy_jukebox-1.0.0/README.md +67 -0
- mopidy_jukebox-1.0.0/pyproject.toml +61 -0
- mopidy_jukebox-1.0.0/setup.cfg +4 -0
- mopidy_jukebox-1.0.0/src/Mopidy_Jukebox.egg-info/PKG-INFO +97 -0
- mopidy_jukebox-1.0.0/src/Mopidy_Jukebox.egg-info/SOURCES.txt +19 -0
- mopidy_jukebox-1.0.0/src/Mopidy_Jukebox.egg-info/dependency_links.txt +1 -0
- mopidy_jukebox-1.0.0/src/Mopidy_Jukebox.egg-info/entry_points.txt +2 -0
- mopidy_jukebox-1.0.0/src/Mopidy_Jukebox.egg-info/requires.txt +7 -0
- mopidy_jukebox-1.0.0/src/Mopidy_Jukebox.egg-info/scm_file_list.json +15 -0
- mopidy_jukebox-1.0.0/src/Mopidy_Jukebox.egg-info/scm_version.json +8 -0
- mopidy_jukebox-1.0.0/src/Mopidy_Jukebox.egg-info/top_level.txt +1 -0
- mopidy_jukebox-1.0.0/src/mopidy_jukebox/__init__.py +61 -0
- mopidy_jukebox-1.0.0/src/mopidy_jukebox/ext.conf +9 -0
- mopidy_jukebox-1.0.0/src/mopidy_jukebox/static/index.html +1221 -0
- mopidy_jukebox-1.0.0/src/mopidy_jukebox/web.py +127 -0
- mopidy_jukebox-1.0.0/tests/test_extension.py +52 -0
- mopidy_jukebox-1.0.0/tests/test_web.py +94 -0
|
@@ -0,0 +1,186 @@
|
|
|
1
|
+
name: CI
|
|
2
|
+
|
|
3
|
+
on:
|
|
4
|
+
push:
|
|
5
|
+
branches: [main]
|
|
6
|
+
tags: ["v*"]
|
|
7
|
+
pull_request:
|
|
8
|
+
workflow_dispatch:
|
|
9
|
+
inputs:
|
|
10
|
+
publish_testpypi:
|
|
11
|
+
description: "Upload this build to TestPyPI"
|
|
12
|
+
type: boolean
|
|
13
|
+
default: false
|
|
14
|
+
|
|
15
|
+
# Mopidy 3 and Mopidy 4 need different environments and neither runner image
|
|
16
|
+
# can host both:
|
|
17
|
+
# * Mopidy 4 declares requires-python >=3.13 AND needs GStreamer >= 1.26.2.
|
|
18
|
+
# * ubuntu-latest (24.04) ships GStreamer 1.24.2, so Mopidy 4 cannot run there.
|
|
19
|
+
# * debian:trixie ships 1.26.2 -- and is the platform this actually deploys to.
|
|
20
|
+
# So: Mopidy 3 on the hosted runner, Mopidy 4 in a trixie container.
|
|
21
|
+
|
|
22
|
+
jobs:
|
|
23
|
+
mopidy3:
|
|
24
|
+
name: "Mopidy 3 · Python ${{ matrix.python }}"
|
|
25
|
+
runs-on: ubuntu-latest
|
|
26
|
+
strategy:
|
|
27
|
+
fail-fast: false
|
|
28
|
+
matrix:
|
|
29
|
+
python: ["3.11", "3.12"]
|
|
30
|
+
steps:
|
|
31
|
+
- uses: actions/checkout@v6
|
|
32
|
+
with:
|
|
33
|
+
fetch-depth: 0 # setuptools-scm derives the version from tags
|
|
34
|
+
|
|
35
|
+
- uses: actions/setup-python@v6
|
|
36
|
+
with:
|
|
37
|
+
python-version: ${{ matrix.python }}
|
|
38
|
+
cache: pip
|
|
39
|
+
|
|
40
|
+
# This package only touches mopidy.ext and mopidy.config; neither pulls
|
|
41
|
+
# in GStreamer, so no system libraries are needed.
|
|
42
|
+
# Mopidy 3 imports pkg_resources, removed in setuptools 81.
|
|
43
|
+
- name: Install
|
|
44
|
+
run: |
|
|
45
|
+
python -m pip install --upgrade pip
|
|
46
|
+
pip install "setuptools<81"
|
|
47
|
+
pip install -e ".[test]"
|
|
48
|
+
|
|
49
|
+
- name: Test
|
|
50
|
+
run: pytest -q --cov --cov-report=term-missing
|
|
51
|
+
|
|
52
|
+
mopidy4:
|
|
53
|
+
name: "Mopidy 4 · Debian trixie"
|
|
54
|
+
runs-on: ubuntu-latest
|
|
55
|
+
container: debian:trixie
|
|
56
|
+
steps:
|
|
57
|
+
# git must exist before checkout, otherwise the action falls back to a
|
|
58
|
+
# tarball download with no .git directory and setuptools-scm cannot
|
|
59
|
+
# derive a version.
|
|
60
|
+
- name: Install git
|
|
61
|
+
run: |
|
|
62
|
+
apt-get update -qq
|
|
63
|
+
apt-get install -y -qq --no-install-recommends git ca-certificates
|
|
64
|
+
|
|
65
|
+
- uses: actions/checkout@v6
|
|
66
|
+
with:
|
|
67
|
+
fetch-depth: 0
|
|
68
|
+
|
|
69
|
+
- name: Trust the workspace
|
|
70
|
+
run: git config --global --add safe.directory "$GITHUB_WORKSPACE"
|
|
71
|
+
|
|
72
|
+
- name: Install dependencies
|
|
73
|
+
run: |
|
|
74
|
+
apt-get install -y -qq --no-install-recommends \
|
|
75
|
+
python3 python3-pip python3-venv python3-gi python3-gi-cairo \
|
|
76
|
+
gir1.2-glib-2.0 gir1.2-gstreamer-1.0 gir1.2-gst-plugins-base-1.0 \
|
|
77
|
+
gstreamer1.0-plugins-base
|
|
78
|
+
# --system-site-packages so the venv can see apt's python3-gi, which
|
|
79
|
+
# is not sensibly pip-installable. Same arrangement the jukebox uses.
|
|
80
|
+
python3 -m venv --system-site-packages /tmp/venv
|
|
81
|
+
/tmp/venv/bin/pip install --quiet --upgrade pip
|
|
82
|
+
/tmp/venv/bin/pip install -e ".[test]"
|
|
83
|
+
|
|
84
|
+
- name: Show what we are testing against
|
|
85
|
+
run: |
|
|
86
|
+
/tmp/venv/bin/python -c "import mopidy; print('mopidy', mopidy.__version__)"
|
|
87
|
+
gst-inspect-1.0 --version | head -2 || true
|
|
88
|
+
|
|
89
|
+
- name: Test
|
|
90
|
+
run: /tmp/venv/bin/pytest -q --cov --cov-report=term-missing
|
|
91
|
+
|
|
92
|
+
build:
|
|
93
|
+
needs: [mopidy3, mopidy4]
|
|
94
|
+
runs-on: ubuntu-latest
|
|
95
|
+
outputs:
|
|
96
|
+
# Distinguishes a real release tag from a release candidate. Without
|
|
97
|
+
# this, 'refs/tags/v...' matches v1.0.0rc1 exactly as well as v1.0.0 and
|
|
98
|
+
# a candidate goes straight to the real index.
|
|
99
|
+
prerelease: ${{ steps.classify.outputs.prerelease }}
|
|
100
|
+
steps:
|
|
101
|
+
- uses: actions/checkout@v6
|
|
102
|
+
with:
|
|
103
|
+
fetch-depth: 0
|
|
104
|
+
- uses: actions/setup-python@v6
|
|
105
|
+
with:
|
|
106
|
+
python-version: "3.12"
|
|
107
|
+
- run: pip install build twine trove-classifiers
|
|
108
|
+
|
|
109
|
+
# twine check does NOT validate classifiers; PyPI rejects an unknown one
|
|
110
|
+
# with a 400 at upload time, after the whole pipeline has run. Catch it
|
|
111
|
+
# here instead. (There is no "Framework :: Mopidy" classifier, however
|
|
112
|
+
# much it feels like there should be.)
|
|
113
|
+
- name: Validate classifiers
|
|
114
|
+
run: |
|
|
115
|
+
python - <<'EOF'
|
|
116
|
+
import sys, tomllib
|
|
117
|
+
from trove_classifiers import classifiers as valid
|
|
118
|
+
declared = tomllib.load(open("pyproject.toml","rb"))["project"].get("classifiers", [])
|
|
119
|
+
bad = [c for c in declared if c not in valid]
|
|
120
|
+
for c in declared:
|
|
121
|
+
print((" ok " if c in valid else " INVALID ") + c)
|
|
122
|
+
if bad:
|
|
123
|
+
sys.exit(f"\nNot valid trove classifiers: {bad}")
|
|
124
|
+
EOF
|
|
125
|
+
|
|
126
|
+
- run: python -m build # pure-python wheel; no GStreamer needed
|
|
127
|
+
- run: twine check dist/*
|
|
128
|
+
|
|
129
|
+
- name: Is this a final release tag?
|
|
130
|
+
id: classify
|
|
131
|
+
run: |
|
|
132
|
+
if [[ "${GITHUB_REF_TYPE}" == "tag" && \
|
|
133
|
+
"${GITHUB_REF_NAME}" =~ ^v[0-9]+\.[0-9]+\.[0-9]+(\.post[0-9]+)?$ ]]; then
|
|
134
|
+
echo "prerelease=false" >> "$GITHUB_OUTPUT"
|
|
135
|
+
echo "::notice::${GITHUB_REF_NAME} is a final release -> PyPI"
|
|
136
|
+
else
|
|
137
|
+
echo "prerelease=true" >> "$GITHUB_OUTPUT"
|
|
138
|
+
echo "::notice::${GITHUB_REF_NAME} is not a final release -> TestPyPI"
|
|
139
|
+
fi
|
|
140
|
+
|
|
141
|
+
- uses: actions/upload-artifact@v6
|
|
142
|
+
with:
|
|
143
|
+
name: dist
|
|
144
|
+
path: dist/
|
|
145
|
+
|
|
146
|
+
# TestPyPI on every push to main, and on demand from the Actions tab. Gives
|
|
147
|
+
# you a real 'pip install -i https://test.pypi.org/simple/' rehearsal before
|
|
148
|
+
# anything reaches the real index. Versions are 1.0.1.devN, derived from
|
|
149
|
+
# commit distance, so each push is unique; skip-existing covers re-runs.
|
|
150
|
+
publish-testpypi:
|
|
151
|
+
if: >-
|
|
152
|
+
github.ref == 'refs/heads/main' ||
|
|
153
|
+
(github.ref_type == 'tag' && needs.build.outputs.prerelease == 'true') ||
|
|
154
|
+
(github.event_name == 'workflow_dispatch' && inputs.publish_testpypi)
|
|
155
|
+
needs: build
|
|
156
|
+
runs-on: ubuntu-latest
|
|
157
|
+
environment: testpypi
|
|
158
|
+
permissions:
|
|
159
|
+
id-token: write
|
|
160
|
+
steps:
|
|
161
|
+
- uses: actions/download-artifact@v6
|
|
162
|
+
with:
|
|
163
|
+
name: dist
|
|
164
|
+
path: dist/
|
|
165
|
+
- uses: pypa/gh-action-pypi-publish@release/v1
|
|
166
|
+
with:
|
|
167
|
+
repository-url: https://test.pypi.org/legacy/
|
|
168
|
+
skip-existing: true
|
|
169
|
+
|
|
170
|
+
publish:
|
|
171
|
+
# The real index, and ONLY for a final release tag. A candidate such as
|
|
172
|
+
# v1.0.0rc1 routes to TestPyPI instead -- PyPI never lets a version number
|
|
173
|
+
# be reused, so an accidental upload there is permanent.
|
|
174
|
+
# Trusted Publishing (OIDC) -- no API token stored anywhere.
|
|
175
|
+
if: github.ref_type == 'tag' && needs.build.outputs.prerelease == 'false'
|
|
176
|
+
needs: build
|
|
177
|
+
runs-on: ubuntu-latest
|
|
178
|
+
environment: pypi
|
|
179
|
+
permissions:
|
|
180
|
+
id-token: write
|
|
181
|
+
steps:
|
|
182
|
+
- uses: actions/download-artifact@v6
|
|
183
|
+
with:
|
|
184
|
+
name: dist
|
|
185
|
+
path: dist/
|
|
186
|
+
- uses: pypa/gh-action-pypi-publish@release/v1
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 King Butter
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
|
@@ -0,0 +1,97 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: Mopidy-Jukebox
|
|
3
|
+
Version: 1.0.0
|
|
4
|
+
Summary: TouchTunes-style touchscreen jukebox UI for Mopidy
|
|
5
|
+
Author: King Butter
|
|
6
|
+
License-Expression: MIT
|
|
7
|
+
Project-URL: Homepage, https://github.com/kingbutter/mopidy-jukebox
|
|
8
|
+
Project-URL: Issues, https://github.com/kingbutter/mopidy-jukebox/issues
|
|
9
|
+
Project-URL: Source, https://github.com/kingbutter/mopidy-jukebox
|
|
10
|
+
Keywords: mopidy,mopidy-extension,music,jukebox,kiosk,touchscreen
|
|
11
|
+
Classifier: Development Status :: 4 - Beta
|
|
12
|
+
Classifier: Environment :: Web Environment
|
|
13
|
+
Classifier: Intended Audience :: End Users/Desktop
|
|
14
|
+
Classifier: Operating System :: OS Independent
|
|
15
|
+
Classifier: Programming Language :: Python :: 3
|
|
16
|
+
Classifier: Programming Language :: Python :: 3.11
|
|
17
|
+
Classifier: Programming Language :: Python :: 3.12
|
|
18
|
+
Classifier: Programming Language :: Python :: 3.13
|
|
19
|
+
Classifier: Topic :: Multimedia :: Sound/Audio :: Players
|
|
20
|
+
Requires-Python: >=3.11
|
|
21
|
+
Description-Content-Type: text/markdown
|
|
22
|
+
License-File: LICENSE
|
|
23
|
+
Requires-Dist: Mopidy>=3.4
|
|
24
|
+
Requires-Dist: Pykka>=3.0
|
|
25
|
+
Requires-Dist: tornado>=6.0
|
|
26
|
+
Provides-Extra: test
|
|
27
|
+
Requires-Dist: pytest>=8; extra == "test"
|
|
28
|
+
Requires-Dist: pytest-cov; extra == "test"
|
|
29
|
+
Dynamic: license-file
|
|
30
|
+
|
|
31
|
+
# Mopidy-Jukebox
|
|
32
|
+
|
|
33
|
+
[](https://pypi.org/project/Mopidy-Jukebox/)
|
|
34
|
+
[](https://github.com/kingbutter/mopidy-jukebox/actions)
|
|
35
|
+
|
|
36
|
+
A [Mopidy](https://mopidy.com/) extension that turns a touchscreen into a
|
|
37
|
+
TouchTunes-style jukebox. Guests browse album art, spend free credits, and
|
|
38
|
+
queue the next song — from the cabinet itself or from their phone.
|
|
39
|
+
|
|
40
|
+
Built for an actual 1990s TouchTunes Allegro cabinet with a resistive Elo
|
|
41
|
+
panel, so the UI assumes single-touch, no hover, and no keyboard.
|
|
42
|
+
|
|
43
|
+
## What it does
|
|
44
|
+
|
|
45
|
+
- **Art-first browsing.** Categories come from whatever your backends expose;
|
|
46
|
+
albums and artists render as tiles, with drill-down to track lists.
|
|
47
|
+
- **Dialable selection codes.** Track lists page into banks — A1–A10, then
|
|
48
|
+
B1–B10 — and an on-screen keypad lets you punch in a code, the way the
|
|
49
|
+
mechanical machines worked.
|
|
50
|
+
- **Credits.** Free, but rationed: a starting balance and a slow refill, so
|
|
51
|
+
one person can't own the night.
|
|
52
|
+
- **No transport controls for guests.** No pause, no skip, no volume. An
|
|
53
|
+
admin panel hides behind five taps on the credits counter.
|
|
54
|
+
- **Attract mode** built from album art already in the cache.
|
|
55
|
+
- **Phone and kiosk layouts** from one page, with the device's own keyboard
|
|
56
|
+
on phones and a built-in QWERTY on the wall unit.
|
|
57
|
+
|
|
58
|
+
Served from Mopidy's own web server, so the page and the JSON-RPC endpoint
|
|
59
|
+
share an origin — there is no CORS configuration to get wrong.
|
|
60
|
+
|
|
61
|
+
## Installation
|
|
62
|
+
|
|
63
|
+
```sh
|
|
64
|
+
python3 -m pip install Mopidy-Jukebox
|
|
65
|
+
```
|
|
66
|
+
|
|
67
|
+
Then open `http://<your-host>:6680/jukebox/`.
|
|
68
|
+
|
|
69
|
+
## Configuration
|
|
70
|
+
|
|
71
|
+
Defaults are usable as-is. To change them, add a `[jukebox]` section to your
|
|
72
|
+
`mopidy.conf`:
|
|
73
|
+
|
|
74
|
+
```ini
|
|
75
|
+
[jukebox]
|
|
76
|
+
enabled = true
|
|
77
|
+
start_credits = 4 # credits a guest starts with
|
|
78
|
+
max_credits = 8 # ceiling, so credits don't stockpile
|
|
79
|
+
refill_seconds = 600 # one more credit every N seconds
|
|
80
|
+
cost_per_song = 1
|
|
81
|
+
attract_seconds = 90 # idle time before the attract screen
|
|
82
|
+
page_size = 10 # rows per selection bank (A1..A10)
|
|
83
|
+
title = Jukebox
|
|
84
|
+
```
|
|
85
|
+
|
|
86
|
+
Every client reads these from `/jukeboxapi/config.json`, so a change here
|
|
87
|
+
applies to the wall unit and every phone at once.
|
|
88
|
+
|
|
89
|
+
## Project resources
|
|
90
|
+
|
|
91
|
+
- [Source code](https://github.com/kingbutter/mopidy-jukebox)
|
|
92
|
+
- [Issue tracker](https://github.com/kingbutter/mopidy-jukebox/issues)
|
|
93
|
+
|
|
94
|
+
## Credits
|
|
95
|
+
|
|
96
|
+
- Original author: [King Butter](https://github.com/kingbutter)
|
|
97
|
+
- Current maintainer: [King Butter](https://github.com/kingbutter)
|
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
# Mopidy-Jukebox
|
|
2
|
+
|
|
3
|
+
[](https://pypi.org/project/Mopidy-Jukebox/)
|
|
4
|
+
[](https://github.com/kingbutter/mopidy-jukebox/actions)
|
|
5
|
+
|
|
6
|
+
A [Mopidy](https://mopidy.com/) extension that turns a touchscreen into a
|
|
7
|
+
TouchTunes-style jukebox. Guests browse album art, spend free credits, and
|
|
8
|
+
queue the next song — from the cabinet itself or from their phone.
|
|
9
|
+
|
|
10
|
+
Built for an actual 1990s TouchTunes Allegro cabinet with a resistive Elo
|
|
11
|
+
panel, so the UI assumes single-touch, no hover, and no keyboard.
|
|
12
|
+
|
|
13
|
+
## What it does
|
|
14
|
+
|
|
15
|
+
- **Art-first browsing.** Categories come from whatever your backends expose;
|
|
16
|
+
albums and artists render as tiles, with drill-down to track lists.
|
|
17
|
+
- **Dialable selection codes.** Track lists page into banks — A1–A10, then
|
|
18
|
+
B1–B10 — and an on-screen keypad lets you punch in a code, the way the
|
|
19
|
+
mechanical machines worked.
|
|
20
|
+
- **Credits.** Free, but rationed: a starting balance and a slow refill, so
|
|
21
|
+
one person can't own the night.
|
|
22
|
+
- **No transport controls for guests.** No pause, no skip, no volume. An
|
|
23
|
+
admin panel hides behind five taps on the credits counter.
|
|
24
|
+
- **Attract mode** built from album art already in the cache.
|
|
25
|
+
- **Phone and kiosk layouts** from one page, with the device's own keyboard
|
|
26
|
+
on phones and a built-in QWERTY on the wall unit.
|
|
27
|
+
|
|
28
|
+
Served from Mopidy's own web server, so the page and the JSON-RPC endpoint
|
|
29
|
+
share an origin — there is no CORS configuration to get wrong.
|
|
30
|
+
|
|
31
|
+
## Installation
|
|
32
|
+
|
|
33
|
+
```sh
|
|
34
|
+
python3 -m pip install Mopidy-Jukebox
|
|
35
|
+
```
|
|
36
|
+
|
|
37
|
+
Then open `http://<your-host>:6680/jukebox/`.
|
|
38
|
+
|
|
39
|
+
## Configuration
|
|
40
|
+
|
|
41
|
+
Defaults are usable as-is. To change them, add a `[jukebox]` section to your
|
|
42
|
+
`mopidy.conf`:
|
|
43
|
+
|
|
44
|
+
```ini
|
|
45
|
+
[jukebox]
|
|
46
|
+
enabled = true
|
|
47
|
+
start_credits = 4 # credits a guest starts with
|
|
48
|
+
max_credits = 8 # ceiling, so credits don't stockpile
|
|
49
|
+
refill_seconds = 600 # one more credit every N seconds
|
|
50
|
+
cost_per_song = 1
|
|
51
|
+
attract_seconds = 90 # idle time before the attract screen
|
|
52
|
+
page_size = 10 # rows per selection bank (A1..A10)
|
|
53
|
+
title = Jukebox
|
|
54
|
+
```
|
|
55
|
+
|
|
56
|
+
Every client reads these from `/jukeboxapi/config.json`, so a change here
|
|
57
|
+
applies to the wall unit and every phone at once.
|
|
58
|
+
|
|
59
|
+
## Project resources
|
|
60
|
+
|
|
61
|
+
- [Source code](https://github.com/kingbutter/mopidy-jukebox)
|
|
62
|
+
- [Issue tracker](https://github.com/kingbutter/mopidy-jukebox/issues)
|
|
63
|
+
|
|
64
|
+
## Credits
|
|
65
|
+
|
|
66
|
+
- Original author: [King Butter](https://github.com/kingbutter)
|
|
67
|
+
- Current maintainer: [King Butter](https://github.com/kingbutter)
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
[build-system]
|
|
2
|
+
requires = ["setuptools>=64", "setuptools-scm>=8"]
|
|
3
|
+
build-backend = "setuptools.build_meta"
|
|
4
|
+
|
|
5
|
+
[project]
|
|
6
|
+
name = "Mopidy-Jukebox"
|
|
7
|
+
description = "TouchTunes-style touchscreen jukebox UI for Mopidy"
|
|
8
|
+
readme = "README.md"
|
|
9
|
+
requires-python = ">=3.11"
|
|
10
|
+
license = "MIT"
|
|
11
|
+
license-files = ["LICENSE"]
|
|
12
|
+
authors = [{ name = "King Butter" }]
|
|
13
|
+
keywords = ["mopidy", "mopidy-extension", "music", "jukebox", "kiosk", "touchscreen"]
|
|
14
|
+
dynamic = ["version"]
|
|
15
|
+
classifiers = [
|
|
16
|
+
# NB: there is no "Framework :: Mopidy" classifier -- PyPI validates
|
|
17
|
+
# against the official trove list and rejects the upload with a 400 if you
|
|
18
|
+
# invent one. Mopidy's registry finds extensions by the distribution name
|
|
19
|
+
# containing "Mopidy" plus the mopidy.ext entry point, not by classifier.
|
|
20
|
+
"Development Status :: 4 - Beta",
|
|
21
|
+
"Environment :: Web Environment",
|
|
22
|
+
"Intended Audience :: End Users/Desktop",
|
|
23
|
+
"Operating System :: OS Independent",
|
|
24
|
+
"Programming Language :: Python :: 3",
|
|
25
|
+
"Programming Language :: Python :: 3.11",
|
|
26
|
+
"Programming Language :: Python :: 3.12",
|
|
27
|
+
"Programming Language :: Python :: 3.13",
|
|
28
|
+
"Topic :: Multimedia :: Sound/Audio :: Players",
|
|
29
|
+
]
|
|
30
|
+
dependencies = ["Mopidy>=3.4", "Pykka>=3.0", "tornado>=6.0"]
|
|
31
|
+
|
|
32
|
+
[project.optional-dependencies]
|
|
33
|
+
test = ["pytest>=8", "pytest-cov"]
|
|
34
|
+
|
|
35
|
+
[project.urls]
|
|
36
|
+
Homepage = "https://github.com/kingbutter/mopidy-jukebox"
|
|
37
|
+
Issues = "https://github.com/kingbutter/mopidy-jukebox/issues"
|
|
38
|
+
Source = "https://github.com/kingbutter/mopidy-jukebox"
|
|
39
|
+
|
|
40
|
+
[project.entry-points."mopidy.ext"]
|
|
41
|
+
jukebox = "mopidy_jukebox:Extension"
|
|
42
|
+
|
|
43
|
+
[tool.setuptools_scm]
|
|
44
|
+
# Version comes from the git tag, so a release is 'git tag v1.0.1 && push'.
|
|
45
|
+
# Nothing to bump by hand, nothing to get out of sync with PyPI.
|
|
46
|
+
#
|
|
47
|
+
# no-local-version matters for TestPyPI: the default scheme appends a local
|
|
48
|
+
# identifier (1.0.1.dev4+g3f3dafd) and PyPI rejects any version carrying one.
|
|
49
|
+
# Without this, every untagged upload fails. Untagged builds become
|
|
50
|
+
# 1.0.1.dev4, which sorts *before* 1.0.1 -- correct for a pre-release.
|
|
51
|
+
local_scheme = "no-local-version"
|
|
52
|
+
fallback_version = "0.0.0" # building from an sdist with no git history
|
|
53
|
+
|
|
54
|
+
[tool.setuptools.packages.find]
|
|
55
|
+
where = ["src"]
|
|
56
|
+
|
|
57
|
+
[tool.setuptools.package-data]
|
|
58
|
+
"*" = ["ext.conf", "static/*"]
|
|
59
|
+
|
|
60
|
+
[tool.pytest.ini_options]
|
|
61
|
+
testpaths = ["tests"]
|
|
@@ -0,0 +1,97 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: Mopidy-Jukebox
|
|
3
|
+
Version: 1.0.0
|
|
4
|
+
Summary: TouchTunes-style touchscreen jukebox UI for Mopidy
|
|
5
|
+
Author: King Butter
|
|
6
|
+
License-Expression: MIT
|
|
7
|
+
Project-URL: Homepage, https://github.com/kingbutter/mopidy-jukebox
|
|
8
|
+
Project-URL: Issues, https://github.com/kingbutter/mopidy-jukebox/issues
|
|
9
|
+
Project-URL: Source, https://github.com/kingbutter/mopidy-jukebox
|
|
10
|
+
Keywords: mopidy,mopidy-extension,music,jukebox,kiosk,touchscreen
|
|
11
|
+
Classifier: Development Status :: 4 - Beta
|
|
12
|
+
Classifier: Environment :: Web Environment
|
|
13
|
+
Classifier: Intended Audience :: End Users/Desktop
|
|
14
|
+
Classifier: Operating System :: OS Independent
|
|
15
|
+
Classifier: Programming Language :: Python :: 3
|
|
16
|
+
Classifier: Programming Language :: Python :: 3.11
|
|
17
|
+
Classifier: Programming Language :: Python :: 3.12
|
|
18
|
+
Classifier: Programming Language :: Python :: 3.13
|
|
19
|
+
Classifier: Topic :: Multimedia :: Sound/Audio :: Players
|
|
20
|
+
Requires-Python: >=3.11
|
|
21
|
+
Description-Content-Type: text/markdown
|
|
22
|
+
License-File: LICENSE
|
|
23
|
+
Requires-Dist: Mopidy>=3.4
|
|
24
|
+
Requires-Dist: Pykka>=3.0
|
|
25
|
+
Requires-Dist: tornado>=6.0
|
|
26
|
+
Provides-Extra: test
|
|
27
|
+
Requires-Dist: pytest>=8; extra == "test"
|
|
28
|
+
Requires-Dist: pytest-cov; extra == "test"
|
|
29
|
+
Dynamic: license-file
|
|
30
|
+
|
|
31
|
+
# Mopidy-Jukebox
|
|
32
|
+
|
|
33
|
+
[](https://pypi.org/project/Mopidy-Jukebox/)
|
|
34
|
+
[](https://github.com/kingbutter/mopidy-jukebox/actions)
|
|
35
|
+
|
|
36
|
+
A [Mopidy](https://mopidy.com/) extension that turns a touchscreen into a
|
|
37
|
+
TouchTunes-style jukebox. Guests browse album art, spend free credits, and
|
|
38
|
+
queue the next song — from the cabinet itself or from their phone.
|
|
39
|
+
|
|
40
|
+
Built for an actual 1990s TouchTunes Allegro cabinet with a resistive Elo
|
|
41
|
+
panel, so the UI assumes single-touch, no hover, and no keyboard.
|
|
42
|
+
|
|
43
|
+
## What it does
|
|
44
|
+
|
|
45
|
+
- **Art-first browsing.** Categories come from whatever your backends expose;
|
|
46
|
+
albums and artists render as tiles, with drill-down to track lists.
|
|
47
|
+
- **Dialable selection codes.** Track lists page into banks — A1–A10, then
|
|
48
|
+
B1–B10 — and an on-screen keypad lets you punch in a code, the way the
|
|
49
|
+
mechanical machines worked.
|
|
50
|
+
- **Credits.** Free, but rationed: a starting balance and a slow refill, so
|
|
51
|
+
one person can't own the night.
|
|
52
|
+
- **No transport controls for guests.** No pause, no skip, no volume. An
|
|
53
|
+
admin panel hides behind five taps on the credits counter.
|
|
54
|
+
- **Attract mode** built from album art already in the cache.
|
|
55
|
+
- **Phone and kiosk layouts** from one page, with the device's own keyboard
|
|
56
|
+
on phones and a built-in QWERTY on the wall unit.
|
|
57
|
+
|
|
58
|
+
Served from Mopidy's own web server, so the page and the JSON-RPC endpoint
|
|
59
|
+
share an origin — there is no CORS configuration to get wrong.
|
|
60
|
+
|
|
61
|
+
## Installation
|
|
62
|
+
|
|
63
|
+
```sh
|
|
64
|
+
python3 -m pip install Mopidy-Jukebox
|
|
65
|
+
```
|
|
66
|
+
|
|
67
|
+
Then open `http://<your-host>:6680/jukebox/`.
|
|
68
|
+
|
|
69
|
+
## Configuration
|
|
70
|
+
|
|
71
|
+
Defaults are usable as-is. To change them, add a `[jukebox]` section to your
|
|
72
|
+
`mopidy.conf`:
|
|
73
|
+
|
|
74
|
+
```ini
|
|
75
|
+
[jukebox]
|
|
76
|
+
enabled = true
|
|
77
|
+
start_credits = 4 # credits a guest starts with
|
|
78
|
+
max_credits = 8 # ceiling, so credits don't stockpile
|
|
79
|
+
refill_seconds = 600 # one more credit every N seconds
|
|
80
|
+
cost_per_song = 1
|
|
81
|
+
attract_seconds = 90 # idle time before the attract screen
|
|
82
|
+
page_size = 10 # rows per selection bank (A1..A10)
|
|
83
|
+
title = Jukebox
|
|
84
|
+
```
|
|
85
|
+
|
|
86
|
+
Every client reads these from `/jukeboxapi/config.json`, so a change here
|
|
87
|
+
applies to the wall unit and every phone at once.
|
|
88
|
+
|
|
89
|
+
## Project resources
|
|
90
|
+
|
|
91
|
+
- [Source code](https://github.com/kingbutter/mopidy-jukebox)
|
|
92
|
+
- [Issue tracker](https://github.com/kingbutter/mopidy-jukebox/issues)
|
|
93
|
+
|
|
94
|
+
## Credits
|
|
95
|
+
|
|
96
|
+
- Original author: [King Butter](https://github.com/kingbutter)
|
|
97
|
+
- Current maintainer: [King Butter](https://github.com/kingbutter)
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
.gitignore
|
|
2
|
+
LICENSE
|
|
3
|
+
README.md
|
|
4
|
+
pyproject.toml
|
|
5
|
+
.github/workflows/ci.yml
|
|
6
|
+
src/Mopidy_Jukebox.egg-info/PKG-INFO
|
|
7
|
+
src/Mopidy_Jukebox.egg-info/SOURCES.txt
|
|
8
|
+
src/Mopidy_Jukebox.egg-info/dependency_links.txt
|
|
9
|
+
src/Mopidy_Jukebox.egg-info/entry_points.txt
|
|
10
|
+
src/Mopidy_Jukebox.egg-info/requires.txt
|
|
11
|
+
src/Mopidy_Jukebox.egg-info/scm_file_list.json
|
|
12
|
+
src/Mopidy_Jukebox.egg-info/scm_version.json
|
|
13
|
+
src/Mopidy_Jukebox.egg-info/top_level.txt
|
|
14
|
+
src/mopidy_jukebox/__init__.py
|
|
15
|
+
src/mopidy_jukebox/ext.conf
|
|
16
|
+
src/mopidy_jukebox/web.py
|
|
17
|
+
src/mopidy_jukebox/static/index.html
|
|
18
|
+
tests/test_extension.py
|
|
19
|
+
tests/test_web.py
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
{
|
|
2
|
+
"files": [
|
|
3
|
+
"pyproject.toml",
|
|
4
|
+
"LICENSE",
|
|
5
|
+
"README.md",
|
|
6
|
+
".gitignore",
|
|
7
|
+
".github/workflows/ci.yml",
|
|
8
|
+
"tests/test_web.py",
|
|
9
|
+
"tests/test_extension.py",
|
|
10
|
+
"src/mopidy_jukebox/ext.conf",
|
|
11
|
+
"src/mopidy_jukebox/__init__.py",
|
|
12
|
+
"src/mopidy_jukebox/web.py",
|
|
13
|
+
"src/mopidy_jukebox/static/index.html"
|
|
14
|
+
]
|
|
15
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
mopidy_jukebox
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
"""Mopidy-Jukebox -- serves the TouchTunes-style kiosk UI from Mopidy itself.
|
|
2
|
+
|
|
3
|
+
Serving the UI from Mopidy's own web server rather than a separate static
|
|
4
|
+
server means the page and the JSON-RPC endpoint share an origin, which
|
|
5
|
+
removes the CORS configuration entirely -- no allowed_origins, no separate
|
|
6
|
+
systemd unit, no port to remember.
|
|
7
|
+
|
|
8
|
+
http://jukebox.local:6680/jukebox/
|
|
9
|
+
"""
|
|
10
|
+
|
|
11
|
+
import pathlib
|
|
12
|
+
from importlib.metadata import PackageNotFoundError, version
|
|
13
|
+
|
|
14
|
+
from mopidy import config, ext
|
|
15
|
+
|
|
16
|
+
# Single source of truth: the git tag becomes the package version via
|
|
17
|
+
# setuptools-scm, and Mopidy requires Extension.version to match what is on
|
|
18
|
+
# PyPI. Reading it back from the installed metadata keeps them in step.
|
|
19
|
+
try:
|
|
20
|
+
__version__ = version("Mopidy-Jukebox")
|
|
21
|
+
except PackageNotFoundError: # running from a source tree
|
|
22
|
+
__version__ = "0.0.0"
|
|
23
|
+
|
|
24
|
+
|
|
25
|
+
class Extension(ext.Extension):
|
|
26
|
+
dist_name = "Mopidy-Jukebox"
|
|
27
|
+
ext_name = "jukebox"
|
|
28
|
+
version = __version__
|
|
29
|
+
|
|
30
|
+
def get_default_config(self):
|
|
31
|
+
# Read the file directly rather than via config.read(): the helper has
|
|
32
|
+
# moved between Mopidy versions, and this only needs to return text.
|
|
33
|
+
return (pathlib.Path(__file__).parent / "ext.conf").read_text()
|
|
34
|
+
|
|
35
|
+
def get_config_schema(self):
|
|
36
|
+
schema = super().get_config_schema()
|
|
37
|
+
# Guests never get transport controls; these are the knobs that shape
|
|
38
|
+
# what they *can* do. The UI reads them from /jukebox/config.json.
|
|
39
|
+
schema["start_credits"] = config.Integer(minimum=0, maximum=99)
|
|
40
|
+
schema["max_credits"] = config.Integer(minimum=1, maximum=99)
|
|
41
|
+
schema["refill_seconds"] = config.Integer(minimum=10)
|
|
42
|
+
schema["cost_per_song"] = config.Integer(minimum=0, maximum=99)
|
|
43
|
+
schema["attract_seconds"] = config.Integer(minimum=5)
|
|
44
|
+
schema["page_size"] = config.Integer(minimum=4, maximum=26)
|
|
45
|
+
schema["title"] = config.String()
|
|
46
|
+
return schema
|
|
47
|
+
|
|
48
|
+
def setup(self, registry):
|
|
49
|
+
registry.add(
|
|
50
|
+
"http:static",
|
|
51
|
+
{
|
|
52
|
+
"name": self.ext_name,
|
|
53
|
+
"path": str(pathlib.Path(__file__).parent / "static"),
|
|
54
|
+
},
|
|
55
|
+
)
|
|
56
|
+
from .web import app_factory
|
|
57
|
+
|
|
58
|
+
registry.add(
|
|
59
|
+
"http:app",
|
|
60
|
+
{"name": self.ext_name + "api", "factory": app_factory},
|
|
61
|
+
)
|