Commit Graph
67 Commits
Author SHA1 Message Date
Šarūnas Nejus 951e32a852 Use pathlib.Path wherever possible in tests 2026-07-30 12:18:49 +01:00
Šarūnas Nejus 02a2c5700a Make RSRC a pathlib.Path 2026-07-24 17:03:57 +01:00
Šarūnas Nejus d24c0d341e Rename PathsMixin.temp_dir_path to PathsMixin.temp_path for consistency 2026-07-21 11:15:25 +01:00
Šarūnas Nejus 230bf19c7f Remove redundant test logic exposed by full coverage
- Removing the coverage omit configuration exposed unused branches, helpers, and
  fixtures across the test suite.
- Delete that redundant logic and simplify affected tests while preserving their
  behavior.
2026-07-07 15:57:35 +01:00
Sebastian Mohr 54a2bd20e1 Removed This file is part of beets... headers. 2026-06-29 11:20:15 +02:00
Sebastian Cao 755ca6f139 convert: skip missing album art instead of crashing 2026-06-24 16:45:23 +08:00
Sebastian Mohr 579c79b1ab Removed plugin: prefix from logging specific tests. 2026-06-20 13:28:47 +02:00
Šarūnas Nejus 28c290584c Remove ConvertMixin 2026-06-04 03:04:33 +01:00
Šarūnas Nejus d5e42b4652 Remove shell_quote func 2026-06-04 03:01:56 +01:00
Šarūnas Nejus 0217cc35d2 Parametrize never_convert_lossy_files transcode tests
- Consolidate the lossy and lossless convert cases into one focused parametrized
  test.
- Cover both enabled and disabled flag behavior for lossless sources while
  preserving the lossy conversion assertions.
2026-06-04 02:48:21 +01:00
Šarūnas Nejus 417b8b067d Create test_force_overrides 2026-06-04 02:47:02 +01:00
Šarūnas Nejus 7369da9e0b Remove unused function 2026-06-03 22:19:03 +01:00
Šarūnas Nejus 77890b431d Test playlist entry using parametrize 2026-06-03 22:19:03 +01:00
Šarūnas Nejus 772ef8a09f Test transcode using parametrize 2026-06-03 22:19:03 +01:00
Šarūnas Nejus 17ad1f96b8 Use filepath.suffix 2026-06-03 22:19:03 +01:00
Šarūnas Nejus c6d51ba9fe Share convert_dest between tests 2026-06-03 22:19:02 +01:00
Sebastian Mohr c60131e858 Replaced original setUp functions with setup_beets 2026-06-03 23:02:27 +02:00
Šarūnas Nejus 76df165f51 Remove setup arg from fixtures that do not need it 2026-06-03 21:43:41 +01:00
Sebastian Mohr 3e504b2067 NeverConvertLossyFilesTest -> TestNeverConvertLossyFiles
Also import cleanup.
2026-06-03 20:53:08 +02:00
Sebastian Mohr 49f57da73f ConvertCliTest -> TestConvertCli 2026-06-03 20:53:08 +02:00
Sebastian Mohr f1a4b22ce5 ImportConvertTest -> TestImportConvert
Renamed AsIsImporterMixin to AsIsImporterHelper
2026-06-03 20:52:58 +02:00
Sebastian Mohr dab112b45b Use PytestPluginTestHelper for TestNoConvert. 2026-06-03 19:55:51 +02:00
Sebastian Mohr adfb73b66d Run ruff format 2026-05-20 16:53:06 +02:00
Šarūnas Nejus b15006ca11 Remove dependency on global config 2026-05-06 15:30:10 +01:00
Šarūnas Nejus ccdccdfa8d Remove slow_test unittest marker 2026-04-22 21:47:16 +01:00
Šarūnas Nejus a5a9775930 convert: generate playlist entries from effective output paths
Build playlist paths using the selected format (`--format`/config), and only
replace extensions when the destination file is actually transcoded.

Precompute playlist entries before conversion runs so `--keep-new` does not
pick up mutated item paths and produce mismatched extensions.

Add/expand convert CLI tests to cover:
- config format playlist extension
- `--format` override playlist extension
- no-transcode (`no_convert`) playlist extension
- `--keep-new` destination playlist path behavior
2026-03-04 15:38:33 +00:00
Šarūnas Nejus bc9213a4ed Fix lint issues 2026-03-04 15:28:30 +00:00
Šarūnas Nejus c46f99a82b Merge branch 'master' into pr-fix-convert-ext 2026-03-04 15:22:40 +00:00
Šarūnas Nejus d613981efe Replace capture_output with io.getoutput 2026-02-10 00:53:20 +00:00
Šarūnas Nejus fea789bb59 Replace control_stdin with io.addinput 2026-02-10 00:53:20 +00:00
Šarūnas Nejus b964d8b7eb Configure future-annotations 2026-01-13 20:55:40 +00:00
Guy BloomandJ0J0 Todos 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
Pierre Ayoub cf2cd36d61 [test_convert] Use a regular assert
Fix linting error Ruff (PT009)
2025-05-14 09:37:52 +02:00
Pierre Ayoub 7cab10b191 Fix linter error 2025-05-14 09:37:52 +02:00
Pierre Ayoub d5a112f952 Fix formatting error 2025-05-14 09:37:52 +02:00
Pierre Ayoub 953cb75712 Add a unit test for playlist file extension 2025-05-14 09:37:52 +02: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