Commit graph

32 commits

Author SHA1 Message Date
Guy Bloom
2bd77b9895
Fix convert --format with never_convert_lossy_files (#6171)
## Description

Fixes #5625 

When `convert.never_convert_lossy_files` is enabled, `beet convert` was
ignoring the explicit `--format` option and just copying the lossy files
without
transcoding them. For example:

- `beet convert format:mp3 --format opus`

would still produce MP3 files instead of OPUS.

Change:

- Allows to override options `never_convert_lossy_files`, `max_bitrate`
or `no_convert` for `beet convert` as well as trying to convert to the
same format as existing already with a new option `--force`. That way,
for example lossy files selected by the query are transcoded to the
requested format anyway.
- Keeps existing behavior for automatic conversion on import (no CLI
override there).
- Adds tests to cover checking whether `--force` correctly overrides
settings or CLI options.
- Documents the behavior in the convert plugin docs

Co-authored-by: J0J0 Todos <jojo@peek-a-boo.at>
2025-12-03 22:48:41 +01:00
Šarūnas Nejus
4a361bd501
Replace format calls with f-strings 2025-08-30 18:42:26 +01:00
Šarūnas Nejus
c6b5b3bed3
Replace assertFileTag and assertNoFileTag 2025-07-09 09:21:50 +01:00
Šarūnas Nejus
ca4fa6ba10
Replace assertIsFile 2025-07-09 09:21:50 +01:00
Šarūnas Nejus
e6d5f73964
Use pathlib.Path in test_convert 2025-07-09 09:21:49 +01:00
Šarūnas Nejus
31dbd51222
Replace assertExists and assertNotExist 2025-07-09 09:21:49 +01:00
Šarūnas Nejus
c490ac5810
Fix formatting 2025-05-07 10:41:01 +01:00
Šarūnas Nejus
9acfa3c175
Remove arg_encoding 2025-04-21 12:41:57 +01:00
Šarūnas Nejus
179ed13e09
Say bye to util._fsencoding 2025-04-21 12:41:57 +01:00
Šarūnas Nejus
69dbfd9868
Fix lints
These seem to have managed to escape the CI checks since the previously
merged PR was based on master commit which did not include the checks.
2024-10-30 12:13:30 +00:00
Joseph Bushell
4b78abd939 create seperate in_no_convert function, update tests 2024-10-26 19:09:56 +01:00
Joseph Bushell
bba11be9f7 update test assertions 2024-10-26 18:17:39 +01:00
Joseph Bushell
a73919b4ba add test for no_convert when using OR query 2024-10-26 18:17:27 +01:00
Joseph Bushell
d1c88bbd25 consider value of no_convert as one query rather than splitting 2024-10-26 18:17:00 +01:00
Šarūnas Nejus
5f78d1b82b
Remove some lint exclusions and fix the issues
* Replace `noqa` comments in `assert...` method definitions with
  a configuration option to ignore these names.
* Use the `__all__` variable to specify importable items from the
  module, replacing `*` imports and `noqa` comments for unused imports.
* Address issues with poorly named variables and methods by renaming
  them appropriately.
2024-09-21 11:59:19 +01:00
Šarūnas Nejus
4b69b493d2
Use f-string syntax 2024-08-16 17:47:23 +01:00
Šarūnas Nejus
f9359df0d1
Replace assertNotEqual 2024-08-12 08:43:42 +01:00
Šarūnas Nejus
9a05d27acf
Replace assertEqual 2024-08-12 08:43:42 +01:00
Šarūnas Nejus
2616bcc950
Replace assertIsNotNone 2024-08-12 08:43:41 +01:00
Šarūnas Nejus
cb82917fe0
Replace assertFalse 2024-08-12 08:43:41 +01:00
Šarūnas Nejus
0ecc345143
Replace assertTrue 2024-08-05 17:11:16 +01:00
Šarūnas Nejus
8d85cfd72a
Define AsIsImporterMixin to run autotag=False importer 2024-07-28 18:58:53 +01:00
Šarūnas Nejus
f042f5ad32
Leave a single source of truth for importer setup 2024-07-28 18:58:53 +01:00
Šarūnas Nejus
1f8466f04a
Move create_importer to ImportHelper 2024-07-28 18:58:53 +01:00
Šarūnas Nejus
fcff5d72af
Remove def suite TestLoader definitions 2024-07-28 18:58:51 +01:00
Šarūnas Nejus
432da560e4
Create PluginTestCase to dedupe plugin setup 2024-07-28 18:58:35 +01:00
Šarūnas Nejus
16cf8dd937
Centralize db setup on disk 2024-07-28 18:58:34 +01:00
Šarūnas Nejus
2d5fd907c3
Remove redundant setup_beets and teardown_beets instructions 2024-07-28 18:58:34 +01:00
Šarūnas Nejus
3e278159ed
Dedupe TestHelper and _common.TestCase setup 2024-07-28 18:58:33 +01:00
Lars Kruse
508d28f66b tests: move reusable test-related modules into the beets package
External Python packages interfacing beets may want to use an in-memory
beets library instance for testing beets-related code.
The `TestHelper` class is very helpful for this purpose.
Previously `TestHelper` was located in the `test/` directory.
Now it is part of `beets` itself (`beets.test.helper.TestHelper`) and
can be easily imported.
2024-01-15 19:40:57 +01:00
Serene-Arc
a6e5201ff3 Apply formatting tools to all files
This is 'the big one', which touches every file so that it all conforms
to the given standard.
2023-10-22 09:53:18 +10:00
Serene-Arc
84c0ab6857 Correctly refactor tests 2023-10-17 19:39:03 +10:00
Renamed from test/plugin/test_convert.py (Browse further)