Commit graph

326 commits

Author SHA1 Message Date
freddiewanah
672a348852 fix a typo when during the refactoring. 2024-04-10 15:11:29 +02:00
freddiewanah
9a843e5d6b Refactor to merge similar test methods 2024-04-09 17:02:08 +02:00
freddiewanah
e0de6e1b89 refactor the test methods to avoid suboptimal asserts. 2024-04-08 21:39:25 +08:00
freddiewanah
dcad94d2c6 refactor the test methods to avoid sleepy test or should consider comment the sleep command 2024-04-08 19:16:51 +08:00
Dr-Blank
f0fb1565dd
regression test for the bugfix
- generic method to check if operation was performed
 - add test of deinterlace operation
 - add test for multiple operations performed if required (fails on master)
2024-03-18 10:32:13 -04:00
Serene
8720d6413b
Merge pull request #5063 from Maxr1998/fix-advancedrewrite-simple-rules
advancedrewrite: Fix simple rules being overwritten by advanced rules
2024-03-01 16:08:37 +10:00
Serene-Arc
83242fd7cf Apply formatting 2024-03-01 15:21:25 +10: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
Lars Kruse
2b99c12430 tests: move TerminalImportSessionSetup from tests.test_ui_importer to test.helper
This class is imported by some other test modules.
Thus, it should reside in a module, which is obviously used by other
tests.
2024-01-15 19:40:57 +01:00
Lars Kruse
7707e23456 tests: move reusable components from test.test_importer to test.helper
`ImportHelper` and `AutotagStub` are used in many tests.
Thus, they should reside in a module which is obviously used by multiple
tests.
2024-01-15 19:40:57 +01:00
Maxr1998
b1d9169abe
advancedrewrite: Fix simple rules being overwritten by advanced rules 2024-01-01 18:32:06 +01:00
Max Goltzsche
58e5b02929
smartplaylist: add --uri-format option
Beets web API already allows remote players to access audio files but it doesn't provide a way to expose the playlists defined using the smartplaylist plugin.
Now the smartplaylist plugin provides an option to generate ID-based item URIs/URLs instead of paths.
Once playlists are generated this way, they can be served using a regular HTTP server such as nginx.

To provide sufficient flexibility for various ways of integrating beets remotely (e.g. beets API, beets API with context path, AURA API, mopidy resource URI, etc), the new option has been defined as a template with an `$id` placeholder (assuming each remote integration requires a different path schema but they all rely on using the beets item `id` as identifier/path segment).

To prevent local path-related plugin configuration from leaking into a HTTP URL-based playlist generation (invoked with CLI option in addition to the local playlists generated into another directory), setting the new option makes the plugin ignore the other path-related options `prefix`, `relative_to`, `forward_slash` and `urlencode`.

Usage examples:
* `beet splupdate --uri-format 'http://beets:8337/item/$id/file'` (for beets web API)
* `beet splupdate --uri-format 'http://beets:8337/aura/tracks/$id/audio'` (for AURA API)

(While it was already possible to generate playlists containing HTTP URLs previously using the `prefix` option, it did not allow to generate ID-based URLs pointing to the beets web API but required to expose the audio files using a web server directly and refer to them using their file system `$path`.)

Relates to #5037
2023-12-16 05:37:27 +01:00
Max Goltzsche
385c05f98e
smartplaylist: change option --extm3u to --output
The boolean flags `--extm3u` and `--no-extm3u` are replaced with a string option `--output=m3u|m3u8`.
This reduces the amount of options and allows to evolve the CLI to support more playlist output formats in the future (e.g. JSON) without polluting the CLI at that point.
2023-12-16 00:23:03 +01:00
Adrian Sampson
1efd67cb82
Merge pull request #5044 from Maxr1998/advancedrewrite-rewrite
advancedrewrite: Support simple syntax and improve advanced syntax
2023-12-15 09:34:25 -05:00
Max Goltzsche
b07a2e42f4
smartplaylist: add extm3u/extinf/m3u8 support
This is to be able to display meaningful metadata and search a playlist within a player without having to load the linked audio files of a playlist.
2023-12-14 01:46:14 +01:00
Maxr1998
304a052dfd
advancedrewrite: Support simple syntax and improve advanced syntax 2023-12-13 14:48:43 +01:00
Doron Behar
729a11e211 mbsubmit: Add picard PromptChoice
Make it possible to open picard from the import menu when there are weak
recommendations.
2023-12-05 13:49:03 +02:00
jeff
7b0f5fb3f3 Add config option to prefer synced lyrics over plain 2023-11-05 11:26:33 -05:00
jeff
e14982cad7 Add LRCLIB as a provider for the lyrics plugin 2023-11-05 11:26:33 -05:00
wisp3rwind
1c6113694d fixup noqa after black auto-formatting 2023-10-22 10:22:09 +02:00
Serene-Arc
508471633a Fix moved noqa 2023-10-22 10:00:22 +10: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
Adrian Sampson
9e86162be0
Remove apparently-wrong assert
This assertion was silently a no-op for years, and it apparently fails.
So since we were not even testing it before, it is at least no worse to
just remove it.
2023-10-20 16:12:06 -04:00
Adrian Sampson
0b382853ed
Style fix 2023-10-20 15:56:37 -04:00
Adrian Sampson
cd3fca3d50
has_calls -> assert_has_calls
AFAICT, `mock.has_calls` *never* existed. It only started emitting a
warning recently. And for some reason I only see this crop up on
Windows? Truly mysterious.
2023-10-20 15:52:12 -04:00
Serene-Arc
84c0ab6857 Correctly refactor tests 2023-10-17 19:39:03 +10:00