audio-transcode-watcher 0.7.0__tar.gz → 0.7.2__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.
- {audio_transcode_watcher-0.7.0 → audio_transcode_watcher-0.7.2}/CHANGELOG.md +15 -0
- {audio_transcode_watcher-0.7.0 → audio_transcode_watcher-0.7.2}/Dockerfile +3 -1
- {audio_transcode_watcher-0.7.0 → audio_transcode_watcher-0.7.2}/PKG-INFO +2 -2
- {audio_transcode_watcher-0.7.0 → audio_transcode_watcher-0.7.2}/README.md +1 -1
- {audio_transcode_watcher-0.7.0 → audio_transcode_watcher-0.7.2}/config.example.yaml +1 -1
- {audio_transcode_watcher-0.7.0 → audio_transcode_watcher-0.7.2}/docs/ROADMAP.md +1 -1
- {audio_transcode_watcher-0.7.0 → audio_transcode_watcher-0.7.2}/docs/getting-started.md +2 -2
- {audio_transcode_watcher-0.7.0 → audio_transcode_watcher-0.7.2}/pyproject.toml +1 -1
- {audio_transcode_watcher-0.7.0 → audio_transcode_watcher-0.7.2}/src/audio_transcode_watcher/__init__.py +1 -1
- {audio_transcode_watcher-0.7.0 → audio_transcode_watcher-0.7.2}/src/audio_transcode_watcher/encoder.py +8 -6
- {audio_transcode_watcher-0.7.0 → audio_transcode_watcher-0.7.2}/src/audio_transcode_watcher/lyrics.py +1 -1
- {audio_transcode_watcher-0.7.0 → audio_transcode_watcher-0.7.2}/src/audio_transcode_watcher/main.py +10 -8
- {audio_transcode_watcher-0.7.0 → audio_transcode_watcher-0.7.2}/src/audio_transcode_watcher/sync.py +37 -25
- {audio_transcode_watcher-0.7.0 → audio_transcode_watcher-0.7.2}/src/audio_transcode_watcher/utils.py +4 -0
- {audio_transcode_watcher-0.7.0 → audio_transcode_watcher-0.7.2}/tests/test_replaygain.py +43 -0
- {audio_transcode_watcher-0.7.0 → audio_transcode_watcher-0.7.2}/uv.lock +4 -4
- {audio_transcode_watcher-0.7.0 → audio_transcode_watcher-0.7.2}/.beads/.gitignore +0 -0
- {audio_transcode_watcher-0.7.0 → audio_transcode_watcher-0.7.2}/.beads/README.md +0 -0
- {audio_transcode_watcher-0.7.0 → audio_transcode_watcher-0.7.2}/.beads/config.yaml +0 -0
- {audio_transcode_watcher-0.7.0 → audio_transcode_watcher-0.7.2}/.beads/hooks/commit-msg +0 -0
- {audio_transcode_watcher-0.7.0 → audio_transcode_watcher-0.7.2}/.beads/hooks/post-checkout +0 -0
- {audio_transcode_watcher-0.7.0 → audio_transcode_watcher-0.7.2}/.beads/hooks/post-merge +0 -0
- {audio_transcode_watcher-0.7.0 → audio_transcode_watcher-0.7.2}/.beads/hooks/pre-commit +0 -0
- {audio_transcode_watcher-0.7.0 → audio_transcode_watcher-0.7.2}/.beads/hooks/pre-push +0 -0
- {audio_transcode_watcher-0.7.0 → audio_transcode_watcher-0.7.2}/.beads/hooks/prepare-commit-msg +0 -0
- {audio_transcode_watcher-0.7.0 → audio_transcode_watcher-0.7.2}/.beads/metadata.json +0 -0
- {audio_transcode_watcher-0.7.0 → audio_transcode_watcher-0.7.2}/.claude/settings.json +0 -0
- {audio_transcode_watcher-0.7.0 → audio_transcode_watcher-0.7.2}/.coderabbit.yaml +0 -0
- {audio_transcode_watcher-0.7.0 → audio_transcode_watcher-0.7.2}/.github/FUNDING.yml +0 -0
- {audio_transcode_watcher-0.7.0 → audio_transcode_watcher-0.7.2}/.github/dependabot.yml +0 -0
- {audio_transcode_watcher-0.7.0 → audio_transcode_watcher-0.7.2}/.github/workflows/dockerhub-description.yml +0 -0
- {audio_transcode_watcher-0.7.0 → audio_transcode_watcher-0.7.2}/.github/workflows/release.yml +0 -0
- {audio_transcode_watcher-0.7.0 → audio_transcode_watcher-0.7.2}/.github/workflows/stale.yml +0 -0
- {audio_transcode_watcher-0.7.0 → audio_transcode_watcher-0.7.2}/.github/workflows/tests.yml +0 -0
- {audio_transcode_watcher-0.7.0 → audio_transcode_watcher-0.7.2}/.gitignore +0 -0
- {audio_transcode_watcher-0.7.0 → audio_transcode_watcher-0.7.2}/AGENTS.md +0 -0
- {audio_transcode_watcher-0.7.0 → audio_transcode_watcher-0.7.2}/CLAUDE.md +0 -0
- {audio_transcode_watcher-0.7.0 → audio_transcode_watcher-0.7.2}/LICENSE +0 -0
- {audio_transcode_watcher-0.7.0 → audio_transcode_watcher-0.7.2}/SECURITY.md +0 -0
- {audio_transcode_watcher-0.7.0 → audio_transcode_watcher-0.7.2}/codecov.yml +0 -0
- {audio_transcode_watcher-0.7.0 → audio_transcode_watcher-0.7.2}/docs/configuration.md +0 -0
- {audio_transcode_watcher-0.7.0 → audio_transcode_watcher-0.7.2}/docs/development.md +0 -0
- {audio_transcode_watcher-0.7.0 → audio_transcode_watcher-0.7.2}/docs/how-it-works.md +0 -0
- {audio_transcode_watcher-0.7.0 → audio_transcode_watcher-0.7.2}/docs/images/banner.svg +0 -0
- {audio_transcode_watcher-0.7.0 → audio_transcode_watcher-0.7.2}/docs/images/icon.png +0 -0
- {audio_transcode_watcher-0.7.0 → audio_transcode_watcher-0.7.2}/docs/images/icon.svg +0 -0
- {audio_transcode_watcher-0.7.0 → audio_transcode_watcher-0.7.2}/docs/images/social-preview.png +0 -0
- {audio_transcode_watcher-0.7.0 → audio_transcode_watcher-0.7.2}/docs/usage.md +0 -0
- {audio_transcode_watcher-0.7.0 → audio_transcode_watcher-0.7.2}/src/audio_transcode_watcher/config.py +0 -0
- {audio_transcode_watcher-0.7.0 → audio_transcode_watcher-0.7.2}/src/audio_transcode_watcher/manifest.py +0 -0
- {audio_transcode_watcher-0.7.0 → audio_transcode_watcher-0.7.2}/src/audio_transcode_watcher/replaygain.py +0 -0
- {audio_transcode_watcher-0.7.0 → audio_transcode_watcher-0.7.2}/src/audio_transcode_watcher/watcher.py +0 -0
- {audio_transcode_watcher-0.7.0 → audio_transcode_watcher-0.7.2}/tests/__init__.py +0 -0
- {audio_transcode_watcher-0.7.0 → audio_transcode_watcher-0.7.2}/tests/conftest.py +0 -0
- {audio_transcode_watcher-0.7.0 → audio_transcode_watcher-0.7.2}/tests/test_config.py +0 -0
- {audio_transcode_watcher-0.7.0 → audio_transcode_watcher-0.7.2}/tests/test_encoder.py +0 -0
- {audio_transcode_watcher-0.7.0 → audio_transcode_watcher-0.7.2}/tests/test_lyrics.py +0 -0
- {audio_transcode_watcher-0.7.0 → audio_transcode_watcher-0.7.2}/tests/test_main.py +0 -0
- {audio_transcode_watcher-0.7.0 → audio_transcode_watcher-0.7.2}/tests/test_manifest.py +0 -0
- {audio_transcode_watcher-0.7.0 → audio_transcode_watcher-0.7.2}/tests/test_sync.py +0 -0
- {audio_transcode_watcher-0.7.0 → audio_transcode_watcher-0.7.2}/tests/test_utils.py +0 -0
- {audio_transcode_watcher-0.7.0 → audio_transcode_watcher-0.7.2}/tests/test_watcher.py +0 -0
- {audio_transcode_watcher-0.7.0 → audio_transcode_watcher-0.7.2}/tools/verify_sync.py +0 -0
|
@@ -2,6 +2,19 @@
|
|
|
2
2
|
|
|
3
3
|
All notable changes to this project are documented here. The format follows [Keep a Changelog](https://keepachangelog.com/en/1.1.0/) and the project uses [Semantic Versioning](https://semver.org/).
|
|
4
4
|
|
|
5
|
+
## [0.7.2] - 2026-10-21
|
|
6
|
+
|
|
7
|
+
### Security
|
|
8
|
+
|
|
9
|
+
- The image no longer trusts the eight eMudhra (emSign) intermediates whose private keys leaked in October 2026: certifi goes to 2026.10.19 and the system `ca-certificates` to the trixie-security release that distrusts them. Before, a certificate minted with those keys for any site was accepted, lyrics lookups included.
|
|
10
|
+
|
|
11
|
+
## [0.7.1] - 2026-10-07
|
|
12
|
+
|
|
13
|
+
### Fixed
|
|
14
|
+
|
|
15
|
+
- An output whose ReplayGain tags could not be written is now tried again on the next periodic sync. Before, one failed write (for example a root-owned ALAC file answering "Permission denied") marked its source as done, so the output stayed untagged until the source changed or the service restarted. Each failed attempt logs the same warning, and the source counts as done only once every output has its tags.
|
|
16
|
+
- Errors are no longer swallowed silently. File operations now catch only filesystem errors and log them as before. The broad catches that stay, such as the one around each file of a sync, log the full traceback, and lyric metadata reads and unreadable folders log at debug level. A failed removal of a leftover temp file is now logged too.
|
|
17
|
+
|
|
5
18
|
## [0.7.0] - 2026-10-06
|
|
6
19
|
|
|
7
20
|
### Added
|
|
@@ -65,6 +78,8 @@ All notable changes to this project are documented here. The format follows [Kee
|
|
|
65
78
|
- Lossy copies are written through a temp file and renamed, like encodes, so a half-written copy is never visible.
|
|
66
79
|
- `force_reencode: true` purges the outputs once at startup. It used to purge them again on every periodic sync, which re-encoded the whole library every five minutes.
|
|
67
80
|
|
|
81
|
+
[0.7.2]: https://github.com/GeiserX/audio-transcode-watcher/releases/tag/v0.7.2
|
|
82
|
+
[0.7.1]: https://github.com/GeiserX/audio-transcode-watcher/releases/tag/v0.7.1
|
|
68
83
|
[0.7.0]: https://github.com/GeiserX/audio-transcode-watcher/releases/tag/v0.7.0
|
|
69
84
|
[0.6.2]: https://github.com/GeiserX/audio-transcode-watcher/releases/tag/v0.6.2
|
|
70
85
|
[0.6.1]: https://github.com/GeiserX/audio-transcode-watcher/releases/tag/v0.6.1
|
|
@@ -1,7 +1,9 @@
|
|
|
1
1
|
FROM python:3.14-slim
|
|
2
2
|
|
|
3
|
-
# Install FFmpeg for transcoding
|
|
3
|
+
# Install FFmpeg for transcoding. The base image's ca-certificates 20250419 still
|
|
4
|
+
# trusts the compromised eMudhra intermediates; trixie-security distrusts them.
|
|
4
5
|
RUN apt-get update && apt-get install -y --no-install-recommends ffmpeg \
|
|
6
|
+
&& apt-get install -y --only-upgrade ca-certificates \
|
|
5
7
|
&& rm -rf /var/lib/apt/lists/*
|
|
6
8
|
|
|
7
9
|
# Set working directory
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.5
|
|
2
2
|
Name: audio-transcode-watcher
|
|
3
|
-
Version: 0.7.
|
|
3
|
+
Version: 0.7.2
|
|
4
4
|
Summary: Watch a source folder and automatically transcode audio files to multiple formats
|
|
5
5
|
Project-URL: Homepage, https://github.com/GeiserX/audio-transcode-watcher
|
|
6
6
|
Project-URL: Repository, https://github.com/GeiserX/audio-transcode-watcher
|
|
@@ -67,7 +67,7 @@ Keep one library in several formats: lossless for the archive, lossy for phones
|
|
|
67
67
|
curl -fsSL -o config.yaml https://raw.githubusercontent.com/GeiserX/audio-transcode-watcher/main/config.example.yaml
|
|
68
68
|
docker run -d --name audio_transcoder -e CONFIG_FILE=/app/config.yaml \
|
|
69
69
|
-v ./config.yaml:/app/config.yaml:ro -v /path/to/flac:/music/flac:ro -v /path/to/mp3:/music/mp3 \
|
|
70
|
-
drumsergio/audio-transcoder:0.7.
|
|
70
|
+
drumsergio/audio-transcoder:0.7.2
|
|
71
71
|
```
|
|
72
72
|
|
|
73
73
|
Edit `config.yaml` first so its outputs match the folders you mount; the example writes ALAC, MP3 and AAC. [Getting started](https://github.com/GeiserX/audio-transcode-watcher/blob/main/docs/getting-started.md) has Docker Compose and the full `docker run`.
|
|
@@ -36,7 +36,7 @@ Keep one library in several formats: lossless for the archive, lossy for phones
|
|
|
36
36
|
curl -fsSL -o config.yaml https://raw.githubusercontent.com/GeiserX/audio-transcode-watcher/main/config.example.yaml
|
|
37
37
|
docker run -d --name audio_transcoder -e CONFIG_FILE=/app/config.yaml \
|
|
38
38
|
-v ./config.yaml:/app/config.yaml:ro -v /path/to/flac:/music/flac:ro -v /path/to/mp3:/music/mp3 \
|
|
39
|
-
drumsergio/audio-transcoder:0.7.
|
|
39
|
+
drumsergio/audio-transcoder:0.7.2
|
|
40
40
|
```
|
|
41
41
|
|
|
42
42
|
Edit `config.yaml` first so its outputs match the folders you mount; the example writes ALAC, MP3 and AAC. [Getting started](https://github.com/GeiserX/audio-transcode-watcher/blob/main/docs/getting-started.md) has Docker Compose and the full `docker run`.
|
|
@@ -29,7 +29,7 @@ outputs:
|
|
|
29
29
|
```yaml
|
|
30
30
|
services:
|
|
31
31
|
audio-transcoder:
|
|
32
|
-
image: drumsergio/audio-transcoder:0.7.
|
|
32
|
+
image: drumsergio/audio-transcoder:0.7.2
|
|
33
33
|
container_name: audio_transcoder
|
|
34
34
|
environment:
|
|
35
35
|
- TZ=Europe/Madrid
|
|
@@ -60,6 +60,6 @@ docker run -d \
|
|
|
60
60
|
-v /path/to/flac:/music/flac:ro \
|
|
61
61
|
-v /path/to/mp3:/music/mp3 \
|
|
62
62
|
--restart unless-stopped \
|
|
63
|
-
drumsergio/audio-transcoder:0.7.
|
|
63
|
+
drumsergio/audio-transcoder:0.7.2
|
|
64
64
|
```
|
|
65
65
|
|
|
@@ -347,8 +347,8 @@ def atomic_ffmpeg_encode(
|
|
|
347
347
|
try:
|
|
348
348
|
if os.path.exists(tmp_dest):
|
|
349
349
|
os.remove(tmp_dest)
|
|
350
|
-
except
|
|
351
|
-
|
|
350
|
+
except OSError as e:
|
|
351
|
+
logger.warning("Could not remove stale temp file %s: %s", tmp_dest, e)
|
|
352
352
|
|
|
353
353
|
# Replace destination with temp path
|
|
354
354
|
cmd = list(cmd)
|
|
@@ -378,12 +378,14 @@ def atomic_ffmpeg_encode(
|
|
|
378
378
|
try:
|
|
379
379
|
finalize(tmp_dest)
|
|
380
380
|
except Exception as e:
|
|
381
|
-
logger.warning(
|
|
381
|
+
logger.warning(
|
|
382
|
+
"Post-encode step failed for %s: %s", final_dest, e, exc_info=True
|
|
383
|
+
)
|
|
382
384
|
|
|
383
385
|
try:
|
|
384
386
|
os.replace(tmp_dest, final_dest)
|
|
385
387
|
return 0
|
|
386
|
-
except
|
|
388
|
+
except OSError as e:
|
|
387
389
|
logger.error("Atomic replace failed for %s: %s", final_dest, e)
|
|
388
390
|
_cleanup_temp(tmp_dest)
|
|
389
391
|
return 1
|
|
@@ -464,5 +466,5 @@ def _cleanup_temp(path: str) -> None:
|
|
|
464
466
|
try:
|
|
465
467
|
if os.path.exists(path):
|
|
466
468
|
os.remove(path)
|
|
467
|
-
except
|
|
468
|
-
|
|
469
|
+
except OSError as e:
|
|
470
|
+
logger.warning("Could not remove temp file %s: %s", path, e)
|
|
@@ -75,7 +75,7 @@ def extract_metadata(filepath: str) -> tuple[str, str] | None:
|
|
|
75
75
|
if artist and title:
|
|
76
76
|
return artist, title
|
|
77
77
|
except Exception:
|
|
78
|
-
logger.debug("Could not read metadata from %s", filepath)
|
|
78
|
+
logger.debug("Could not read metadata from %s", filepath, exc_info=True)
|
|
79
79
|
|
|
80
80
|
# Fallback: parse filename "Artist - Title.ext"
|
|
81
81
|
stem = Path(filepath).stem
|
{audio_transcode_watcher-0.7.0 → audio_transcode_watcher-0.7.2}/src/audio_transcode_watcher/main.py
RENAMED
|
@@ -16,20 +16,22 @@ from .watcher import start_watcher
|
|
|
16
16
|
|
|
17
17
|
def setup_logging() -> None:
|
|
18
18
|
"""Configure logging for the application."""
|
|
19
|
-
|
|
19
|
+
logging.basicConfig(
|
|
20
|
+
level=logging.INFO,
|
|
21
|
+
format="%(asctime)s %(levelname)s: %(message)s",
|
|
22
|
+
datefmt="%H:%M:%S",
|
|
23
|
+
)
|
|
24
|
+
|
|
25
|
+
# Ensure Unicode output works (reconfigure changes the stream in place,
|
|
26
|
+
# so the handler above writes UTF-8 too)
|
|
20
27
|
try:
|
|
21
28
|
if hasattr(sys.stdout, "reconfigure"):
|
|
22
29
|
sys.stdout.reconfigure(encoding="utf-8")
|
|
23
30
|
if hasattr(sys.stderr, "reconfigure"):
|
|
24
31
|
sys.stderr.reconfigure(encoding="utf-8")
|
|
25
32
|
except Exception:
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
logging.basicConfig(
|
|
29
|
-
level=logging.INFO,
|
|
30
|
-
format="%(asctime)s %(levelname)s: %(message)s",
|
|
31
|
-
datefmt="%H:%M:%S",
|
|
32
|
-
)
|
|
33
|
+
logger = logging.getLogger(__name__)
|
|
34
|
+
logger.warning("Could not switch output to UTF-8", exc_info=True)
|
|
33
35
|
|
|
34
36
|
|
|
35
37
|
def main() -> int:
|
{audio_transcode_watcher-0.7.0 → audio_transcode_watcher-0.7.2}/src/audio_transcode_watcher/sync.py
RENAMED
|
@@ -160,8 +160,12 @@ def process_source_file(
|
|
|
160
160
|
_tag_source(source_path, config)
|
|
161
161
|
if not _process_outputs(source_path, config, force):
|
|
162
162
|
_remember_failure(source_path)
|
|
163
|
-
|
|
164
|
-
|
|
163
|
+
# An output that could not be tagged is tried again next scan.
|
|
164
|
+
if (
|
|
165
|
+
config.replaygain
|
|
166
|
+
and not replaygain.is_checked(source_path)
|
|
167
|
+
and _carry_replaygain(source_path, config)
|
|
168
|
+
):
|
|
165
169
|
replaygain.mark_checked(source_path)
|
|
166
170
|
# Auto-fetch lyrics if enabled and no .lrc sidecar exists
|
|
167
171
|
if config.fetch_lyrics:
|
|
@@ -201,21 +205,25 @@ def _tag_source(source_path: str, config: Config) -> None:
|
|
|
201
205
|
manifest.restat(output.path, out_path, before, source_path=source_path)
|
|
202
206
|
|
|
203
207
|
|
|
204
|
-
def _carry_replaygain(source_path: str, config: Config) ->
|
|
208
|
+
def _carry_replaygain(source_path: str, config: Config) -> bool:
|
|
205
209
|
"""Give *source_path*'s existing outputs its ReplayGain track tags.
|
|
206
210
|
|
|
207
211
|
Nothing is re-encoded. A copy is copied again, so it stays identical to
|
|
208
212
|
its source; any other output gets the two tags written into it.
|
|
213
|
+
|
|
214
|
+
Returns False if an output could not be tagged or recopied, so the
|
|
215
|
+
caller leaves the source unchecked and the next scan tries again.
|
|
209
216
|
"""
|
|
210
217
|
if not is_lossless(source_path) and _has_lossless_source(source_path, config):
|
|
211
|
-
return # its outputs belong to the lossless source of the stem
|
|
218
|
+
return True # its outputs belong to the lossless source of the stem
|
|
212
219
|
try:
|
|
213
220
|
values = replaygain.read_track_tags(source_path)
|
|
214
221
|
except Exception as e: # noqa: BLE001 - unreadable means nothing to carry
|
|
215
222
|
logger.debug("ReplayGain: cannot read %s: %s", source_path, e)
|
|
216
|
-
return
|
|
223
|
+
return True
|
|
217
224
|
if replaygain.GAIN_TAG not in values:
|
|
218
|
-
return
|
|
225
|
+
return True
|
|
226
|
+
ok = True
|
|
219
227
|
for output in config.outputs:
|
|
220
228
|
filename, action = plan_output(source_path, output)
|
|
221
229
|
out_path = get_output_file_path(
|
|
@@ -231,6 +239,8 @@ def _carry_replaygain(source_path: str, config: Config) -> None:
|
|
|
231
239
|
manifest.record(
|
|
232
240
|
output.path, out_path, config.source_path, source_path, "copy"
|
|
233
241
|
)
|
|
242
|
+
else:
|
|
243
|
+
ok = False
|
|
234
244
|
continue
|
|
235
245
|
before = os.stat(out_path)
|
|
236
246
|
if replaygain.write_track_tags(out_path, values):
|
|
@@ -238,6 +248,8 @@ def _carry_replaygain(source_path: str, config: Config) -> None:
|
|
|
238
248
|
logger.info("♫ ReplayGain tags → %s", out_path)
|
|
239
249
|
except Exception as e: # noqa: BLE001 - one bad output never stops the pass
|
|
240
250
|
logger.warning("ReplayGain: could not tag %s: %s", out_path, e)
|
|
251
|
+
ok = False
|
|
252
|
+
return ok
|
|
241
253
|
|
|
242
254
|
|
|
243
255
|
def _is_known_failure(source_path: str) -> bool:
|
|
@@ -367,7 +379,7 @@ def _atomic_copy(source_path: str, out_path: str) -> bool:
|
|
|
367
379
|
shutil.copy2(source_path, tmp)
|
|
368
380
|
os.replace(tmp, out_path)
|
|
369
381
|
return True
|
|
370
|
-
except
|
|
382
|
+
except OSError as e:
|
|
371
383
|
logger.error("Copy failed %s → %s: %s", source_path, out_path, e)
|
|
372
384
|
try:
|
|
373
385
|
if os.path.exists(tmp):
|
|
@@ -535,7 +547,7 @@ def delete_outputs(source_path: str, config: Config) -> None:
|
|
|
535
547
|
try:
|
|
536
548
|
logger.info("✘ remove %s", filepath)
|
|
537
549
|
os.remove(filepath)
|
|
538
|
-
except
|
|
550
|
+
except OSError as e:
|
|
539
551
|
logger.error("Failed to remove %s: %s", filepath, e)
|
|
540
552
|
|
|
541
553
|
# Sidecars are shared by every source of the stem; remove them only
|
|
@@ -582,7 +594,7 @@ def sync_sidecars(source_path: str, config: Config) -> None:
|
|
|
582
594
|
os.makedirs(os.path.dirname(sidecar_dst), exist_ok=True)
|
|
583
595
|
shutil.copy2(sidecar_src, sidecar_dst)
|
|
584
596
|
logger.info("► copy sidecar %s → %s", sidecar_src, sidecar_dst)
|
|
585
|
-
except
|
|
597
|
+
except OSError as e:
|
|
586
598
|
logger.error(
|
|
587
599
|
"Failed to copy sidecar %s → %s: %s", sidecar_src, sidecar_dst, e
|
|
588
600
|
)
|
|
@@ -606,7 +618,7 @@ def delete_sidecars(source_path: str, config: Config) -> None:
|
|
|
606
618
|
try:
|
|
607
619
|
logger.info("✘ remove sidecar %s", sidecar_path)
|
|
608
620
|
os.remove(sidecar_path)
|
|
609
|
-
except
|
|
621
|
+
except OSError as e:
|
|
610
622
|
logger.error("Failed to remove sidecar %s: %s", sidecar_path, e)
|
|
611
623
|
|
|
612
624
|
|
|
@@ -637,10 +649,10 @@ def cleanup_stale_temp_files(config: Config) -> int:
|
|
|
637
649
|
logger.info("✘ cleanup stale temp %s", full)
|
|
638
650
|
os.remove(full)
|
|
639
651
|
cleaned += 1
|
|
640
|
-
except
|
|
652
|
+
except OSError as e:
|
|
641
653
|
logger.error("Failed to remove temp file %s: %s", full, e)
|
|
642
|
-
except Exception
|
|
643
|
-
logger.
|
|
654
|
+
except Exception:
|
|
655
|
+
logger.exception("Failed to scan %s for temp files", output.path)
|
|
644
656
|
return cleaned
|
|
645
657
|
|
|
646
658
|
|
|
@@ -663,12 +675,12 @@ def purge_all_outputs(config: Config) -> None:
|
|
|
663
675
|
try:
|
|
664
676
|
logger.info("✘ purge %s", full)
|
|
665
677
|
os.remove(full)
|
|
666
|
-
except
|
|
678
|
+
except OSError as e:
|
|
667
679
|
logger.error("Failed to purge %s: %s", full, e)
|
|
668
680
|
manifest.forget(output.path)
|
|
669
681
|
remove_empty_dirs(output.path)
|
|
670
|
-
except Exception
|
|
671
|
-
logger.
|
|
682
|
+
except Exception:
|
|
683
|
+
logger.exception("Failed to purge folder %s", output.path)
|
|
672
684
|
|
|
673
685
|
|
|
674
686
|
def initial_sync(config: Config, periodic: bool = False) -> None:
|
|
@@ -705,8 +717,8 @@ def initial_sync(config: Config, periodic: bool = False) -> None:
|
|
|
705
717
|
# Collect source files recursively
|
|
706
718
|
try:
|
|
707
719
|
source_files = walk_audio_files(config.source_path)
|
|
708
|
-
except Exception
|
|
709
|
-
logger.
|
|
720
|
+
except Exception:
|
|
721
|
+
logger.exception("Failed to scan source")
|
|
710
722
|
return
|
|
711
723
|
|
|
712
724
|
# Process all source files in parallel (skip stability check - files are on disk)
|
|
@@ -718,8 +730,8 @@ def initial_sync(config: Config, periodic: bool = False) -> None:
|
|
|
718
730
|
def process_one(src_file: str) -> None:
|
|
719
731
|
try:
|
|
720
732
|
process_source_file(src_file, config, force=False, check_stable=False)
|
|
721
|
-
except Exception
|
|
722
|
-
logger.
|
|
733
|
+
except Exception:
|
|
734
|
+
logger.exception("Error processing %s", src_file)
|
|
723
735
|
|
|
724
736
|
with ThreadPoolExecutor(max_workers=workers) as executor:
|
|
725
737
|
futures = [executor.submit(process_one, f) for f in source_files]
|
|
@@ -762,8 +774,8 @@ def _cleanup_orphans(config: Config) -> None:
|
|
|
762
774
|
src_root = config.source_path
|
|
763
775
|
try:
|
|
764
776
|
source_files = walk_audio_files(src_root)
|
|
765
|
-
except Exception
|
|
766
|
-
logger.
|
|
777
|
+
except Exception:
|
|
778
|
+
logger.exception("Failed to scan source for orphan cleanup")
|
|
767
779
|
return
|
|
768
780
|
if not source_files:
|
|
769
781
|
logger.warning(
|
|
@@ -801,7 +813,7 @@ def _cleanup_orphans(config: Config) -> None:
|
|
|
801
813
|
try:
|
|
802
814
|
logger.info("✘ remove %s %s", kind, full)
|
|
803
815
|
os.remove(full)
|
|
804
|
-
except
|
|
816
|
+
except OSError as e:
|
|
805
817
|
logger.error("Failed to remove %s: %s", full, e)
|
|
806
818
|
|
|
807
819
|
for output in config.outputs:
|
|
@@ -831,8 +843,8 @@ def _cleanup_orphans(config: Config) -> None:
|
|
|
831
843
|
logger.debug("Keeping young or in-progress %s", full)
|
|
832
844
|
continue
|
|
833
845
|
remove(full, kind)
|
|
834
|
-
except Exception
|
|
835
|
-
logger.
|
|
846
|
+
except Exception:
|
|
847
|
+
logger.exception("Failed to scan %s for orphans", output.path)
|
|
836
848
|
|
|
837
849
|
# Remove empty subdirectories left after orphan cleanup, and forget
|
|
838
850
|
# manifest rows whose output is gone
|
{audio_transcode_watcher-0.7.0 → audio_transcode_watcher-0.7.2}/src/audio_transcode_watcher/utils.py
RENAMED
|
@@ -2,11 +2,14 @@
|
|
|
2
2
|
|
|
3
3
|
from __future__ import annotations
|
|
4
4
|
|
|
5
|
+
import logging
|
|
5
6
|
import os
|
|
6
7
|
import time
|
|
7
8
|
import unicodedata
|
|
8
9
|
from pathlib import Path
|
|
9
10
|
|
|
11
|
+
logger = logging.getLogger(__name__)
|
|
12
|
+
|
|
10
13
|
# Audio file extensions considered as source files
|
|
11
14
|
LOSSLESS_EXTENSIONS = {
|
|
12
15
|
".flac",
|
|
@@ -121,6 +124,7 @@ def appears_empty_dir(path: str) -> bool:
|
|
|
121
124
|
return True
|
|
122
125
|
except Exception:
|
|
123
126
|
# On any error, treat as empty to be safe
|
|
127
|
+
logger.debug("Cannot list %s, treating it as empty", path, exc_info=True)
|
|
124
128
|
return True
|
|
125
129
|
|
|
126
130
|
|
|
@@ -503,6 +503,49 @@ class TestCarryEdges:
|
|
|
503
503
|
assert "could not tag" in caplog.text
|
|
504
504
|
assert abs(_gain(tmp_path / "mp3" / "a.mp3") - EXPECTED_GAIN) < 0.5
|
|
505
505
|
|
|
506
|
+
@pytest.mark.skipif(
|
|
507
|
+
hasattr(os, "geteuid") and os.geteuid() == 0,
|
|
508
|
+
reason="root writes through a read-only mode",
|
|
509
|
+
)
|
|
510
|
+
def test_unwritable_output_is_retried_on_the_next_scan(self, tmp_path, caplog):
|
|
511
|
+
src = tmp_path / "src"
|
|
512
|
+
_tone(src / "a.flac")
|
|
513
|
+
config = _config(src, {"alac": "", "mp3": ""}, tmp_path, rg=False)
|
|
514
|
+
initial_sync(config)
|
|
515
|
+
alac = tmp_path / "alac" / "a.m4a"
|
|
516
|
+
alac.chmod(0o444) # an output the service cannot write, as root-owned
|
|
517
|
+
config.replaygain = True
|
|
518
|
+
try:
|
|
519
|
+
initial_sync(config, periodic=True)
|
|
520
|
+
assert f"could not tag {alac}" in caplog.text
|
|
521
|
+
assert replaygain.read_track_tags(str(alac)) == {}
|
|
522
|
+
assert abs(_gain(tmp_path / "mp3" / "a.mp3") - EXPECTED_GAIN) < 0.5
|
|
523
|
+
|
|
524
|
+
caplog.clear()
|
|
525
|
+
initial_sync(config, periodic=True) # still read-only: warned again
|
|
526
|
+
assert f"could not tag {alac}" in caplog.text
|
|
527
|
+
finally:
|
|
528
|
+
alac.chmod(0o644)
|
|
529
|
+
|
|
530
|
+
caplog.clear()
|
|
531
|
+
initial_sync(config, periodic=True)
|
|
532
|
+
assert "could not tag" not in caplog.text
|
|
533
|
+
assert abs(_gain(alac) - EXPECTED_GAIN) < 0.5
|
|
534
|
+
assert replaygain.is_checked(str(src / "a.flac"))
|
|
535
|
+
|
|
536
|
+
def test_failed_recopy_is_retried_on_the_next_scan(self, tmp_path):
|
|
537
|
+
src = tmp_path / "src"
|
|
538
|
+
mp3 = _tone(src / "a.mp3", "-c:a", "libmp3lame")
|
|
539
|
+
config = _config(src, {"alac": ""}, tmp_path, rg=False)
|
|
540
|
+
initial_sync(config)
|
|
541
|
+
config.replaygain = True
|
|
542
|
+
with patch.object(sync_mod, "_atomic_copy", return_value=False):
|
|
543
|
+
initial_sync(config, periodic=True)
|
|
544
|
+
assert not replaygain.is_checked(str(mp3))
|
|
545
|
+
initial_sync(config, periodic=True)
|
|
546
|
+
assert filecmp.cmp(mp3, tmp_path / "alac" / "a.mp3", shallow=False)
|
|
547
|
+
assert replaygain.is_checked(str(mp3))
|
|
548
|
+
|
|
506
549
|
def test_tagging_error_never_blocks_the_encode(self, tmp_path, caplog):
|
|
507
550
|
src = tmp_path / "src"
|
|
508
551
|
_tone(src / "a.flac")
|
|
@@ -4,7 +4,7 @@ requires-python = ">=3.14"
|
|
|
4
4
|
|
|
5
5
|
[[package]]
|
|
6
6
|
name = "audio-transcode-watcher"
|
|
7
|
-
version = "0.7.
|
|
7
|
+
version = "0.7.2"
|
|
8
8
|
source = { editable = "." }
|
|
9
9
|
dependencies = [
|
|
10
10
|
{ name = "mutagen" },
|
|
@@ -49,11 +49,11 @@ wheels = [
|
|
|
49
49
|
|
|
50
50
|
[[package]]
|
|
51
51
|
name = "certifi"
|
|
52
|
-
version = "2026.
|
|
52
|
+
version = "2026.10.19"
|
|
53
53
|
source = { registry = "https://pypi.org/simple" }
|
|
54
|
-
sdist = { url = "https://files.pythonhosted.org/packages/
|
|
54
|
+
sdist = { url = "https://files.pythonhosted.org/packages/a6/bd/1436c50cc46699de0230fbaacc1d1de7bfec413176099949e9d5112e88f2/certifi-2026.10.19.tar.gz", hash = "sha256:035c1e85572b141bf1c3a3eff0e33a8eb74917522f2559075ff8d2fea780a1ae", size = 137598, upload-time = "2026-10-20T02:24:16.604Z" }
|
|
55
55
|
wheels = [
|
|
56
|
-
{ url = "https://files.pythonhosted.org/packages/
|
|
56
|
+
{ url = "https://files.pythonhosted.org/packages/c4/51/29046e48f693c54e5b7412216d447a1d8362c9653148d98c02cdf65fa733/certifi-2026.10.19-py3-none-any.whl", hash = "sha256:42d35340cc5b9ba78e818ddbff0c5b1c2b779de448a340fd1b989f5fa8670e1b", size = 136464, upload-time = "2026-10-20T02:24:15.072Z" },
|
|
57
57
|
]
|
|
58
58
|
|
|
59
59
|
[[package]]
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{audio_transcode_watcher-0.7.0 → audio_transcode_watcher-0.7.2}/.beads/hooks/prepare-commit-msg
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{audio_transcode_watcher-0.7.0 → audio_transcode_watcher-0.7.2}/.github/workflows/release.yml
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{audio_transcode_watcher-0.7.0 → audio_transcode_watcher-0.7.2}/docs/images/social-preview.png
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|