codetta 0.8.3__tar.gz → 0.8.5__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.
Files changed (98) hide show
  1. {codetta-0.8.3/src/codetta.egg-info → codetta-0.8.5}/PKG-INFO +17 -17
  2. {codetta-0.8.3 → codetta-0.8.5}/README.md +15 -15
  3. {codetta-0.8.3 → codetta-0.8.5}/pyproject.toml +2 -2
  4. {codetta-0.8.3 → codetta-0.8.5}/src/codetta/CHANGELOG.md +32 -0
  5. {codetta-0.8.3 → codetta-0.8.5}/src/codetta/core/engine.py +16 -0
  6. codetta-0.8.5/src/codetta/core/fileinfo.py +99 -0
  7. {codetta-0.8.3 → codetta-0.8.5}/src/codetta/core/index.py +18 -1
  8. {codetta-0.8.3 → codetta-0.8.5}/src/codetta/core/library.py +9 -1
  9. codetta-0.8.5/src/codetta/core/logbuffer.py +73 -0
  10. {codetta-0.8.3 → codetta-0.8.5}/src/codetta/core/organize.py +27 -2
  11. {codetta-0.8.3 → codetta-0.8.5}/src/codetta/core/presets.py +17 -1
  12. {codetta-0.8.3 → codetta-0.8.5}/src/codetta/core/rawtags.py +5 -1
  13. {codetta-0.8.3 → codetta-0.8.5}/src/codetta/core/tagmap.py +77 -0
  14. {codetta-0.8.3 → codetta-0.8.5}/src/codetta/web/app.py +226 -7
  15. {codetta-0.8.3 → codetta-0.8.5}/src/codetta/web/static/app.css +146 -0
  16. {codetta-0.8.3 → codetta-0.8.5}/src/codetta/web/static/app.js +394 -22
  17. {codetta-0.8.3 → codetta-0.8.5}/src/codetta/web/static/index.html +18 -0
  18. {codetta-0.8.3 → codetta-0.8.5/src/codetta.egg-info}/PKG-INFO +17 -17
  19. {codetta-0.8.3 → codetta-0.8.5}/src/codetta.egg-info/SOURCES.txt +3 -0
  20. {codetta-0.8.3 → codetta-0.8.5}/tests/test_api.py +1 -1
  21. {codetta-0.8.3 → codetta-0.8.5}/tests/test_attacks.py +4 -1
  22. codetta-0.8.5/tests/test_files.py +160 -0
  23. {codetta-0.8.3 → codetta-0.8.5}/tests/test_inbox.py +22 -2
  24. {codetta-0.8.3 → codetta-0.8.5}/tests/test_index.py +25 -0
  25. {codetta-0.8.3 → codetta-0.8.5}/tests/test_presets.py +24 -2
  26. {codetta-0.8.3 → codetta-0.8.5}/tests/test_safety.py +76 -0
  27. {codetta-0.8.3 → codetta-0.8.5}/tests/test_security.py +15 -0
  28. {codetta-0.8.3 → codetta-0.8.5}/LICENSE +0 -0
  29. {codetta-0.8.3 → codetta-0.8.5}/setup.cfg +0 -0
  30. {codetta-0.8.3 → codetta-0.8.5}/src/codetta/__init__.py +0 -0
  31. {codetta-0.8.3 → codetta-0.8.5}/src/codetta/__main__.py +0 -0
  32. {codetta-0.8.3 → codetta-0.8.5}/src/codetta/cli/__init__.py +0 -0
  33. {codetta-0.8.3 → codetta-0.8.5}/src/codetta/cli/__main__.py +0 -0
  34. {codetta-0.8.3 → codetta-0.8.5}/src/codetta/cli/run.py +0 -0
  35. {codetta-0.8.3 → codetta-0.8.5}/src/codetta/core/__init__.py +0 -0
  36. {codetta-0.8.3 → codetta-0.8.5}/src/codetta/core/acoustid.py +0 -0
  37. {codetta-0.8.3 → codetta-0.8.5}/src/codetta/core/activity.py +0 -0
  38. {codetta-0.8.3 → codetta-0.8.5}/src/codetta/core/artwork.py +0 -0
  39. {codetta-0.8.3 → codetta-0.8.5}/src/codetta/core/auth.py +0 -0
  40. {codetta-0.8.3 → codetta-0.8.5}/src/codetta/core/avatar.py +0 -0
  41. {codetta-0.8.3 → codetta-0.8.5}/src/codetta/core/changelog.py +0 -0
  42. {codetta-0.8.3 → codetta-0.8.5}/src/codetta/core/connections.py +0 -0
  43. {codetta-0.8.3 → codetta-0.8.5}/src/codetta/core/describe.py +0 -0
  44. {codetta-0.8.3 → codetta-0.8.5}/src/codetta/core/health.py +0 -0
  45. {codetta-0.8.3 → codetta-0.8.5}/src/codetta/core/inbox.py +0 -0
  46. {codetta-0.8.3 → codetta-0.8.5}/src/codetta/core/musicbrainz.py +0 -0
  47. {codetta-0.8.3 → codetta-0.8.5}/src/codetta/core/notifications.py +0 -0
  48. {codetta-0.8.3 → codetta-0.8.5}/src/codetta/core/onboarding.py +0 -0
  49. {codetta-0.8.3 → codetta-0.8.5}/src/codetta/core/plugins.py +0 -0
  50. {codetta-0.8.3 → codetta-0.8.5}/src/codetta/core/providers.py +0 -0
  51. {codetta-0.8.3 → codetta-0.8.5}/src/codetta/core/slskd.py +0 -0
  52. {codetta-0.8.3 → codetta-0.8.5}/src/codetta/core/undo.py +0 -0
  53. {codetta-0.8.3 → codetta-0.8.5}/src/codetta/core/updates.py +0 -0
  54. {codetta-0.8.3 → codetta-0.8.5}/src/codetta/plugins/__init__.py +0 -0
  55. {codetta-0.8.3 → codetta-0.8.5}/src/codetta/plugins/builtin/__init__.py +0 -0
  56. {codetta-0.8.3 → codetta-0.8.5}/src/codetta/plugins/builtin/tidy.py +0 -0
  57. {codetta-0.8.3 → codetta-0.8.5}/src/codetta/web/__init__.py +0 -0
  58. {codetta-0.8.3 → codetta-0.8.5}/src/codetta/web/security.py +0 -0
  59. {codetta-0.8.3 → codetta-0.8.5}/src/codetta/web/static/apple-touch-icon.png +0 -0
  60. {codetta-0.8.3 → codetta-0.8.5}/src/codetta/web/static/fonts/LICENSE-Inter.txt +0 -0
  61. {codetta-0.8.3 → codetta-0.8.5}/src/codetta/web/static/fonts/LICENSE-SchibstedGrotesk.txt +0 -0
  62. {codetta-0.8.3 → codetta-0.8.5}/src/codetta/web/static/fonts/inter-cyrillic.woff2 +0 -0
  63. {codetta-0.8.3 → codetta-0.8.5}/src/codetta/web/static/fonts/schibsted-grotesk.woff2 +0 -0
  64. {codetta-0.8.3 → codetta-0.8.5}/src/codetta/web/static/icon.svg +0 -0
  65. {codetta-0.8.3 → codetta-0.8.5}/src/codetta/web/static/icons/codetta-dark.png +0 -0
  66. {codetta-0.8.3 → codetta-0.8.5}/src/codetta/web/static/icons/codetta-dark.svg +0 -0
  67. {codetta-0.8.3 → codetta-0.8.5}/src/codetta/web/static/icons/codetta-dark.webp +0 -0
  68. {codetta-0.8.3 → codetta-0.8.5}/src/codetta/web/static/icons/codetta-light.png +0 -0
  69. {codetta-0.8.3 → codetta-0.8.5}/src/codetta/web/static/icons/codetta-light.svg +0 -0
  70. {codetta-0.8.3 → codetta-0.8.5}/src/codetta/web/static/icons/codetta-light.webp +0 -0
  71. {codetta-0.8.3 → codetta-0.8.5}/src/codetta/web/static/icons/codetta.png +0 -0
  72. {codetta-0.8.3 → codetta-0.8.5}/src/codetta/web/static/icons/codetta.svg +0 -0
  73. {codetta-0.8.3 → codetta-0.8.5}/src/codetta/web/static/icons/codetta.webp +0 -0
  74. {codetta-0.8.3 → codetta-0.8.5}/src/codetta/web/static/theme.js +0 -0
  75. {codetta-0.8.3 → codetta-0.8.5}/src/codetta.egg-info/dependency_links.txt +0 -0
  76. {codetta-0.8.3 → codetta-0.8.5}/src/codetta.egg-info/entry_points.txt +0 -0
  77. {codetta-0.8.3 → codetta-0.8.5}/src/codetta.egg-info/requires.txt +0 -0
  78. {codetta-0.8.3 → codetta-0.8.5}/src/codetta.egg-info/top_level.txt +0 -0
  79. {codetta-0.8.3 → codetta-0.8.5}/tests/test_acoustid.py +0 -0
  80. {codetta-0.8.3 → codetta-0.8.5}/tests/test_artwork.py +0 -0
  81. {codetta-0.8.3 → codetta-0.8.5}/tests/test_auth.py +0 -0
  82. {codetta-0.8.3 → codetta-0.8.5}/tests/test_avatar.py +0 -0
  83. {codetta-0.8.3 → codetta-0.8.5}/tests/test_cli_run.py +0 -0
  84. {codetta-0.8.3 → codetta-0.8.5}/tests/test_connections.py +0 -0
  85. {codetta-0.8.3 → codetta-0.8.5}/tests/test_efficiency.py +0 -0
  86. {codetta-0.8.3 → codetta-0.8.5}/tests/test_engine.py +0 -0
  87. {codetta-0.8.3 → codetta-0.8.5}/tests/test_explore.py +0 -0
  88. {codetta-0.8.3 → codetta-0.8.5}/tests/test_health.py +0 -0
  89. {codetta-0.8.3 → codetta-0.8.5}/tests/test_musicbrainz.py +0 -0
  90. {codetta-0.8.3 → codetta-0.8.5}/tests/test_organize.py +0 -0
  91. {codetta-0.8.3 → codetta-0.8.5}/tests/test_plugins.py +0 -0
  92. {codetta-0.8.3 → codetta-0.8.5}/tests/test_privacy.py +0 -0
  93. {codetta-0.8.3 → codetta-0.8.5}/tests/test_providers.py +0 -0
  94. {codetta-0.8.3 → codetta-0.8.5}/tests/test_rawtags.py +0 -0
  95. {codetta-0.8.3 → codetta-0.8.5}/tests/test_slskd.py +0 -0
  96. {codetta-0.8.3 → codetta-0.8.5}/tests/test_soulseek_api.py +0 -0
  97. {codetta-0.8.3 → codetta-0.8.5}/tests/test_undo.py +0 -0
  98. {codetta-0.8.3 → codetta-0.8.5}/tests/test_updates.py +0 -0
@@ -1,8 +1,8 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: codetta
3
- Version: 0.8.3
3
+ Version: 0.8.5
4
4
  Summary: A private, self-hosted music library manager: tags, MusicBrainz matching, batch editing and organizing, in your browser
5
- Author: Gavin Griggs
5
+ Author: gavndev
6
6
  License-Expression: AGPL-3.0-or-later
7
7
  Project-URL: Homepage, https://github.com/gavndev/codetta
8
8
  Project-URL: Documentation, https://github.com/gavndev/codetta/tree/main/docs
@@ -31,8 +31,8 @@ Dynamic: license-file
31
31
 
32
32
  <p align="center">
33
33
  <picture>
34
- <source media="(prefers-color-scheme: dark)" srcset="docs/media/hero-dark.gif">
35
- <img src="docs/media/hero-light.gif" alt="Codetta: your music library, looked after. Fix tags, match albums on MusicBrainz and organize your files, from any browser." width="900">
34
+ <source media="(prefers-color-scheme: dark)" srcset="docs/brand/logo-dark.svg">
35
+ <img src="docs/brand/logo-light.svg" alt="Codetta" height="64">
36
36
  </picture>
37
37
  </p>
38
38
 
@@ -44,7 +44,7 @@ Dynamic: license-file
44
44
 
45
45
  <p align="center">
46
46
  <img alt="Status: alpha" src="https://img.shields.io/badge/status-alpha-f59e0b">
47
- <img alt="Version 0.8.3" src="https://img.shields.io/badge/version-0.8.3-0e7c74">
47
+ <img alt="Version 0.8.5" src="https://img.shields.io/badge/version-0.8.5-0e7c74">
48
48
  <a href="LICENSE"><img alt="License: AGPL-3.0" src="https://img.shields.io/badge/license-AGPL--3.0-555"></a>
49
49
  <img alt="Python 3.14" src="https://img.shields.io/badge/python-3.14-3776ab">
50
50
  <a href="https://github.com/gavndev/codetta/actions/workflows/ci.yml"><img alt="Tests" src="https://github.com/gavndev/codetta/actions/workflows/ci.yml/badge.svg"></a>
@@ -53,7 +53,10 @@ Dynamic: license-file
53
53
  </p>
54
54
 
55
55
  <p align="center">
56
- <img src="docs/media/overview.gif" alt="A tour of Codetta: editing an album's tags, searching the library by tag, looking up an artist on MusicBrainz, a one-tap Library health fix, the player with synced lyrics, and the account panel" width="900">
56
+ <picture>
57
+ <source media="(prefers-color-scheme: dark)" srcset="docs/media/hero-dark.gif">
58
+ <img src="docs/media/hero-light.gif" alt="Codetta: your music library, looked after. Fix tags, match albums on MusicBrainz and organize your files, from any browser." width="900">
59
+ </picture>
57
60
  </p>
58
61
 
59
62
  <p align="center">
@@ -112,8 +115,8 @@ Runs on Intel/AMD and ARM, from a Raspberry Pi 4 up: about a 100 MB download
112
115
  and 70 MB of memory (about 130 MB at 100,000 tracks), and no disk activity when idle. The
113
116
  [install guide](docs/install.md) walks through every step, including updates.
114
117
 
115
- No server? Run it on your own computer instead:
116
- `pipx install codetta`, then `codetta`
118
+ No server? Run it on your own computer instead: `pipx install codetta`
119
+ (or `sudo snap install codetta` on Ubuntu), then `codetta`
117
120
  ([details](docs/install.md#on-your-own-computer)).
118
121
 
119
122
  ## What Codetta does
@@ -259,14 +262,10 @@ light and dark themes. [See every feature →](docs/features.md)
259
262
 
260
263
  ## What's new
261
264
 
262
- **0.6.x:** a security sweep and a faster app (compressed pages, quicker
263
- folders), download progress in the inbox, a roomier top bar on phones, and an
264
- optional slskd integration.
265
- **0.5.0:** the import inbox, Organize (rename and move from a pattern), quick
266
- listen with a now-playing pill, multi-disc albums, setup steps, What's new and
267
- notifications.
268
- **0.4.0:** offline unless you opt in; Match on MusicBrainz and identify by
269
- sound with AcoustID. All changes are in the [changelog](CHANGELOG.md).
265
+ Every change is in the [changelog](CHANGELOG.md); each version's notes are also on
266
+ [GitHub Releases](https://github.com/gavndev/codetta/releases). Inside Codetta,
267
+ **What's new** (in the account menu, or the link in the footer) shows the same notes for the
268
+ version you're running.
270
269
 
271
270
  ## License
272
271
 
@@ -279,4 +278,5 @@ Built with [mutagen](https://github.com/quodlibet/mutagen),
279
278
  [Schibsted Grotesk](https://github.com/schibsted/schibsted-grotesk) typeface.
280
279
  Tag mappings follow [MusicBrainz Picard](https://picard.musicbrainz.org/docs/mappings/).
281
280
  The optional Soulseek integration talks to [slskd](https://github.com/slskd/slskd) over its API.
282
- The artists and albums in the screenshots are made up.
281
+ The header and screenshots show real releases for illustration (the covers belong to their
282
+ artists and labels; the audio files are silent stand-ins); the feature GIFs use made-up music.
@@ -1,7 +1,7 @@
1
1
  <p align="center">
2
2
  <picture>
3
- <source media="(prefers-color-scheme: dark)" srcset="docs/media/hero-dark.gif">
4
- <img src="docs/media/hero-light.gif" alt="Codetta: your music library, looked after. Fix tags, match albums on MusicBrainz and organize your files, from any browser." width="900">
3
+ <source media="(prefers-color-scheme: dark)" srcset="docs/brand/logo-dark.svg">
4
+ <img src="docs/brand/logo-light.svg" alt="Codetta" height="64">
5
5
  </picture>
6
6
  </p>
7
7
 
@@ -13,7 +13,7 @@
13
13
 
14
14
  <p align="center">
15
15
  <img alt="Status: alpha" src="https://img.shields.io/badge/status-alpha-f59e0b">
16
- <img alt="Version 0.8.3" src="https://img.shields.io/badge/version-0.8.3-0e7c74">
16
+ <img alt="Version 0.8.5" src="https://img.shields.io/badge/version-0.8.5-0e7c74">
17
17
  <a href="LICENSE"><img alt="License: AGPL-3.0" src="https://img.shields.io/badge/license-AGPL--3.0-555"></a>
18
18
  <img alt="Python 3.14" src="https://img.shields.io/badge/python-3.14-3776ab">
19
19
  <a href="https://github.com/gavndev/codetta/actions/workflows/ci.yml"><img alt="Tests" src="https://github.com/gavndev/codetta/actions/workflows/ci.yml/badge.svg"></a>
@@ -22,7 +22,10 @@
22
22
  </p>
23
23
 
24
24
  <p align="center">
25
- <img src="docs/media/overview.gif" alt="A tour of Codetta: editing an album's tags, searching the library by tag, looking up an artist on MusicBrainz, a one-tap Library health fix, the player with synced lyrics, and the account panel" width="900">
25
+ <picture>
26
+ <source media="(prefers-color-scheme: dark)" srcset="docs/media/hero-dark.gif">
27
+ <img src="docs/media/hero-light.gif" alt="Codetta: your music library, looked after. Fix tags, match albums on MusicBrainz and organize your files, from any browser." width="900">
28
+ </picture>
26
29
  </p>
27
30
 
28
31
  <p align="center">
@@ -81,8 +84,8 @@ Runs on Intel/AMD and ARM, from a Raspberry Pi 4 up: about a 100 MB download
81
84
  and 70 MB of memory (about 130 MB at 100,000 tracks), and no disk activity when idle. The
82
85
  [install guide](docs/install.md) walks through every step, including updates.
83
86
 
84
- No server? Run it on your own computer instead:
85
- `pipx install codetta`, then `codetta`
87
+ No server? Run it on your own computer instead: `pipx install codetta`
88
+ (or `sudo snap install codetta` on Ubuntu), then `codetta`
86
89
  ([details](docs/install.md#on-your-own-computer)).
87
90
 
88
91
  ## What Codetta does
@@ -228,14 +231,10 @@ light and dark themes. [See every feature →](docs/features.md)
228
231
 
229
232
  ## What's new
230
233
 
231
- **0.6.x:** a security sweep and a faster app (compressed pages, quicker
232
- folders), download progress in the inbox, a roomier top bar on phones, and an
233
- optional slskd integration.
234
- **0.5.0:** the import inbox, Organize (rename and move from a pattern), quick
235
- listen with a now-playing pill, multi-disc albums, setup steps, What's new and
236
- notifications.
237
- **0.4.0:** offline unless you opt in; Match on MusicBrainz and identify by
238
- sound with AcoustID. All changes are in the [changelog](CHANGELOG.md).
234
+ Every change is in the [changelog](CHANGELOG.md); each version's notes are also on
235
+ [GitHub Releases](https://github.com/gavndev/codetta/releases). Inside Codetta,
236
+ **What's new** (in the account menu, or the link in the footer) shows the same notes for the
237
+ version you're running.
239
238
 
240
239
  ## License
241
240
 
@@ -248,4 +247,5 @@ Built with [mutagen](https://github.com/quodlibet/mutagen),
248
247
  [Schibsted Grotesk](https://github.com/schibsted/schibsted-grotesk) typeface.
249
248
  Tag mappings follow [MusicBrainz Picard](https://picard.musicbrainz.org/docs/mappings/).
250
249
  The optional Soulseek integration talks to [slskd](https://github.com/slskd/slskd) over its API.
251
- The artists and albums in the screenshots are made up.
250
+ The header and screenshots show real releases for illustration (the covers belong to their
251
+ artists and labels; the audio files are silent stand-ins); the feature GIFs use made-up music.
@@ -4,10 +4,10 @@ build-backend = "setuptools.build_meta"
4
4
 
5
5
  [project]
6
6
  name = "codetta"
7
- version = "0.8.3"
7
+ version = "0.8.5"
8
8
  description = "A private, self-hosted music library manager: tags, MusicBrainz matching, batch editing and organizing, in your browser"
9
9
  readme = "README.md"
10
- authors = [{ name = "Gavin Griggs" }]
10
+ authors = [{ name = "gavndev" }]
11
11
  keywords = ["music", "tags", "tagger", "metadata", "musicbrainz", "flac", "id3", "self-hosted", "library", "organizer"]
12
12
  classifiers = [
13
13
  "Development Status :: 4 - Beta",
@@ -2,6 +2,38 @@
2
2
 
3
3
  All notable changes to Codetta. Versions follow [Semantic Versioning](https://semver.org/).
4
4
 
5
+ ## 0.8.5 (2026-11-19)
6
+
7
+ - **Right-click menu (long press on phones):** for any track or folder: Rename, Move to, Select, Actions, Get info, Find in MusicBrainz, Find in slskd and Delete. It's small and quick, opens right where you clicked, and works on a selection too.
8
+ - **Get info** shows what the tags don't: format, bit depth, sample rate, bitrate, file size, tag type, cover size and location.
9
+ - **Delete** asks once, then moves things to *Recently deleted* for 30 days instead of erasing them, and Activity can bring them back.
10
+ - The MusicBrainz and slskd entries keep their colours.
11
+ - **Move to** and **Rename** work like Organize: nothing is ever overwritten, lyrics files follow their song, and one tap undoes it.
12
+ - **Advanced mode, deeper:** switch it on in the account menu for a closer look at your files.
13
+ - Every field in the editor shows how this file actually stores it, in a code font: `TPE1` in an MP3, `©ART` in an M4A, `ARTIST` in a FLAC, or "not in WMA" when the format can't hold it.
14
+ - **Get info** adds the encoder, how many of Codetta's fields the format can store, and the file's full location on the server.
15
+ - **Server log:** a live view of Codetta's own log (what `docker logs` shows) at the bottom of the account menu. It's kept in memory only, only you can see it, it never includes who visited, and anything that looks like a key or password is masked.
16
+ - **Fixed:** the raw tag view in Advanced mode failed on M4A files marked as a compilation, and showed production credits in MP3s as unreadable code.
17
+ - **Privacy:** a failed sign-in no longer writes the typed username to the log (people sometimes type their password there by mistake).
18
+ - **Explicit and Clean presets:** mark a folder or a selection as explicit or clean in one go. They set the advisory tag Navidrome and Apple Music read (1 = explicit, 2 = clean), in every format, including Apple's own field in M4A files. The tag also shows in the editor as **Explicit**, under Release.
19
+
20
+ ## 0.8.4 (2026-11-19)
21
+
22
+ - **Covers in the grid view:** switch the Library to the grid and every folder shows the cover of an album inside it, artists included. Nothing extra is read from your disk: the covers come from the search index.
23
+ - **Easier to tap on phones:** every button, field and toggle is now at least 44 points tall, as Apple recommends. The search bar responds anywhere you tap it, not just on a thin strip in the middle.
24
+ - **Selecting tracks on a phone:** the bar at the bottom no longer runs off the screen. Preset, Replace and Actions now share a "…" menu next to Edit.
25
+ - **Safer moves:** Organize, Rename folder and the inbox now move a file in a way that can never replace another file that appears at the same name at the last moment (say, a download finishing). Very long file names also move between disks correctly now.
26
+ - **Saves survive power cuts better:** after a file is safely swapped in, its folder is flushed to disk too.
27
+ - **Fixed:** filing the same inbox album twice at once (a double tap, or "File all" while it was filing itself) could mark a successfully filed album as failed. A second request is now turned away.
28
+ - **Fixed:** a double tap on Undo could run the same undo twice, and undoing a move whose folder no longer exists showed a server error instead of saying why.
29
+ - **Fixed:** after saving, going back to a search or a grid could still show the old tags or cover until you reloaded.
30
+ - **Fixed:** a MusicBrainz match that saved the tags but not the cover left search and Library health showing the old tags.
31
+ - **Fixed:** pressing Ctrl/Cmd+S twice quickly saved everything twice (and logged it twice). A save already under way now just carries on.
32
+ - The "/" shortcut for search no longer jumps behind an open dialog.
33
+ - **Fixed:** applying a Tag Preset to a folder stopped part-way if one file couldn't be opened (say, a permissions problem), and the files it had already changed weren't in Activity, so they couldn't be undone. Now that one file is reported and the rest carry on, all undoable.
34
+ - **Library health's one-tap fixes** check the album again first if anything changed since the list was made.
35
+ - **What's new** shows its links properly (they opened as plain text before) and they now open on GitHub.
36
+
5
37
  ## 0.8.3 (2026-11-19)
6
38
 
7
39
  (0.8.2 was tagged but never released: our tests caught the Library health bug below just in time.)
@@ -306,6 +306,7 @@ class MetadataEngine:
306
306
  # client still seeding it) keeps the original bytes.
307
307
  os.replace(temp_path, target)
308
308
  temp_path = None
309
+ _fsync_dir(target.parent) # and the new name too, so a power cut can't undo the swap
309
310
  except OSError as exc:
310
311
  raise MetadataError(f"Could not write to {path}: {exc}") from exc
311
312
  finally:
@@ -459,6 +460,21 @@ def _normalize_value(value: TagValue) -> list[str]:
459
460
  return [] if all(v == "" for v in values) else values
460
461
 
461
462
 
463
+ def _fsync_dir(folder: Path) -> None:
464
+ """Flush a folder's entries (a rename) to disk. Best effort: not every system or
465
+ filesystem supports it (Windows, some network shares), and the data is already safe."""
466
+ try:
467
+ fd = os.open(folder, os.O_RDONLY | getattr(os, "O_DIRECTORY", 0))
468
+ except OSError:
469
+ return
470
+ try:
471
+ os.fsync(fd)
472
+ except OSError:
473
+ pass
474
+ finally:
475
+ os.close(fd)
476
+
477
+
462
478
  def _copy_ownership(source: Path, dest: Path) -> None:
463
479
  """Give ``dest`` the same owner/group as ``source`` where permitted.
464
480
 
@@ -0,0 +1,99 @@
1
+ """Get info: details about a file or folder beyond its tags (format, quality, size, dates)."""
2
+
3
+ from __future__ import annotations
4
+
5
+ import os
6
+ from pathlib import Path
7
+
8
+ from codetta.core.engine import SUPPORTED_EXTENSIONS, MetadataEngine, _open_raw
9
+ from codetta.core.artwork import read_picture
10
+ from codetta.core.tagmap import FIELDS, is_tag_supported
11
+
12
+ MAX_FOLDER_FILES = 20_000 # counting stops here, so a huge folder answers quickly
13
+
14
+
15
+ def _tag_kind(audio) -> str | None:
16
+ """The kind of tag block the file carries, e.g. "ID3v2.4", "Vorbis comments", "MP4 atoms"."""
17
+ tags = getattr(audio, "tags", None)
18
+ if tags is None:
19
+ return None
20
+ name = type(tags).__name__
21
+ if name.startswith("ID3"):
22
+ version = getattr(tags, "version", None)
23
+ return f"ID3v{version[0]}.{version[1]}" if version else "ID3"
24
+ return {"VCFLACDict": "Vorbis comments", "VComment": "Vorbis comments", "OggVCommentDict": "Vorbis comments",
25
+ "OggOpusVComment": "Vorbis comments", "OggFLACVComment": "Vorbis comments", "OggSpeexVComment": "Vorbis comments",
26
+ "MP4Tags": "MP4 atoms", "APEv2": "APEv2", "ASFTags": "ASF attributes"}.get(name, name)
27
+
28
+
29
+ def _encoder(audio) -> str | None:
30
+ """What made the file ("LAME 3.100", "Lavf62.3.100"...), when it says."""
31
+ tags = getattr(audio, "tags", None)
32
+ if not tags:
33
+ return None
34
+ for key in ("TSSE", "TENC", "©too", "encoder", "ENCODER", "Encoder", "WM/EncodingSettings", "WM/ToolName"):
35
+ try:
36
+ value = tags.get(key) if hasattr(tags, "get") else None
37
+ except (KeyError, ValueError, TypeError):
38
+ value = None
39
+ if value:
40
+ text = str(value[0] if isinstance(value, list) else value)
41
+ if text.strip():
42
+ return text.strip()[:120]
43
+ return None
44
+
45
+
46
+ def file_info(engine: MetadataEngine, path: Path) -> dict:
47
+ """What Get info shows for one audio file."""
48
+ st = path.stat()
49
+ meta = engine.load_metadata(path)
50
+ audio, format_name = _open_raw(path)
51
+ info = audio.info
52
+ art = read_picture(audio, format_name)
53
+ codec = getattr(info, "codec_description", None) or getattr(info, "codec", None)
54
+ return {
55
+ "kind": "file",
56
+ "name": path.name,
57
+ "format": meta.format,
58
+ "codec": str(codec) if codec else None,
59
+ "duration": meta.duration,
60
+ "bitrate": meta.bitrate,
61
+ "sample_rate": meta.sample_rate,
62
+ "bits_per_sample": getattr(info, "bits_per_sample", None) or None,
63
+ "channels": meta.channels,
64
+ "size": st.st_size,
65
+ "modified": int(st.st_mtime),
66
+ "tag_kind": _tag_kind(audio),
67
+ "tag_count": sum(len(v) for v in meta.tags.values()),
68
+ "art": {"mime": art.mime, "width": art.width, "height": art.height, "size": len(art.data)} if art else None,
69
+ "encoder": _encoder(audio),
70
+ "fields_supported": sum(is_tag_supported(meta.format or "", f.key) for f in FIELDS),
71
+ "fields_total": len(FIELDS),
72
+ "fields_unsupported": [f.label for f in FIELDS if not is_tag_supported(meta.format or "", f.key)],
73
+ "on_disk": str(path),
74
+ }
75
+
76
+
77
+ def folder_info(path: Path) -> dict:
78
+ """What Get info shows for a folder (counted up to MAX_FOLDER_FILES files)."""
79
+ files = audio = folders = size = 0
80
+ capped = False
81
+ for dirpath, dirs, names in os.walk(path):
82
+ dirs[:] = [d for d in dirs if not d.startswith(".")]
83
+ folders += len(dirs)
84
+ for n in names:
85
+ if n.startswith("."):
86
+ continue
87
+ files += 1
88
+ audio += Path(n).suffix.lower() in SUPPORTED_EXTENSIONS
89
+ try:
90
+ size += (Path(dirpath) / n).stat().st_size
91
+ except OSError:
92
+ pass
93
+ if files >= MAX_FOLDER_FILES:
94
+ capped = True
95
+ break
96
+ if capped:
97
+ break
98
+ return {"kind": "folder", "name": path.name, "files": files, "audio": audio, "folders": folders,
99
+ "size": size, "capped": capped, "modified": int(path.stat().st_mtime), "on_disk": str(path)}
@@ -43,7 +43,7 @@ from dataclasses import dataclass, field
43
43
  from pathlib import Path
44
44
 
45
45
  from codetta.core.engine import SUPPORTED_EXTENSIONS
46
- from codetta.core.library import _is_valid_text, _sort_text, natural_key
46
+ from codetta.core.library import _is_valid_text, _sort_text
47
47
  from codetta.core.tagmap import FIELDS
48
48
 
49
49
  log = logging.getLogger("codetta.index")
@@ -628,6 +628,23 @@ class LibraryIndex:
628
628
  yield path, _unpack(blob)
629
629
  last = rows[-1][0]
630
630
 
631
+ def cover_tracks(self, folders: Iterable[str], look: int = 30) -> dict[str, tuple[str, str]]:
632
+ """For each folder, a track inside it (at any depth) that has embedded art:
633
+ folder -> (track path, art hash). Reads the index only (no file is opened); looks at the
634
+ first ``look`` tracks of each folder, so a huge folder never makes this slow."""
635
+ out: dict[str, tuple[str, str]] = {}
636
+ with self._lock:
637
+ for folder in folders:
638
+ lo, hi = (folder + "/", folder + "0") if folder else ("", "\U0010ffff") # "0" sorts right after "/"
639
+ rows = self.db.execute("SELECT path, track FROM files WHERE path >= ? AND path < ? ORDER BY path LIMIT ?",
640
+ (lo, hi, look)).fetchall()
641
+ for path, blob in rows:
642
+ art = _unpack(blob).get("art") or {}
643
+ if art.get("hash"):
644
+ out[folder] = (path, art["hash"])
645
+ break
646
+ return out
647
+
631
648
  def paths_with_any(self, keys: Iterable[str]) -> set[str]:
632
649
  """Files that have at least one of these tags (by name, any case)."""
633
650
  with self._lock:
@@ -33,16 +33,19 @@ class FolderListing:
33
33
 
34
34
  INBOX = "@inbox" # paths starting with this live in the inbox folder, outside the library
35
35
  REPLACED = "@replaced" # albums an upgrade replaced (kept in the config folder so it can be undone)
36
+ DELETED = "@deleted" # "Recently deleted": files you deleted, kept in the config folder for 30 days
36
37
 
37
38
 
38
39
  class Library:
39
- def __init__(self, root: str | Path, inbox: str | Path | None = None, replaced: str | Path | None = None) -> None:
40
+ def __init__(self, root: str | Path, inbox: str | Path | None = None, replaced: str | Path | None = None,
41
+ deleted: str | Path | None = None) -> None:
40
42
  # Normalise without resolving symlinks: a library that links to music
41
43
  # on other disks is normal, and the engine follows links when writing.
42
44
  self.root = Path(os.path.abspath(root))
43
45
  # Optional second folder (e.g. slskd's downloads), addressed as "@inbox/...".
44
46
  self.inbox = Path(os.path.abspath(inbox)) if inbox else None
45
47
  self.replaced = Path(os.path.abspath(replaced)) if replaced else None
48
+ self.deleted = Path(os.path.abspath(deleted)) if deleted else None
46
49
 
47
50
  def inbox_available(self) -> bool:
48
51
  return self.inbox is not None and self.inbox.is_dir()
@@ -63,6 +66,8 @@ class Library:
63
66
  return self.inbox.joinpath(*rel.parts[1:])
64
67
  if rel.parts and rel.parts[0] == REPLACED and self.replaced is not None:
65
68
  return self.replaced.joinpath(*rel.parts[1:])
69
+ if rel.parts and rel.parts[0] == DELETED and self.deleted is not None:
70
+ return self.deleted.joinpath(*rel.parts[1:])
66
71
  if rel.parts and rel.parts[0].startswith("@"):
67
72
  raise LibraryPathError(f"Unknown folder: {rel.parts[0]}")
68
73
  return self.root.joinpath(*rel.parts)
@@ -76,6 +81,9 @@ class Library:
76
81
  if self.replaced is not None and path.is_relative_to(self.replaced) and not path.is_relative_to(self.root):
77
82
  rel = path.relative_to(self.replaced).as_posix()
78
83
  return REPLACED if rel == "." else f"{REPLACED}/{rel}"
84
+ if self.deleted is not None and path.is_relative_to(self.deleted) and not path.is_relative_to(self.root):
85
+ rel = path.relative_to(self.deleted).as_posix()
86
+ return DELETED if rel == "." else f"{DELETED}/{rel}"
79
87
  rel = path.relative_to(self.root).as_posix()
80
88
  return "" if rel == "." else rel
81
89
 
@@ -0,0 +1,73 @@
1
+ """The server log, for Advanced mode's live log view: Codetta's own log lines (what `docker logs`
2
+ shows), kept in memory only. Nothing is written to disk, and the page only ever gets them through
3
+ a signed-in, private route.
4
+
5
+ Kept out on purpose: per-request access lines (Codetta keeps no record of who visits; they're off
6
+ anyway) and anything that looks like a secret (tokens, keys, passwords), which is masked even
7
+ though Codetta never logs them.
8
+ """
9
+
10
+ from __future__ import annotations
11
+
12
+ import logging
13
+ import re
14
+ import threading
15
+ from collections import deque
16
+
17
+ MAX_LINES = 500
18
+ MAX_LINE_CHARS = 2000
19
+
20
+ # key=value / key: value pairs whose value must never be shown, and bearer tokens.
21
+ _SECRET = re.compile(r"(?i)\b(api[_-]?key|token|password|passwd|secret|session|cookie|authorization)(\s*[=:]\s*)(\S+)")
22
+ _BEARER = re.compile(r"(?i)\bbearer\s+\S+")
23
+
24
+
25
+ def redact(text: str) -> str:
26
+ text = _SECRET.sub(lambda m: f"{m.group(1)}{m.group(2)}•••", text)
27
+ return _BEARER.sub("Bearer •••", text)
28
+
29
+
30
+ class LogBuffer(logging.Handler):
31
+ """The last ``MAX_LINES`` log lines, each with an increasing id the page polls from."""
32
+
33
+ def __init__(self, capacity: int = MAX_LINES) -> None:
34
+ super().__init__(level=logging.INFO)
35
+ self.lines: deque[dict] = deque(maxlen=capacity)
36
+ self._next = 1
37
+ self._lock = threading.Lock()
38
+
39
+ def emit(self, record: logging.LogRecord) -> None:
40
+ if record.name.startswith("uvicorn.access"):
41
+ return # never a record of who visited
42
+ try:
43
+ message = record.getMessage()
44
+ if record.exc_info:
45
+ message += "\n" + "".join(logging.Formatter().formatException(record.exc_info).splitlines(True)[-6:])
46
+ except Exception: # noqa: BLE001 - a bad log call must never break the app
47
+ return
48
+ line = {"time": record.created, "level": record.levelname.lower(), "source": record.name,
49
+ "message": redact(message)[:MAX_LINE_CHARS]}
50
+ with self._lock:
51
+ line["id"] = self._next
52
+ self._next += 1
53
+ self.lines.append(line)
54
+
55
+ def since(self, after: int = 0) -> list[dict]:
56
+ with self._lock:
57
+ return [line for line in self.lines if line["id"] > after]
58
+
59
+
60
+ _shared: LogBuffer | None = None
61
+ _shared_lock = threading.Lock()
62
+
63
+
64
+ def shared_buffer() -> LogBuffer:
65
+ """One buffer per process, collecting Codetta's and the web server's log lines. "uvicorn" is
66
+ the parent of "uvicorn.error" (and "uvicorn.access", dropped above), so each line arrives once."""
67
+ global _shared
68
+ with _shared_lock:
69
+ if _shared is None:
70
+ _shared = LogBuffer()
71
+ for name in ("codetta", "uvicorn"):
72
+ logging.getLogger(name).addHandler(_shared)
73
+ return _shared
@@ -22,8 +22,11 @@ every move (see ``undo_moves``).
22
22
 
23
23
  from __future__ import annotations
24
24
 
25
+ import contextlib
26
+ import errno
25
27
  import os
26
28
  import re
29
+ import secrets
27
30
  import shutil
28
31
  import threading
29
32
  import unicodedata
@@ -361,18 +364,40 @@ def _move_one(root: Root, src: str, dst: str) -> None:
361
364
  if os.path.lexists(b) and not _same_file(a, b):
362
365
  raise FileExistsError("A different file already has that name")
363
366
  b.parent.mkdir(parents=True, exist_ok=True)
367
+ if not a.is_dir() and not _same_file(a, b) and _link_then_unlink(a, b):
368
+ return
364
369
  try:
365
370
  os.rename(a, b) # same filesystem: instant, and the file itself is never rewritten
366
371
  except OSError as exc:
367
- if exc.errno != 18: # EXDEV: another disk or mount (e.g. the inbox folder)
372
+ if exc.errno != errno.EXDEV: # another disk or mount (e.g. the inbox folder)
368
373
  raise
369
374
  _copy_then_remove(a, b)
370
375
 
371
376
 
377
+ def _link_then_unlink(a: Path, b: Path) -> bool:
378
+ """Move a file without any chance of replacing one that appeared at ``b`` a moment ago
379
+ (a plain rename would silently overwrite it). True when done; False when hard links
380
+ aren't possible here (another disk, exFAT, some network shares), so the caller renames."""
381
+ try:
382
+ os.link(a, b, follow_symlinks=False)
383
+ except FileExistsError:
384
+ raise FileExistsError("A different file already has that name") from None
385
+ except OSError:
386
+ return False
387
+ try:
388
+ os.unlink(a)
389
+ except OSError:
390
+ with contextlib.suppress(OSError):
391
+ os.unlink(b) # couldn't let go of the old name: put things back as they were
392
+ raise
393
+ return True
394
+
395
+
372
396
  def _copy_then_remove(a: Path, b: Path) -> None:
373
397
  """Move across disks: copy to a temporary name next to the target, check
374
398
  it, give it its real name, and only then delete the original."""
375
- tmp = b.with_name(f".codetta-move-{os.getpid()}-{b.name}")
399
+ # A short temporary name: the real one may already be at the 255-byte limit.
400
+ tmp = b.with_name(f".codetta-move-{os.getpid()}-{secrets.token_hex(4)}{b.suffix[:16]}")
376
401
  try:
377
402
  if a.is_dir() and not a.is_symlink():
378
403
  shutil.copytree(a, tmp, symlinks=True)
@@ -299,7 +299,7 @@ def _apply_one(
299
299
  result.previous = {k: list(current.tags.get(k, [])) for k in changes}
300
300
  if changes and not dry_run:
301
301
  engine.update_tags(path, changes)
302
- except (MetadataError, FileNotFoundError) as exc:
302
+ except (MetadataError, OSError) as exc: # any one file failing (unreadable, no permission) never stops the rest
303
303
  result.applied = {}
304
304
  result.error = str(exc)
305
305
  return result
@@ -425,6 +425,22 @@ def default_presets() -> list[Preset]:
425
425
  "media": "Digital Media",
426
426
  },
427
427
  ),
428
+ Preset(
429
+ name="Explicit",
430
+ description=(
431
+ "Marks tracks as explicit, so Navidrome and other players show the "
432
+ "explicit badge. Apply to a folder or to selected tracks."
433
+ ),
434
+ tags={"itunesadvisory": "1"},
435
+ ),
436
+ Preset(
437
+ name="Clean",
438
+ description=(
439
+ "Marks tracks as the clean version, so Navidrome and other players "
440
+ "show them as clean. Apply to a folder or to selected tracks."
441
+ ),
442
+ tags={"itunesadvisory": "2"},
443
+ ),
428
444
  Preset(
429
445
  name="Full Credits",
430
446
  description=(
@@ -59,7 +59,9 @@ def raw_tags(audio, format_name: str) -> tuple[str, list[dict]]:
59
59
  for key, frame in (tags or {}).items():
60
60
  if frame.FrameID == "APIC":
61
61
  entries.append(_picture(key, frame.mime, frame.data, frame.type))
62
- elif hasattr(frame, "text") or hasattr(frame, "people") or hasattr(frame, "url"):
62
+ elif hasattr(frame, "people"): # TIPL / TMCL: "producer: Name; mixer: Name"
63
+ entries.append(_text(key, "; ".join(f"{role}: {name}" for role, name in frame.people)))
64
+ elif hasattr(frame, "text") or hasattr(frame, "url"):
63
65
  entries.append(_text(key, str(frame)))
64
66
  else:
65
67
  data = getattr(frame, "data", b"")
@@ -71,6 +73,8 @@ def raw_tags(audio, format_name: str) -> tuple[str, list[dict]]:
71
73
  for c in values:
72
74
  entries.append(_picture(key, "image/png" if c.imageformat == 14 else "image/jpeg", bytes(c)))
73
75
  continue
76
+ if not isinstance(values, list): # single-value atoms: cpil (compilation), pgap, hdvd... are a plain bool/int
77
+ values = [values]
74
78
  shown = []
75
79
  for v in values:
76
80
  if isinstance(v, MP4FreeForm):