mopidy-melody 0.1.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.
@@ -0,0 +1,202 @@
1
+
2
+ Apache License
3
+ Version 2.0, January 2004
4
+ http://www.apache.org/licenses/
5
+
6
+ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
7
+
8
+ 1. Definitions.
9
+
10
+ "License" shall mean the terms and conditions for use, reproduction,
11
+ and distribution as defined by Sections 1 through 9 of this document.
12
+
13
+ "Licensor" shall mean the copyright owner or entity authorized by
14
+ the copyright owner that is granting the License.
15
+
16
+ "Legal Entity" shall mean the union of the acting entity and all
17
+ other entities that control, are controlled by, or are under common
18
+ control with that entity. For the purposes of this definition,
19
+ "control" means (i) the power, direct or indirect, to cause the
20
+ direction or management of such entity, whether by contract or
21
+ otherwise, or (ii) ownership of fifty percent (50%) or more of the
22
+ outstanding shares, or (iii) beneficial ownership of such entity.
23
+
24
+ "You" (or "Your") shall mean an individual or Legal Entity
25
+ exercising permissions granted by this License.
26
+
27
+ "Source" form shall mean the preferred form for making modifications,
28
+ including but not limited to software source code, documentation
29
+ source, and configuration files.
30
+
31
+ "Object" form shall mean any form resulting from mechanical
32
+ transformation or translation of a Source form, including but
33
+ not limited to compiled object code, generated documentation,
34
+ and conversions to other media types.
35
+
36
+ "Work" shall mean the work of authorship, whether in Source or
37
+ Object form, made available under the License, as indicated by a
38
+ copyright notice that is included in or attached to the work
39
+ (an example is provided in the Appendix below).
40
+
41
+ "Derivative Works" shall mean any work, whether in Source or Object
42
+ form, that is based on (or derived from) the Work and for which the
43
+ editorial revisions, annotations, elaborations, or other modifications
44
+ represent, as a whole, an original work of authorship. For the purposes
45
+ of this License, Derivative Works shall not include works that remain
46
+ separable from, or merely link (or bind by name) to the interfaces of,
47
+ the Work and Derivative Works thereof.
48
+
49
+ "Contribution" shall mean any work of authorship, including
50
+ the original version of the Work and any modifications or additions
51
+ to that Work or Derivative Works thereof, that is intentionally
52
+ submitted to Licensor for inclusion in the Work by the copyright owner
53
+ or by an individual or Legal Entity authorized to submit on behalf of
54
+ the copyright owner. For the purposes of this definition, "submitted"
55
+ means any form of electronic, verbal, or written communication sent
56
+ to the Licensor or its representatives, including but not limited to
57
+ communication on electronic mailing lists, source code control systems,
58
+ and issue tracking systems that are managed by, or on behalf of, the
59
+ Licensor for the purpose of discussing and improving the Work, but
60
+ excluding communication that is conspicuously marked or otherwise
61
+ designated in writing by the copyright owner as "Not a Contribution."
62
+
63
+ "Contributor" shall mean Licensor and any individual or Legal Entity
64
+ on behalf of whom a Contribution has been received by Licensor and
65
+ subsequently incorporated within the Work.
66
+
67
+ 2. Grant of Copyright License. Subject to the terms and conditions of
68
+ this License, each Contributor hereby grants to You a perpetual,
69
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
70
+ copyright license to reproduce, prepare Derivative Works of,
71
+ publicly display, publicly perform, sublicense, and distribute the
72
+ Work and such Derivative Works in Source or Object form.
73
+
74
+ 3. Grant of Patent License. Subject to the terms and conditions of
75
+ this License, each Contributor hereby grants to You a perpetual,
76
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
77
+ (except as stated in this section) patent license to make, have made,
78
+ use, offer to sell, sell, import, and otherwise transfer the Work,
79
+ where such license applies only to those patent claims licensable
80
+ by such Contributor that are necessarily infringed by their
81
+ Contribution(s) alone or by combination of their Contribution(s)
82
+ with the Work to which such Contribution(s) was submitted. If You
83
+ institute patent litigation against any entity (including a
84
+ cross-claim or counterclaim in a lawsuit) alleging that the Work
85
+ or a Contribution incorporated within the Work constitutes direct
86
+ or contributory patent infringement, then any patent licenses
87
+ granted to You under this License for that Work shall terminate
88
+ as of the date such litigation is filed.
89
+
90
+ 4. Redistribution. You may reproduce and distribute copies of the
91
+ Work or Derivative Works thereof in any medium, with or without
92
+ modifications, and in Source or Object form, provided that You
93
+ meet the following conditions:
94
+
95
+ (a) You must give any other recipients of the Work or
96
+ Derivative Works a copy of this License; and
97
+
98
+ (b) You must cause any modified files to carry prominent notices
99
+ stating that You changed the files; and
100
+
101
+ (c) You must retain, in the Source form of any Derivative Works
102
+ that You distribute, all copyright, patent, trademark, and
103
+ attribution notices from the Source form of the Work,
104
+ excluding those notices that do not pertain to any part of
105
+ the Derivative Works; and
106
+
107
+ (d) If the Work includes a "NOTICE" text file as part of its
108
+ distribution, then any Derivative Works that You distribute must
109
+ include a readable copy of the attribution notices contained
110
+ within such NOTICE file, excluding those notices that do not
111
+ pertain to any part of the Derivative Works, in at least one
112
+ of the following places: within a NOTICE text file distributed
113
+ as part of the Derivative Works; within the Source form or
114
+ documentation, if provided along with the Derivative Works; or,
115
+ within a display generated by the Derivative Works, if and
116
+ wherever such third-party notices normally appear. The contents
117
+ of the NOTICE file are for informational purposes only and
118
+ do not modify the License. You may add Your own attribution
119
+ notices within Derivative Works that You distribute, alongside
120
+ or as an addendum to the NOTICE text from the Work, provided
121
+ that such additional attribution notices cannot be construed
122
+ as modifying the License.
123
+
124
+ You may add Your own copyright statement to Your modifications and
125
+ may provide additional or different license terms and conditions
126
+ for use, reproduction, or distribution of Your modifications, or
127
+ for any such Derivative Works as a whole, provided Your use,
128
+ reproduction, and distribution of the Work otherwise complies with
129
+ the conditions stated in this License.
130
+
131
+ 5. Submission of Contributions. Unless You explicitly state otherwise,
132
+ any Contribution intentionally submitted for inclusion in the Work
133
+ by You to the Licensor shall be under the terms and conditions of
134
+ this License, without any additional terms or conditions.
135
+ Notwithstanding the above, nothing herein shall supersede or modify
136
+ the terms of any separate license agreement you may have executed
137
+ with Licensor regarding such Contributions.
138
+
139
+ 6. Trademarks. This License does not grant permission to use the trade
140
+ names, trademarks, service marks, or product names of the Licensor,
141
+ except as required for reasonable and customary use in describing the
142
+ origin of the Work and reproducing the content of the NOTICE file.
143
+
144
+ 7. Disclaimer of Warranty. Unless required by applicable law or
145
+ agreed to in writing, Licensor provides the Work (and each
146
+ Contributor provides its Contributions) on an "AS IS" BASIS,
147
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
148
+ implied, including, without limitation, any warranties or conditions
149
+ of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
150
+ PARTICULAR PURPOSE. You are solely responsible for determining the
151
+ appropriateness of using or redistributing the Work and assume any
152
+ risks associated with Your exercise of permissions under this License.
153
+
154
+ 8. Limitation of Liability. In no event and under no legal theory,
155
+ whether in tort (including negligence), contract, or otherwise,
156
+ unless required by applicable law (such as deliberate and grossly
157
+ negligent acts) or agreed to in writing, shall any Contributor be
158
+ liable to You for damages, including any direct, indirect, special,
159
+ incidental, or consequential damages of any character arising as a
160
+ result of this License or out of the use or inability to use the
161
+ Work (including but not limited to damages for loss of goodwill,
162
+ work stoppage, computer failure or malfunction, or any and all
163
+ other commercial damages or losses), even if such Contributor
164
+ has been advised of the possibility of such damages.
165
+
166
+ 9. Accepting Warranty or Additional Liability. While redistributing
167
+ the Work or Derivative Works thereof, You may choose to offer,
168
+ and charge a fee for, acceptance of support, warranty, indemnity,
169
+ or other liability obligations and/or rights consistent with this
170
+ License. However, in accepting such obligations, You may act only
171
+ on Your own behalf and on Your sole responsibility, not on behalf
172
+ of any other Contributor, and only if You agree to indemnify,
173
+ defend, and hold each Contributor harmless for any liability
174
+ incurred by, or claims asserted against, such Contributor by reason
175
+ of your accepting any such warranty or additional liability.
176
+
177
+ END OF TERMS AND CONDITIONS
178
+
179
+ APPENDIX: How to apply the Apache License to your work.
180
+
181
+ To apply the Apache License to your work, attach the following
182
+ boilerplate notice, with the fields enclosed by brackets "[]"
183
+ replaced with your own identifying information. (Don't include
184
+ the brackets!) The text should be enclosed in the appropriate
185
+ comment syntax for the file format. We also recommend that a
186
+ file or class name and description of purpose be included on the
187
+ same "printed page" as the copyright notice for easier
188
+ identification within third-party archives.
189
+
190
+ Copyright [yyyy] [name of copyright owner]
191
+
192
+ Licensed under the Apache License, Version 2.0 (the "License");
193
+ you may not use this file except in compliance with the License.
194
+ You may obtain a copy of the License at
195
+
196
+ http://www.apache.org/licenses/LICENSE-2.0
197
+
198
+ Unless required by applicable law or agreed to in writing, software
199
+ distributed under the License is distributed on an "AS IS" BASIS,
200
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
201
+ See the License for the specific language governing permissions and
202
+ limitations under the License.
@@ -0,0 +1,168 @@
1
+ Metadata-Version: 2.4
2
+ Name: mopidy-melody
3
+ Version: 0.1.0
4
+ Summary: Modern, responsive Mopidy web client with smart cover art
5
+ Author-email: Lukas Heinz <94646007+lukasheinz92@users.noreply.github.com>
6
+ License-Expression: Apache-2.0
7
+ Project-URL: Homepage, https://github.com/lukasheinz92/mopidy-melody
8
+ Project-URL: Repository, https://github.com/lukasheinz92/mopidy-melody
9
+ Project-URL: Issues, https://github.com/lukasheinz92/mopidy-melody/issues
10
+ Classifier: Environment :: No Input/Output (Daemon)
11
+ Classifier: Intended Audience :: End Users/Desktop
12
+ Classifier: Operating System :: OS Independent
13
+ Classifier: Topic :: Multimedia :: Sound/Audio :: Players
14
+ Requires-Python: >=3.13
15
+ Description-Content-Type: text/markdown
16
+ License-File: LICENSE
17
+ Requires-Dist: mopidy>=4.0.0
18
+ Requires-Dist: tornado>=6.4
19
+ Requires-Dist: httpx>=0.28
20
+ Requires-Dist: mutagen>=1.47
21
+ Requires-Dist: pillow>=10
22
+ Provides-Extra: dev
23
+ Requires-Dist: pytest>=8; extra == "dev"
24
+ Requires-Dist: ruff>=0.6; extra == "dev"
25
+ Dynamic: license-file
26
+
27
+ # Mopidy-Melody
28
+
29
+ A modern, responsive web client for [Mopidy](https://mopidy.com) 4, written from
30
+ scratch in the spirit of Mopidy-Mobile (it uses the same JSON-RPC core API calls),
31
+ with server-side cover-art resolution and Snapcast multiroom control.
32
+
33
+ Open it at `http://<mopidy-host>:6680/melody/`.
34
+
35
+ > **Note:** This is a personal hobby project, built for a self-hosted home setup
36
+ > and intended for private, non-commercial use. It is provided as is, without
37
+ > warranty or support.
38
+
39
+ ## Features
40
+
41
+ - **Responsive layout**: sidebar and full player bar (optional queue side panel)
42
+ on desktop; bottom tab bar, mini-player and swipe-down full-screen player on mobile
43
+ - **Library**: album and artist grids (Local, Jellyfin, ... as source chips),
44
+ album/artist/playlist pages, a generic browser for every backend (radio,
45
+ YouTube, folders)
46
+ - **Browse & Search** (one page): the backends' browse tiles, and a search across all
47
+ backends in parallel above them; results appear as each backend answers.
48
+ Tapping a song plays just that song (the queue is kept); each result also has
49
+ inline play now / play next / add to queue buttons
50
+ - **Menu**: Settings → Menu reorders and hides items (shared by all clients, stored
51
+ on the server); on phones the first 4 are tabs and the rest sit under "More"
52
+ - **Queue**: drag & drop reordering (mouse and touch), remove, shuffle, clear,
53
+ save as an m3u playlist, repeat/single/random/consume modes
54
+ - **Playlists**: create, add tracks to, remove tracks from, delete (m3u)
55
+ - **Cover art**: resolved and cached on the server, see [Cover art](#cover-art)
56
+ - **Rooms**: Snapcast per-client volume/mute, group mute, stream selection, renaming
57
+ - **Themes**: system/light/dark, accent colour, lock-screen controls (Media Session),
58
+ installable as an app (PWA manifest), keyboard shortcuts (space, shift+←/→, `/`)
59
+
60
+ ## Requirements
61
+
62
+ - Mopidy >= 4.0 (with Mopidy-HTTP enabled), Python >= 3.13
63
+ - Optional: Mopidy-Local (local library and [scan](#local-library-scan)),
64
+ Mopidy-Jellyfin, a Snapcast server (Rooms view)
65
+
66
+ ## Installation
67
+
68
+ ```sh
69
+ pip install mopidy-melody
70
+ # or the latest development version from GitHub
71
+ pip install git+https://github.com/lukasheinz92/mopidy-melody
72
+ # or from a local checkout
73
+ pip install /path/to/mopidy-melody
74
+ ```
75
+
76
+ For Docker, `pip install` it the same way in your Mopidy image's `Dockerfile`.
77
+ The compiled frontend is committed in `src/mopidy_melody/www`, so the image
78
+ needs no Node.js.
79
+
80
+ ## Configuration
81
+
82
+ ```ini
83
+ [melody]
84
+ enabled = true
85
+ title = Melody
86
+ album_uris =
87
+ local:directory?type=album
88
+ jellyfin:albums
89
+ artist_uris =
90
+ local:directory?type=artist&role=albumartist
91
+ jellyfin:artists
92
+ art_local = embedded, folder, backend
93
+ art_jellyfin = jellyfin, backend
94
+ art_other = backend
95
+ art_web = deezer, musicbrainz
96
+ art_size = 1024
97
+ art_timeout = 8
98
+ art_cache_dir =
99
+ # Defaults to the [jellyfin] section's hostname/token
100
+ jellyfin_url =
101
+ jellyfin_token =
102
+ # e.g. http://snapserver:1780 - empty hides the Rooms view
103
+ snapcast_url =
104
+ ```
105
+
106
+ ## Cover art
107
+
108
+ `/melody/api/art?uri=...` resolves images on the server, caches them as scaled
109
+ JPEGs (`art_size`, plus 256/512 px variants), and remembers misses for 24 hours.
110
+ Sources are tried in order, depending on where the item comes from:
111
+
112
+ | Item | Config key | Default |
113
+ |------------------|----------------|-----------------------------|
114
+ | `local:`/`file:` | `art_local` | `embedded, folder, backend` |
115
+ | `jellyfin:` | `art_jellyfin` | `jellyfin, backend` |
116
+ | anything else | `art_other` | `backend` |
117
+ | then, for all | `art_web` | `deezer, musicbrainz` |
118
+
119
+ - `embedded`: pictures in the file's tags (ID3 APIC, FLAC/Ogg pictures, MP4 `covr`)
120
+ - `folder`: `cover.*`, `folder.*`, `front.*`, ... next to the file (`artist.*` for artists)
121
+ - `backend`: whatever the Mopidy backend reports via `core.library.get_images`
122
+ - `jellyfin`: the Jellyfin image API (tracks fall back to their album)
123
+ - `deezer`: Deezer search API (albums, tracks and artist photos, no key needed)
124
+ - `musicbrainz`: MusicBrainz release-group search + Cover Art Archive (rate-limited to 1 request/s)
125
+
126
+ Settings → "Cover art cache → Clear" drops the cache.
127
+
128
+ Wrong or missing cover? "Change cover…" (or "Change picture…" for artists) in a
129
+ track's, album's or artist's menu lets you pick a Deezer/MusicBrainz result, paste
130
+ an image URL or upload a file. Picked covers win over every source, survive
131
+ clearing the cache and can be undone from the same dialog ("Restore automatic").
132
+
133
+ ## Local library scan
134
+
135
+ With Mopidy-Local enabled, Settings → Library → "Local files" runs
136
+ `mopidy local scan` (or `--force` for a full rescan) on the server in the
137
+ background at low CPU priority and shows its progress; only one scan runs at a
138
+ time. Mopidy-Local reads its database on every query, so no restart is needed.
139
+
140
+ ## Persistent data
141
+
142
+ Picked covers (`covers/`) and the shared UI preferences (`prefs.json`) are stored
143
+ in Mopidy's data dir under `melody/` (in Docker:
144
+ `/home/mopidy/.local/share/mopidy/melody`). Mount that directory, or the whole
145
+ `/home/mopidy/.local/share/mopidy` (Mopidy-Local's library lives there too),
146
+ as a volume so they survive container rebuilds.
147
+
148
+ ## Development
149
+
150
+ ```sh
151
+ # Python side
152
+ uv venv --python 3.13 && uv pip install -e ".[dev]"
153
+ pytest && ruff check src tests
154
+
155
+ # Frontend (Svelte 5 + Vite), against a running Mopidy with Melody installed
156
+ cd frontend
157
+ npm install
158
+ MOPIDY_URL=http://<mopidy-host>:6680 npm run dev
159
+ npm run build # writes ../src/mopidy_melody/www
160
+ ```
161
+
162
+ PyGObject doesn't build on Windows; install Mopidy there with
163
+ `uv pip install --no-deps mopidy` plus its other dependencies. The tests never
164
+ touch GStreamer.
165
+
166
+ ## License
167
+
168
+ Apache-2.0
@@ -0,0 +1,142 @@
1
+ # Mopidy-Melody
2
+
3
+ A modern, responsive web client for [Mopidy](https://mopidy.com) 4, written from
4
+ scratch in the spirit of Mopidy-Mobile (it uses the same JSON-RPC core API calls),
5
+ with server-side cover-art resolution and Snapcast multiroom control.
6
+
7
+ Open it at `http://<mopidy-host>:6680/melody/`.
8
+
9
+ > **Note:** This is a personal hobby project, built for a self-hosted home setup
10
+ > and intended for private, non-commercial use. It is provided as is, without
11
+ > warranty or support.
12
+
13
+ ## Features
14
+
15
+ - **Responsive layout**: sidebar and full player bar (optional queue side panel)
16
+ on desktop; bottom tab bar, mini-player and swipe-down full-screen player on mobile
17
+ - **Library**: album and artist grids (Local, Jellyfin, ... as source chips),
18
+ album/artist/playlist pages, a generic browser for every backend (radio,
19
+ YouTube, folders)
20
+ - **Browse & Search** (one page): the backends' browse tiles, and a search across all
21
+ backends in parallel above them; results appear as each backend answers.
22
+ Tapping a song plays just that song (the queue is kept); each result also has
23
+ inline play now / play next / add to queue buttons
24
+ - **Menu**: Settings → Menu reorders and hides items (shared by all clients, stored
25
+ on the server); on phones the first 4 are tabs and the rest sit under "More"
26
+ - **Queue**: drag & drop reordering (mouse and touch), remove, shuffle, clear,
27
+ save as an m3u playlist, repeat/single/random/consume modes
28
+ - **Playlists**: create, add tracks to, remove tracks from, delete (m3u)
29
+ - **Cover art**: resolved and cached on the server, see [Cover art](#cover-art)
30
+ - **Rooms**: Snapcast per-client volume/mute, group mute, stream selection, renaming
31
+ - **Themes**: system/light/dark, accent colour, lock-screen controls (Media Session),
32
+ installable as an app (PWA manifest), keyboard shortcuts (space, shift+←/→, `/`)
33
+
34
+ ## Requirements
35
+
36
+ - Mopidy >= 4.0 (with Mopidy-HTTP enabled), Python >= 3.13
37
+ - Optional: Mopidy-Local (local library and [scan](#local-library-scan)),
38
+ Mopidy-Jellyfin, a Snapcast server (Rooms view)
39
+
40
+ ## Installation
41
+
42
+ ```sh
43
+ pip install mopidy-melody
44
+ # or the latest development version from GitHub
45
+ pip install git+https://github.com/lukasheinz92/mopidy-melody
46
+ # or from a local checkout
47
+ pip install /path/to/mopidy-melody
48
+ ```
49
+
50
+ For Docker, `pip install` it the same way in your Mopidy image's `Dockerfile`.
51
+ The compiled frontend is committed in `src/mopidy_melody/www`, so the image
52
+ needs no Node.js.
53
+
54
+ ## Configuration
55
+
56
+ ```ini
57
+ [melody]
58
+ enabled = true
59
+ title = Melody
60
+ album_uris =
61
+ local:directory?type=album
62
+ jellyfin:albums
63
+ artist_uris =
64
+ local:directory?type=artist&role=albumartist
65
+ jellyfin:artists
66
+ art_local = embedded, folder, backend
67
+ art_jellyfin = jellyfin, backend
68
+ art_other = backend
69
+ art_web = deezer, musicbrainz
70
+ art_size = 1024
71
+ art_timeout = 8
72
+ art_cache_dir =
73
+ # Defaults to the [jellyfin] section's hostname/token
74
+ jellyfin_url =
75
+ jellyfin_token =
76
+ # e.g. http://snapserver:1780 - empty hides the Rooms view
77
+ snapcast_url =
78
+ ```
79
+
80
+ ## Cover art
81
+
82
+ `/melody/api/art?uri=...` resolves images on the server, caches them as scaled
83
+ JPEGs (`art_size`, plus 256/512 px variants), and remembers misses for 24 hours.
84
+ Sources are tried in order, depending on where the item comes from:
85
+
86
+ | Item | Config key | Default |
87
+ |------------------|----------------|-----------------------------|
88
+ | `local:`/`file:` | `art_local` | `embedded, folder, backend` |
89
+ | `jellyfin:` | `art_jellyfin` | `jellyfin, backend` |
90
+ | anything else | `art_other` | `backend` |
91
+ | then, for all | `art_web` | `deezer, musicbrainz` |
92
+
93
+ - `embedded`: pictures in the file's tags (ID3 APIC, FLAC/Ogg pictures, MP4 `covr`)
94
+ - `folder`: `cover.*`, `folder.*`, `front.*`, ... next to the file (`artist.*` for artists)
95
+ - `backend`: whatever the Mopidy backend reports via `core.library.get_images`
96
+ - `jellyfin`: the Jellyfin image API (tracks fall back to their album)
97
+ - `deezer`: Deezer search API (albums, tracks and artist photos, no key needed)
98
+ - `musicbrainz`: MusicBrainz release-group search + Cover Art Archive (rate-limited to 1 request/s)
99
+
100
+ Settings → "Cover art cache → Clear" drops the cache.
101
+
102
+ Wrong or missing cover? "Change cover…" (or "Change picture…" for artists) in a
103
+ track's, album's or artist's menu lets you pick a Deezer/MusicBrainz result, paste
104
+ an image URL or upload a file. Picked covers win over every source, survive
105
+ clearing the cache and can be undone from the same dialog ("Restore automatic").
106
+
107
+ ## Local library scan
108
+
109
+ With Mopidy-Local enabled, Settings → Library → "Local files" runs
110
+ `mopidy local scan` (or `--force` for a full rescan) on the server in the
111
+ background at low CPU priority and shows its progress; only one scan runs at a
112
+ time. Mopidy-Local reads its database on every query, so no restart is needed.
113
+
114
+ ## Persistent data
115
+
116
+ Picked covers (`covers/`) and the shared UI preferences (`prefs.json`) are stored
117
+ in Mopidy's data dir under `melody/` (in Docker:
118
+ `/home/mopidy/.local/share/mopidy/melody`). Mount that directory, or the whole
119
+ `/home/mopidy/.local/share/mopidy` (Mopidy-Local's library lives there too),
120
+ as a volume so they survive container rebuilds.
121
+
122
+ ## Development
123
+
124
+ ```sh
125
+ # Python side
126
+ uv venv --python 3.13 && uv pip install -e ".[dev]"
127
+ pytest && ruff check src tests
128
+
129
+ # Frontend (Svelte 5 + Vite), against a running Mopidy with Melody installed
130
+ cd frontend
131
+ npm install
132
+ MOPIDY_URL=http://<mopidy-host>:6680 npm run dev
133
+ npm run build # writes ../src/mopidy_melody/www
134
+ ```
135
+
136
+ PyGObject doesn't build on Windows; install Mopidy there with
137
+ `uv pip install --no-deps mopidy` plus its other dependencies. The tests never
138
+ touch GStreamer.
139
+
140
+ ## License
141
+
142
+ Apache-2.0
@@ -0,0 +1,52 @@
1
+ [build-system]
2
+ requires = ["setuptools>=75"]
3
+ build-backend = "setuptools.build_meta"
4
+
5
+ [project]
6
+ name = "mopidy-melody"
7
+ version = "0.1.0"
8
+ description = "Modern, responsive Mopidy web client with smart cover art"
9
+ readme = "README.md"
10
+ requires-python = ">=3.13"
11
+ license = "Apache-2.0"
12
+ authors = [{ name = "Lukas Heinz", email = "94646007+lukasheinz92@users.noreply.github.com" }]
13
+ classifiers = [
14
+ "Environment :: No Input/Output (Daemon)",
15
+ "Intended Audience :: End Users/Desktop",
16
+ "Operating System :: OS Independent",
17
+ "Topic :: Multimedia :: Sound/Audio :: Players",
18
+ ]
19
+ dependencies = [
20
+ "mopidy>=4.0.0",
21
+ "tornado>=6.4",
22
+ "httpx>=0.28",
23
+ "mutagen>=1.47",
24
+ "pillow>=10",
25
+ ]
26
+
27
+ [project.urls]
28
+ Homepage = "https://github.com/lukasheinz92/mopidy-melody"
29
+ Repository = "https://github.com/lukasheinz92/mopidy-melody"
30
+ Issues = "https://github.com/lukasheinz92/mopidy-melody/issues"
31
+
32
+ [project.optional-dependencies]
33
+ dev = ["pytest>=8", "ruff>=0.6"]
34
+
35
+ [project.entry-points."mopidy.ext"]
36
+ melody = "mopidy_melody:Extension"
37
+
38
+ [tool.setuptools.packages.find]
39
+ where = ["src"]
40
+
41
+ [tool.setuptools.package-data]
42
+ mopidy_melody = ["ext.conf", "www/*", "www/**/*"]
43
+
44
+ [tool.pytest.ini_options]
45
+ testpaths = ["tests"]
46
+
47
+ [tool.ruff]
48
+ target-version = "py313"
49
+ line-length = 88
50
+
51
+ [tool.ruff.lint]
52
+ select = ["E", "F", "I", "B", "UP", "SIM", "RUF"]
@@ -0,0 +1,4 @@
1
+ [egg_info]
2
+ tag_build =
3
+ tag_date = 0
4
+
@@ -0,0 +1,59 @@
1
+ from __future__ import annotations
2
+
3
+ import pathlib
4
+ from importlib.metadata import version
5
+ from typing import TYPE_CHECKING, Any
6
+
7
+ from mopidy import config, ext
8
+
9
+ if TYPE_CHECKING:
10
+ from mopidy.core import CoreProxy
11
+
12
+ __version__ = version("mopidy-melody")
13
+
14
+ ART_SOURCES = ("embedded", "folder", "backend", "jellyfin", "deezer", "musicbrainz")
15
+
16
+
17
+ class Extension(ext.Extension):
18
+ dist_name = "mopidy-melody"
19
+ ext_name = "melody"
20
+ version = __version__
21
+
22
+ def get_default_config(self) -> str:
23
+ return config.read(pathlib.Path(__file__).parent / "ext.conf")
24
+
25
+ def get_config_schema(self) -> config.ConfigSchema:
26
+ schema = super().get_config_schema()
27
+ schema["title"] = config.String()
28
+ schema["album_uris"] = config.List(optional=True)
29
+ schema["artist_uris"] = config.List(optional=True)
30
+ for key in ("art_local", "art_jellyfin", "art_other", "art_web"):
31
+ schema[key] = config.List(optional=True)
32
+ schema["art_size"] = config.Integer(minimum=128, maximum=4096)
33
+ schema["art_timeout"] = config.Integer(minimum=1, maximum=60)
34
+ schema["art_cache_dir"] = config.Path(optional=True)
35
+ schema["jellyfin_url"] = config.String(optional=True)
36
+ schema["jellyfin_token"] = config.Secret(optional=True)
37
+ schema["snapcast_url"] = config.String(optional=True)
38
+ return schema
39
+
40
+ def setup(self, registry: ext.Registry) -> None:
41
+ registry.add("http:app", {"name": self.ext_name, "factory": factory})
42
+
43
+
44
+ def factory(config: dict[str, Any], core: CoreProxy) -> list[tuple]:
45
+ from .art import ArtResolver
46
+ from .scan import LocalScanner
47
+ from .web import Prefs, make_handlers
48
+
49
+ # User choices (covers, menu) live in the data dir so they survive cache
50
+ # clears; mount it as a volume in Docker.
51
+ data_dir = Extension.get_data_dir(config)
52
+ resolver = ArtResolver(
53
+ config, core, Extension.get_cache_dir(config), data_dir / "covers"
54
+ )
55
+ local = config.get("local") or {}
56
+ scanner = LocalScanner() if local.get("enabled") else None
57
+ return make_handlers(
58
+ config, core, resolver, Prefs(data_dir / "prefs.json"), scanner
59
+ )