Commit graph

2795 commits

Author SHA1 Message Date
Dr-Blank
6a27a8de3c
satisfy the linter 2024-04-11 13:42:56 -04:00
freddiewanah
c64d3e3f24 fix logic issue 2024-04-11 19:04:50 +02:00
freddiewanah
dba24a7d96 reformat with black 2024-04-11 18:44:32 +02:00
freddiewanah
a3b5101d1a resort the import library 2024-04-10 15:40:40 +02:00
freddiewanah
96c9a9531f update lint issues 2024-04-10 15:21:57 +02:00
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
67d14a2e12 remove extra setups in the test class 2024-04-09 16:46:35 +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
freddiewanah
3045550368 remove redundant prints 2024-04-08 19:14:42 +08:00
Dr-Blank
0e7d35fd69
tests for barcode field 2024-03-18 13:23:10 -04: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
Lars Kruse
4c2362b361 tests: remove import path mangling while importing 'test._common'
The import path mangling is not relevant (anymore?) for the two
ways of running tests:

* `python3 test/testall.py` (see CONTRIBUTING.rst):
  The `testall.py` script already adds the project path to `sys.path`.
* `tox -e py-cov`: this command is supposed to be run from the project
  path. Thus, the current directory is already the first of location
  in `sys.path`.

The previous mangling of the import path while loading a module could
lead to unwanted side-effects hidden in an unexpected location.
Instead, import path mangling should take place in the script being
called by the user (here: `testall.py`).
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
cc0979692b
Better mocking for getfullargspec
Seems much more straightforward this way?
2023-10-20 17:36:21 -04:00
Adrian Sampson
a9e1b607c5
Fix inspect mocking
File this under "I have no idea how this *ever* worked"...
2023-10-20 17:07:35 -04: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
0ccd70de94
Merge pull request #4951 from Serene-Arc/test_separation 2023-10-17 21:12:15 +10:00
Serene-Arc
84c0ab6857 Correctly refactor tests 2023-10-17 19:39:03 +10:00
Serene-Arc
5023887d84 Rename directory 2023-10-17 19:22:11 +10:00
Serene-Arc
e8e1c3b972 Sort plugin tests into specific folder 2023-10-16 12:58:51 +10:00
David Swarbrick
1249380767 Fix handling of whitespace near color codes
Improve the split_into_lines regex and whitespace handling
so that spaces are handled and colored text can be wrapped
Create a new test suite for the color splitting function as
it was previously introducing rogue escape characters when
splitting colorized words.
2023-10-14 10:43:12 +02:00
J0J0 Todos
be290e5444 A large code-overhaul of the beets ui:
- Allow user to change UI colors in config file.
 - "Change Representation" class allows Albums and Track
   matches to reuse similar formatting code
 - Functions to split text into lines for printing
 - Tests for the new UI to check wrapping functions
2023-10-14 10:42:48 +02:00
AdrienCos
96b89e77f6 Fix the error with CAA where no image would be downloaded when thumbnails are missing 2023-10-07 23:14:03 +02:00
AdrienCos
e7105a9763 Fix the error with CAA where the pre-sized thumbs of release groups would be ignored 2023-10-07 21:25:02 +02:00
Adrian Sampson
c15ccb16bf
Merge pull request #4900 from fracai/4326-scrub-no-rewrite
4326 scrub should not restore on import if "write" is disabled
2023-09-16 12:47:07 -04:00
Arno Hautala
5c34db565c must unload_plugins() during teardown after load_plugins() during setup 2023-09-12 20:09:59 -04:00
Adrian Sampson
cd0f2b1aa3
Merge pull request #4899 from fracai/update-field-exclusions
Support excluding fields with update command
2023-09-12 11:18:29 -04:00
Arno Hautala
e91a56d180 fix tests 2023-09-11 12:03:25 -04:00
Arno Hautala
8defbe4093 scrub on import tests 2023-09-10 19:03:13 -04:00
Arno Hautala
bdfed9bff0 naming consistency 2023-09-09 11:40:52 -04:00
Arno Hautala
e477523530 fix test 2023-09-09 11:31:23 -04:00
Arno Hautala
65aaa96297 test 2023-09-09 11:12:58 -04:00
Jesse Bannon
f72261e44f
Add support for artists and albumartists multi-valued tags (#4743)
Adds the following fields with id3v2.4 multi-valued tag support to autotag:
    - artists, artists_sort, artists_credit
    - albumartists, albumartists_sort, albumartists_credit
    - mb_artistids, mb_albumartistids

MusicBrainz support to populate + write the above multi-valued tags by default. Can be toggled to use id3v2.3 or id3v2.4 tags via the existing beets configuration option `id3v23`.

Big thanks to @JOJ0, @OxygenCobalt, @arsaboo for testing + @sampsyo for the initial code review .
2023-09-09 09:46:26 +02:00
J0J0 Todos
8d835b8cab Fix ipfs plugin and test_ipfs
by using store(inherit=False) for the creation of a new "ipfs album" as well as
when test_ipfs creates album+items to compare with.
Or put differently: Make ipfs and test_ipfs keep the old store() behaviour for
which the plugin initially was built for.
2023-08-23 06:34:16 +02:00
J0J0 Todos
94d00418b4 Fix test_albuminfo_change_artist_does_not_change_items
by adding (inherit=True) to fit with the new behaviour of the store() method
and add a second test that checks the opposite.
2023-08-23 06:34:16 +02:00
luzpaz
8419149c7a
Fix various typos 2023-08-09 21:26:15 -04:00
Adrian Sampson
af0df4ca03
Missed a couple of cases in tests 2023-07-31 10:26:59 -07:00
J0J0 Todos
e18b9432a5 Use f-string in test_importfeeds
Quickfix a thing ment for #4863
2023-07-28 07:04:06 +02:00
J0J0 Todos
546e1b8751 Add test for #4863 importfeeds m3u_session feature 2023-07-27 07:56:55 +02:00
wisp3rwind
3965858ac1 replaygain: apply review feedback: fixup previous refactor, improve tests
by adding files which are not completely silent, thus hitting a different
code path in some calculations

The sample files were generated using
> sox -n whitenoise.flac synth 00:00:02 whitenoise
> ffmpeg -i whitenoise.flac whitenoise.opus
> ffmpeg -i whitenoise.flac whitenoise.mp3
2023-07-22 12:47:19 +02:00
Benedikt
fc05a85c3b
Merge pull request #4850 from wisp3rwind/pr_add_syspath_4
tests: make use of our custom filesystem assertions for conciseness
2023-07-18 22:02:48 +02:00
wisp3rwind
9af9eb9b31 tests: make use of our custom filesystem assertions for conciseness
this replaces assertions of the form
    self.assertTrue(os.path.exists(syspath(path)))
by
    self.assertExists(path)
which includes the syspath conversion and is much easier to read.

Occurences where located using
    git grep -E 'assert(True|False).*(isdir|isfile|exist)'
2023-07-16 10:42:47 +02:00
wisp3rwind
29c21860a9 add missing syspath conversions (2/3, beetsplug) 2023-07-16 10:17:40 +02:00
Boris-Chengbiao Zhou
dcaac12860 Handle missing release-relation-list field during pseudo-release lookup
Some pseudo-releases (erroneously) lack the relation to the actual
release which previously would've caused a crash.
2023-06-29 23:39:19 +02:00
Adrian Sampson
16a30f4d74
Merge pull request #4714 from TypicalFence/gh-654
resolve transl-tracklisting relations for pseudo releases
2023-06-26 14:40:28 -07:00
wisp3rwind
1ef6b90786 add missing syspath conversions (1/3, tests)
these are mostly in the tests, which didn't cause issues since the
affected directories usually have nice ASCII paths. For consistency, it
is nicer to always invoke syspath. That also avoids deprecation warnings
for the bytestring interfaces on Python <= 3.5. The bytestring
interfaces were undeprecated with PEP 529 in Python 3.6, such that we
didn't observe any actual failures.
2023-06-24 14:52:46 +02:00
wisp3rwind
09d2c87f29 typings: corrections for dbcore/queryparse
- Add NamedQuery abstract class to be able to express the expectation
  that a query should be such a query (and have a specific constructor
  signature) in construct_query_part
- slightly (and probably completely irrelevantly) improve Query.__hash__
- also, sprinkle some ABC/abstractmethod around to clarify things
2023-06-23 10:59:51 +02:00
fence
dccc62443d fix tests 2023-06-19 20:13:16 +02:00
fence
e992b82bdf resolve transl-tracklisting relations for pseudo releases 2023-06-19 19:27:25 +02:00
Adrian Sampson
5e8d605749
Don't require reflink to run tests
A small change, as discussed in #4798, to avoid depending on the reflink
library to run *all* tests. The library seems to be unmaintained and it
may be annoying to install.
2023-05-30 21:15:34 -07:00
wisp3rwind
7169ac81f5 tests: close library in ParentalDirCreation test 2023-05-07 18:43:43 +02:00
wisp3rwind
5de1d12610 tests: address some warnings
- some helper functions were incorrectly detected as being tests due to
  their name
- use of the deprecated assertEquals alias
2023-05-07 18:43:43 +02:00
wisp3rwind
0d1fa172de tests: explicitly close sqlite3 connections
on Python 3.11, the Windows CI started crashing due to the database file
remainig open unexpectly in test shutdown; this attemps to fix that
2023-05-07 18:43:43 +02:00
J0J0 Todos
2bcf16b10c Fix linter error in test_embedart 2023-04-22 08:23:38 +02:00
J0J0 Todos
8af31058e8 Fix a typo in test_embedart 2023-04-21 21:56:42 +02:00
J0J0 Todos
f6b0311221
Merge pull request #4719 from arsaboo/embedart_url
Added option to embedart using an image URL [small PR]
2023-04-21 21:52:04 +02:00
J0J0 Todos
56adba719b Fix text/html file ending in embedart -u test
Makes it more clear what we are doing.
2023-04-21 21:22:27 +02:00
J0J0 Todos
f3d4929638 Fix embedart -u test names
and shorten second and third test a little by providing -y cli flag. Enough to
test with interactive input once. Move all 3 tests to the very bottom of the
test class.
2023-04-21 20:12:16 +02:00
Alok Saboo
47cb11bad7 Add test for invalid URL 2023-04-21 08:31:36 -04:00
Alok Saboo
919f326400 Add test for png image 2023-04-21 08:23:12 -04:00
J0J0 Todos
3dd32c93dc Add test for embedart -u fetching jpeg from url 2023-04-21 07:59:16 +02:00
J0J0 Todos
efc88193f9 Add test_reimported_album_not_preserves_flexattr
Checks if a reimported album flexible attribute "data_source" will be updated
correctly from the match being applied.
2023-04-11 07:11:20 +02:00
Šarūnas Nejus
724b06a77d
Define SingletonQuery to perform filtering through SQL
This slightly speeds up the queries and there's a nice side-effect where
`singleton:1` and `singleton:0` now work fine!

This is ultimately building towards replacing as many python-only
queries with SQL equivalents.
2023-04-08 06:15:04 +01:00
J0J0 Todos
99231160a7 convert: playlist: M3U read as bytes
- M3UFile.read() method reads in rb mode.
- M3UFile.read() method handles removal of (platform specific) line endings.
- Playlist contents and EXTM3U header is handled as bytes.
- Fix test_playlist*read* tests to encode playlist UTF-8 assert strings to
  bytes using bytestring_path() before comparision.
  - Fixture playlist_windows.m3u8 is now actually Windows formatted (\r\n + BOM)
2023-03-29 07:46:08 +02:00
J0J0 Todos
a4d03ef586 convert: playlist: M3U write + contents as bytes
Make sure we stay with the beets standard of handling everything internally as
bytes.

- M3UFile.write() method writes in wb mode.
- Playlist contents and EXTM3U header is handled as bytes.
  - item.destination() gives us unicode string paths, we tranlate to bytes
    using util.bytestring_path().
- Fix test_playlist*write* tests to encode UTF-8 assert strings as bytes using
  bytestring_path() before comparision.
2023-03-29 07:46:08 +02:00
J0J0 T
068208f71e convert: Fix copyright year in test_m3ufile.py 2023-03-29 07:46:08 +02:00
J0J0 T
c28eb95ef2 convert: playlist: Remove debug print winpath
in test.
2023-03-29 07:46:08 +02:00
J0J0 T
ff03ecaa27 convert: playlist: Add another Windows test
Add test_playlist_write_and_read_unicode_windows: Writes 2 media file
paths containing unicode characters, reads them in using M3UFile class
again and tests if the contents is correct.
2023-03-29 07:46:08 +02:00
J0J0 T
39efd23d06 convert: playlist: Fix winpath driveletter in test
Needs to be put including (double) backslash!
2023-03-29 07:46:08 +02:00
J0J0 T
a641fd151e convert: playlist: debug winpath in test 2023-03-29 07:46:08 +02:00
J0J0 T
54d22bea6e convert: playlist: Construct winpath before assert 2023-03-29 07:46:08 +02:00
J0J0 T
31b9e7afeb convert: playlist: Construct Windows path programatically 2023-03-29 07:46:08 +02:00
J0J0 T
004d10a143 convert: playlist: Put actual Windows paths
into fixture file for the Windows unittest.
2023-03-29 07:46:08 +02:00
J0J0 T
bd5335f31f convert: playlist: Separate unicode test for Windows 2023-03-29 07:46:08 +02:00
J0J0 T
2c1163cbc5 convert: playlist: Linter and import fixes
in m3u module and testsuite.
2023-03-29 07:46:08 +02:00
J0J0 T
39e4b90b5c convert: playlist: Add tests checking extm3u and
fix extm3u check in load method.
2023-03-29 07:21:27 +02:00
J0J0 T
68240f6e03 convert: playlist: Add EmptyPlaylistError and test
- Add and Exception class called EmptyPlaylistError ought to be raised
  when playlists without files are loaded or saved.
- Add a test for it in test_m3ufile
- Fix media_files vs. media_list attribute name.
2023-03-29 07:21:27 +02:00
J0J0 T
0cbf91e4d8 convert: playlist: Add test_m3ufile and fixtures
Add several tests checking loading and saving unicode and regular ascii
text playlist files.
2023-03-29 07:21:27 +02:00
J0J0 T
e41525adbc convert: playlist: Remove clutter from test
- Remove comments in tearDown
- Don't test for converted.mp3, it's done in a separate test already, we
  only want to test for the playlist file here.
2023-03-29 07:21:27 +02:00
J0J0 T
9930a5da59 convert: playlist: Test playlist existence
Broken commit around writing a unittest that checks for existence of an
m3u file after convert has been called with --playlist option.
2023-03-29 07:21:27 +02:00
J0J0 Todos
c6746ed399 Add a test for Beatport ID extraction 2023-03-08 18:29:04 +01:00
J0J0 Todos
af600497ee Add a test for Deezer ID extraction 2023-03-08 18:28:41 +01:00
J0J0 Todos
c1299f64a1 Add a test for Spotify metadata ID extraction 2023-03-08 18:22:54 +01:00
J0J0 Todos
0175a9aed8 Introduce new module beets.util.id_extractors
- We introduce a new submodule of beets.util named id_extractors.
- Parts of the ID extraction utilites required by metadata source plugins
  should live there.
- Also this enables future usage of those utilities from the "outside" of
  metadata source plugins.
- Move Discogs ID extractor to the new module and change test_discogs to use
  the new location.
- Add spotify_id_regex variable to the new module.
2023-03-08 18:12:31 +01:00
J0J0 Todos
4908e1ae09 Fix flake8 issues in test_ui.py
that were introduced in 27218a94.
2023-02-28 09:24:30 +01:00
J0J0 Todos
93fa19f493 Fix albumtypes plugin and its tests
The new database type DelimitedString does list to string and vice versa
conversions itself.
2023-02-27 13:43:03 +01:00
Jonathan Matthews
27218a9490 Mark albumtype/s expected test failure as fixed 2023-02-27 13:43:03 +01:00
Benedikt
22ca6eff82
Merge pull request #4374 from wisp3rwind/pr_drop_old_python
Drop Python 3.6, some Python 2 + Python <= 3.6 cleanup
2023-02-19 10:19:36 +01:00
wisp3rwind
e6fd038b0e tests: robustify path query / case_sensitive tests
- samefile exists on all platforms for recent python
- don't rely on monkey-patching os/os.path and on specifics on the
  implementation: as a result of doing so, the tests start failing in
  obscure ways as soon as the implementation (and its usage of
  os.path.exists and os.path.samefile) is changed
2023-02-12 16:16:43 +01:00
wisp3rwind
12173d30a8 permissions: Move syspath conversion to the actual API boundary 2023-02-12 14:04:24 +01:00
Katelyn Dickey
f0359007a5
Code style fixes 2023-01-31 11:26:22 -05:00
Katelyn Dickey
2c43adf463
Fix album store method to cascade flex field deletions to items 2023-01-31 01:31:53 -05:00
wisp3rwind
a6d74686d8 test: separate case_sensitive unit tests from PathQueryTest
- move tests for case_sensitive to test_util.py, since this is not
  really the concern of PathQueryTest
- removes part of the tests, since the tests that patch os.path.samefile
  and os.path.exists are super brittle since they test the
  implementation rather than the functionality of case_sensitive().
  This is a prepartory step for actually changing the implementation,
  which would otherwise break the tests in a confusing way...
2022-12-24 13:36:53 +01:00
wisp3rwind
d24cf69269 remove old Python: remove util.text_string
This was a helper for situations when Python 2 and 3 APIs returned bytes
and unicode, respectively. In these situation, we should nowadays know
which of the two we receive, so there's no need to wrap & hide the
`bytes.decode()` anymore (when it is still required).

Detailed justification:

beets/ui/__init__.py:
- command line options are always parsed to str

beets/ui/commands.py:
- confuse's config.dump always returns str
- open(...) defaults to text mode, read()ing str

beetsplug/keyfinder.py:
- ...

beetsplug/web/__init__.py:
- internally, paths are always bytestrings
- additionally, I took the liberty to slighlty re-arrange the code: it
  makes sense to split off the basename first, since we're only
  interested in the unicode conversion of that part.

test/helper.py:
- capture_stdout() gives a StringIO, which yields str

test/test_ui.py:
- self.io, from _common.TestCase, ultimately contains a
  _common.DummyOut, which appears to be dealing with str (cf.
  DummyOut.get)
2022-12-24 13:09:26 +01:00
wisp3rwind
1c7889b0ba tests: add a (failing) test for issue #4528 2022-12-18 09:10:02 +01:00
wisp3rwind
d5f998b312 tests: fix assertions for empty MediaFile.images
used to work due to inconsistent mediafile implementation, but with
https://github.com/beetbox/mediafile/pull/64 (in mediafile >= 0.11.0)
list fields are None if non-existent, not the empty list
2022-12-18 08:41:42 +01:00
Adrian Sampson
7cfb55b746
Merge pull request #4546 from luharder/master
Force Tekstowo to check result for match, added Tekstowo test suite
2022-11-26 19:17:19 -08:00
Luke Harder
f155d3ba75 bug 4406 fix v5 (tests pass again) 2022-11-22 20:40:13 -05:00
Bootjewolf
2a282116bd Reorder parameters of _make_track function and fix linting errors 2022-11-19 12:39:16 +01:00
Bootjewolf
4918ee6457 Added test for the parsing of the remixer field 2022-11-15 17:42:34 +01:00
Luke Harder
43f1a8412a bug 4406 fix v3 2022-11-10 14:53:50 -05:00
Luke Harder
252121f537 bug 4406 fix 2022-11-10 12:54:45 -05:00
Aidan Epstein
c906e55ba9 Fix recent bug that would not transcode when format was wrong
Bug introduced in c6d623241b, should_transcode would return False even when the format was different.

Also fix up tests and documentation.
2022-10-19 08:55:51 -07:00
Adrian Sampson
1ebcbf6944
Merge branch 'master' into fix_max_bitrate_default 2022-10-03 11:02:07 -07:00
Jordi Ortolá Ankum
95e0161876
Merge branch 'master' into fix_max_bitrate_default 2022-10-03 10:49:51 +02:00
Adrian Sampson
8baf3e302d
Skip an unhelpful test on Windows
On Windows, converting command-line arguments (hopefully!!!) only needs
to deal with valid strings from the OS. So it is not really relevant to
test with non-UTF-8, non-surrogate bytes.
2022-10-01 17:13:57 -07:00
Adrian Sampson
5ae1e0f3c8
Adapt tests to latest Unidecode version
Unidecode 1.3.5 (a yanked PyPI version) changed the behavior of
Unidecode for some specific characters:

> Remove trailing space in replacements for vulgar fractions.

As luck would have it, our tests used the 1/2 character specifically to
test the behavior when these characters decoded to contain slashes. We
now pin a sufficiently recent version of Unidecode and adapt the tests
to match the new behavior.
2022-10-01 10:33:26 -07:00
Jordi
c6d623241b Fix beets#4472 - set 'max_bitrate' default param to none 2022-10-01 01:20:30 +02:00
Adrian Sampson
e584b043be
Merge pull request #4199 from jcassette/duplicate
Allow to configure which fields are used to find duplicates
2022-08-21 10:44:31 -07:00
Adrian Sampson
1054b729d3
Merge branch 'master' into duplicate 2022-08-21 10:34:15 -07:00
Adrian Sampson
3c945cba0c
Change config key from "single" to "item"
For consistency with the rest of the terminology in the docs/config.
Also, correct the documentation (which previously only covered albums).
2022-08-21 10:31:45 -07:00
Adrian Sampson
8c84bae689
Remove match_querystring in responses
Quoth the responses documentation:

> querystring is matched by default

Not sure how recent this is, unfortunately---but probably 0.17.0, since
that's the version where `match_querystring` was deprecated.
2022-08-21 08:18:49 -07:00
Adrian Sampson
63b7595bd4
Remove use of imp
The replacements in `importlib.util` have been available since Python
3.5.
2022-08-21 08:13:07 -07:00
Adrian Sampson
7af40db050
Merge branch 'master' into formatted-modify 2022-08-20 16:37:52 -07:00
Adrian Sampson
32ce44f589
One more test fix 2022-08-17 16:25:17 -07:00
Adrian Sampson
495c8accc0
Update exact query prefix tests 2022-08-17 16:11:16 -07:00
Jaime Marquínez Ferrándiz
8d957f35f9 Add path template "sunique" to disambiguate between singleton tracks 2022-08-12 14:19:52 +02:00
vicholp
6803ef3b83 add test to get item file of web plugin 2022-08-03 01:22:45 -04:00
Adrian Sampson
c5e68f5643
Adapt to pycodestyle changes 2022-07-30 19:54:24 -04:00
Jan Holthuis
3e37d0163e test(import): Add test for _paths_from_logfile method 2022-06-28 00:17:34 +02:00
Šarūnas Nejus
72c5302004
Fix lints 2022-05-31 22:45:05 +01:00
Šarūnas Nejus
ba777dda50
Skip implicit paths tests for win32 2022-05-31 22:34:40 +01:00
Šarūnas Nejus
d68ed1adca
Make implicit path queries explicit and simplify their handling 2022-05-31 21:51:47 +01:00
Benedikt
424c47696b
Merge pull request #4345 from qcasey/qcasey-patch-2
Change "first" and "second" in test_lyrics output to "expected" and "result"
2022-05-06 20:43:33 +02:00
Quinn Casey
1320944898
Update test_lyrics.py 2022-05-05 15:33:32 -07:00
Quinn Casey
a09f5e7dfe
Update lyricstext.yaml 2022-05-05 14:04:54 -07:00
olgarrahan
c0bb2ff2a1 Genius lyrics header bug fixed and updated test case for lyrics plugin 2022-04-15 16:37:05 -04:00
alicezou
2886296c86 fix code review comments 2022-03-29 21:24:13 -04:00
alicezou
67e778fec6 switch to control_stdin 2022-03-29 20:04:56 -04:00
alicezou
a0b0028874 working db 2022-03-29 19:58:15 -04:00
alicezou
c0d05f8545 add test cases 2022-03-27 17:09:30 -04:00
wisp3rwind
b76a3fcaa4 artresizer: move ImageMagick/PIL code from thumbnails plugin to ArtResizer
Makes the dispatch to the chosen backend simpler in the thumbnails
plugin. Given that ArtResizer is not only about resizing art anymore,
these methods fit there quite nicely.
2022-03-12 23:34:46 +01:00
wisp3rwind
e44a08eeb6 artresizer: style fixes 2022-03-12 23:34:46 +01:00
wisp3rwind
1b92dea995 artresizer: move deinterlace functions to backend classes 2022-03-12 20:37:20 +01:00
wisp3rwind
c45d2e28a6 artresizer: move resize functions to backend classes 2022-03-12 20:23:37 +01:00
wisp3rwind
8a969e3041 artresizer: backend classes part 1: stub classes, version checks 2022-03-12 19:48:45 +01:00
J0J0 T
b2f4834b76 discogs: Add URI to test_parse_minimal_release data 2022-03-04 08:17:49 +01:00
Joseph Heyburn
55e4917df3 discogs: allow style to be appended to genre
- Adds a configuration that, when enabled, will append the style to genre
- Rationale is to have more verbose genres in genre tag of players that only support genre
2022-03-02 22:04:36 +00:00
wisp3rwind
1815d08392 artresizer: fix image comparison test
Since the ImageMagick based comparison is now abstracted via ArtResizer,
it becomes a little more involved to mock it for testing.
2022-02-14 22:52:00 +01:00
wisp3rwind
0125b1cd42 artresizer: in backends, always use the appropriate ArtResizer instance
This didn't cause any issues since we only use the shared instance
anyway, but logically it doesn't make a lot of sense for the backends
always using ArtResizer.shared (which they should be oblivious of).
2022-02-12 22:45:22 +01:00
wisp3rwind
a17a5f2fa6 art: move the backend-specific code to util.artresizer
all the other backend-specific code is already there.
2022-02-12 22:45:19 +01:00
Adrian Sampson
debbe4efa5
Merge pull request #4263 from wisp3rwind/pr_better_deprecation_warning
confit: Improve deprecation warning
2022-02-02 10:38:46 -05:00
wisp3rwind
ef59465869 test_replaygain: fix exception handling again
This is the same as d26b0bc1, which I reintroduced again in a new test
due to a botched rebase...
2022-02-01 21:39:42 +01:00
wisp3rwind
cc8c3529fb confit: Improve deprecation warning
Show the actual origin of the import statement, cf. #4024
2022-02-01 19:10:24 +01:00
wisp3rwind
c86d5d0264 lyrics: Rework lyrics assertions for more useful output on failure
Uses a custom assertion to have more detailed output (which should help
with getting an idea what the difference between expected and actual
lyrics is), and use `subTest` to clearly associate test failure to a
backend.

In addition, this strip parenthesis from the lyrics' words. That helps
with the currently failing Tekstowo test, but doesn't entirely fix it.

Requires Python 3.4 for subTest.
2022-01-31 21:07:28 +01:00
Julien Cassette
bf9bf4887c Merge branch 'master' into duplicate
# Conflicts:
#	docs/changelog.rst
2022-01-30 16:47:44 +01:00
Adrian Sampson
2b51b2443b
Remove a relevant test 2022-01-29 18:35:36 -05:00
Adrian Sampson
19e4f41a72
Merge pull request #4251 from rcrowell/query_prefixes
Add query prefixes :~ and :=
2022-01-26 07:51:23 -05:00
Rob Crowell
2cab2d670a Fix bug in StringQuery.string_match 2022-01-25 16:24:04 -08:00
Rob Crowell
6457532274 Add query prefixes :~ and := 2022-01-24 19:19:48 -08:00
Julien Cassette
7633465734 Add duplicate_keys feature for singletons 2022-01-22 22:36:47 +01:00
Julien Cassette
f50d250c4a Review duplicate_keys feature 2022-01-22 16:49:45 +01:00
Julien Cassette
6ce29a6b1b Allow to use flexible attributes in duplicate_keys 2022-01-22 15:00:18 +01:00
wisp3rwind
fd7919e627 replaygain test: add basic importer test 2022-01-22 14:00:32 +01:00
wisp3rwind
676c8fe45e replaygain test: add r128 targetlevel test 2022-01-22 14:00:32 +01:00
wisp3rwind
e8960501f2 replaygain test: extend tests for skipping items
Test more combinations of tags that might initially be present and
expected tags. The R128 codepath and the case of having the wrong type
of tags wasn't really tested before.
2022-01-22 14:00:32 +01:00
wisp3rwind
1442594e5b replaygain test: reorganize backend handling
in an attempt to make it simpler to add new test classes
2022-01-22 14:00:32 +01:00
wisp3rwind
80f7c58e5a replaygain test: add basic per_disc testcase
The per_disc codepath is currently not exercised at all by the tests.
This test is not very meaningful, but better than nothing.
2022-01-22 14:00:32 +01:00
wisp3rwind
81396412ef replaygain test: add album fixtures in individual tests instead of setUp
preparation for adding more tests that want different fixtures
2022-01-22 14:00:32 +01:00
wisp3rwind
ad4c68112f test helper: add support for multi-disc album fixtures 2022-01-22 14:00:32 +01:00
wisp3rwind
c0af86c04a replaygain tests: remove duplicated function
Not sure how this got here, the git blame doesn't make a lot of sense..
maybe an incorrect merge commit?
2022-01-22 14:00:32 +01:00
wisp3rwind
ea0d905b22 replaygain tests: remmove duplicate store()
probably leftover from debugging database issue
2022-01-22 14:00:32 +01:00
wisp3rwind
c272696d9f test_logging: fix incorrect exception handling
Another incorrect py2 -> py3 translation. Since python 3 attached the
traceback to the exception, this should preserve the traceback without
needing to resort to sys.exc_info
2022-01-20 21:16:17 +01:00
wisp3rwind
d26b0bc19b test_replaygain: fix complicated and incorrect exception handling
This is an incorrect translation of a python 2 reraise to python 3.
With python 3, however, we can just rely on exception chaining to get
the traceback, so get rid of the complicated re-raising entirely, with
the additional benefit that the exception from the tear-down is also
shown.
2022-01-20 21:12:59 +01:00
wisp3rwind
807f124ef8 really remove all six imports
apparently, pyupgrade didn't know how to handle these...
2022-01-20 00:26:01 +01:00
mousecloak
0132067a29
Fix @unittest.skipIf annotations to ignore only win32 2022-01-07 21:29:44 -08:00
mousecloak
ec06694097
Makes the import converter respect the quiet and pretend flags.
When the delete_originals was set, beets would print the following, regardless
of the presence of the quiet parameter:

convert: Removing original file /path/to/file.ext

This commit ensures that the log is only printed when quiet is not present.
2022-01-07 21:29:43 -08:00
patrick-nicholson
a3754f7592 Test failing due to unidentified argument processing issue; replacing with API calls gives expected results.
Fixed some linting issues.
2021-12-27 13:26:38 -05:00
patrick-nicholson
086fec0096 Fixed truediv typo (switched to intdiv).
Fixed linter objections.
2021-12-26 21:58:45 -05:00
Duncan Overbruck
0456c8f790
test multiple items in test_modify_formatted 2021-12-15 14:32:11 +01:00
Patrick Nicholson
0ac38c110e Tests for limit plugin 2021-12-07 21:27:57 -05:00
Kirill A. Korinsky
c459ff26fb
Prevent fails of tests when path contains dots
Unit test may fails when path to temprorary library contains `.`; to
garantue that bug wasn't here, it forces to use one more `.` inside path.

Fixes: https://github.com/beetbox/beets/issues/4151
2021-11-19 16:54:28 +01:00
Paldin Bet Eivaz
a1fe106dc5 fixed linting error 2021-11-18 09:37:15 -08:00
Paldin Bet Eivaz
7a30bd6d61 created Spotify track and album info rsrcs 2021-11-17 16:25:26 -08:00
Paldin Bet Eivaz
d7055fac1d added test for track_for_id method 2021-11-17 16:24:10 -08:00
Julien Cassette
b67c25a55d Use slow queries for flexible attributes in aunique (fix #2678, close #3553) 2021-11-11 19:32:55 +01:00
Piotrek Kochański
1a130059e8 deinterlace option to affect when no other processing
remove interlacing by default when resizing/down-scaling, the
`deinterlace` option is to remove interlace when otherwise no processing
would have happened.
2021-11-01 13:51:57 +01:00
Piotrek Kochański
417ef0d453 Merge branch 'master' of github.com:beetbox/beets into deinterlace 2021-10-31 13:27:00 +01:00
Christopher Larson
86465e6437 Allow custom replacements in Item.destination
This allows for the use of differing replacements for destinations other than
the library, which is useful for beets-alternatives in the case where
filesystem requirements differ between the two paths.

Signed-off-by: Christopher Larson <kergoth@gmail.com>
2021-10-27 12:30:16 -07:00
Duncan Overbruck
819ba735bd
allow templates/formatting of set_fields on import 2021-10-27 00:28:23 +02:00
Duncan Overbruck
636e36ef7a
allow templates/formatting when setting fields with modify 2021-10-27 00:10:25 +02:00
Andrew Rogl
b880e2db8a Final clean up 2021-10-05 13:00:38 +10:00
Andrew Rogl
109f4fa430 Add tests for range of discogs id extraction 2021-10-04 17:40:07 +10:00
Andrew Rogl
237bd07508 Address feedback from @sampsyo 2021-09-28 18:05:44 +10:00
Andrew Rogl
ac6cc2ffa4 Fix up invalid master merges 2021-09-26 17:33:15 +10:00
Andrew Rogl
ed07bb5b7e
Merge branch 'master' into pyupgrade 2021-09-26 17:22:15 +10:00
Andrew Rogl
d9be9a0d9b MIssed another new file 2021-09-26 17:08:57 +10:00
Andrew Rogl
5859d31405 Commit #4036 2021-09-26 16:41:13 +10:00
Andrew Rogl
8205b901db Commits #4048 & #4050 2021-09-26 16:03:00 +10:00
Andrew Rogl
f04059bfee Commit #4038 2021-09-26 15:54:13 +10:00
Duncan Overbruck
f5e336747a
Add permissions test case for set_art event 2021-09-12 16:40:58 +02:00
Edgars Supe
d40f0c8860 Fill default config for albumtypes plugin 2021-09-10 14:48:28 +03:00
Edgars Supe
6fdc505798 Add tests for albumtypes plugin 2021-09-09 23:07:11 +03:00
Piotrek Kochański
073136ba17 Merge branch 'master' of github.com:beetbox/beets into deinterlace 2021-09-02 01:34:23 +02:00
Jack Wilsdon
0ed2fbc7b0 Tidy up plugins in ui config tests
Some of these tests load plugins using beets' normal plugin loader, but
didn't call unload_plugins to tidy up afterwards. This led to any future
plugin loads being ignored until the next unload_plugins call.

This commit changes the config tests so that we always call load_plugins
on setup (to store the default beets state) and unload_plugins on
teardown (to restore the previously stored state).
2021-08-31 21:28:03 +01:00
Andrew Rogl
9106b41a50 Remove as many as possible sys.version tests 2021-08-27 10:24:27 +10:00
Piotrek Kochański
54522e6908 Remove extraneous empty line that failed lint. 2021-08-26 13:18:15 +02:00
Andrew Rogl
ee4268dabb Remove unused imports
Fix imports
Fix formatting
2021-08-26 20:59:48 +10:00
Andrew Rogl
0f48ccde78 Final pyupgrade 2021-08-26 20:14:08 +10:00
Andrew Rogl
1ec87a3bdd pyupgrade beetsplug and tests
All tests working
More tidy up to be done
2021-08-26 19:12:51 +10:00
Piotrek Kochański
c6e05e8ab7 Add tests to check deinterlace functionality. 2021-08-25 22:55:54 +02:00
Adrian Sampson
ea3a6e5fd7
Skip some more tests on Windows
We should actually fix these, I suppose!
2021-08-21 13:35:28 -04:00
Adrian Sampson
f545cd3830
Remove unused import 2021-08-19 17:02:28 -04:00
Adrian Sampson
af1eaf5062
Merge remote-tracking branch 'origin/windows-ci' into drop-py2 2021-08-19 16:48:46 -04:00
Adrian Sampson
75c41c0546
Remove most six.PY2 checks 2021-08-19 16:45:11 -04:00
Andrew Sultana
86e11fb582 template: fix ifdef bug #3852 involving non-string fields with missing values 2021-06-16 16:49:16 +01:00
Jack Wilsdon
6a98e5d8db
Add missing test data for tekstowo 2021-05-24 18:20:33 +01:00
Benedikt
eef26d1886
Merge pull request #3927 from bertbesser/set-fields-persist-to-tracks
persist set_fields to media files
2021-05-14 10:51:34 +02:00
Bert Besser
8dc960b1f6 fix: formatting 2021-05-14 10:19:59 +02:00
Bert Besser
e98f78e29b fix: transactions and stricter tests 2021-05-13 15:09:55 +02:00
sandersantema
51b22a41f0 Add tests for new itunes_dateadded function of metasync plugin 2021-05-13 12:42:59 +02:00
bertbesser
a25a2a6cbb
Merge branch 'master' into set-fields-persist-to-tracks 2021-05-13 07:38:26 +02:00
Andrew Rogl
533559136e Add 7z file support #3906 2021-05-07 22:04:46 +10:00
Bert Besser
9cbbc35a95 persist set_fields to media files 2021-05-06 19:55:12 +02:00
Sam Thursfield
2fa3717731 Optimise FormattedMapping when querying a specific set of fields
This changes greatly improves the speed of `beet export` and `beet info`
when the `--include-keys` option is used. It also removes the globbing
feature of `--include-keys` that was added in #1295. (See #3762 for
discussion).

Listing all fields for an item requires querying the database to find
any flex attributes. This is slow when done for every item being
exported. We already have a way for the user to specify a fixed set
of keys, but we previously queried everything and filtered it afterwards.
The new approach is more efficient.

Code that iterates through all fields now have to handle invalid field
names. The export and info plugins output invalid fields as None.

Timings before:

    > /usr/bin/time beet export -i title,path,artist -l  Bob Dylan
    13.26user 20.22system 0:34.01elapsed 98%CPU (0avgtext+0avgdata 52544maxresident)k

    > /usr/bin/time beet export -l  Bob Dylan
    12.93user 20.15system 0:33.58elapsed 98%CPU (0avgtext+0avgdata 53632maxresident)k

Timings after:

    > /usr/bin/time beet export -l  Bob Dylan
    13.33user 20.17system 0:34.02elapsed 98%CPU (0avgtext+0avgdata 53500maxresident)k

    > /usr/bin/time beet export -i title,path,artist -l  Bob Dylan
    0.49user 0.07system 0:00.56elapsed 98%CPU (0avgtext+0avgdata 50496maxresident)k

Notice the dramatic speedup in the last example!
2021-05-01 23:41:09 +02:00
Xavier Hocquet
8c6530369d
Merge branch 'master' into tekstowo-lyrics 2021-03-28 12:05:42 -06:00
wisp3rwind
9a6b65351b Merge pull request #3560 from davidswarbrick/master
Album Art Resize to filesize
2021-03-23 12:15:51 +01:00
David Swarbrick
07b5e69f40 fetchart/artresizer: add max_filesize support (#3560)
Squashed from the PR, relevant commit messages follow below:

Added file size option to artresizer

 - In line with comments on PR, adjusted the ArtResizer API to add
   functionality to "resize to X bytes" through `max_filesize` arg

 - Adjustment to changelog.rst to include max_filesize change to ArtResizer
   and addition of new plugin.

Added explicit tests for PIL & Imagemagick Methods

 - Checks new resizing functions do reduce the filesize of images

Expose max_filesize logic to fetchart plugin

- Add syspath escaping for OS cross compatibility
- Return smaller PIL image even if max filesize not reached.
- Test resize logic against known smaller filesize (//2)
- Pass integer (not float) quality argument to PIL
- Remove Pillow from dependencies
- Implement "max_filesize" fetchart option, including
  logic to resize and rescale if maxwidth is also set.

Added tests & documentation for fetchart additions.

Tests now check that a target filesize is reached with a
higher initial quality (a difficult check to pass).

With a starting quality of 95% PIL takes 4 iterations to succeed
in lowering the example cover image to 90% its original size.
To cover all bases, the PIL loop has been changed to 5 iterations
in the worst case, and the documentation altered to reflect the
50% loss in quality this implies. This seems reasonable as users
concerned about performance would most likely be persuaded to
install ImageMagick, or remove the maximum filesize constraint.
The previous 30% figure was arbitrary.
2021-03-23 12:00:14 +01:00
Graham R. Cobb
c3485b5b04 Remove unnecessary call to format.
Signed-off-by: Graham R. Cobb <g+beets@cobb.uk.net>
2021-03-16 22:36:42 +00:00
Graham R. Cobb
d1ec7b4b70 Add `bareasc` command to display entries with the unidecode transformation
applied.

Signed-off-by: Graham R. Cobb <g+beets@cobb.uk.net>
2021-03-16 11:57:52 +00:00
Graham R. Cobb
fab7a27e9f Add a couple more tests and make lint happy.
Signed-off-by: Graham R. Cobb <g+beets@cobb.uk.net>
2021-03-15 12:43:58 +00:00
Graham R. Cobb
dcbe622b76 Oops, use in for matching! (It was late last night!)
Signed-off-by: Graham R. Cobb <g+beets@cobb.uk.net>
2021-03-15 10:25:19 +00:00
Graham R. Cobb
80048e7153 Specify unicode, for python2
Signed-off-by: Graham R. Cobb <g+beets@cobb.uk.net>
2021-03-15 09:11:17 +00:00
Graham R. Cobb
0c612f408b Create plugin for "bare-ASCII" matching query
Signed-off-by: Graham R. Cobb <g+beets@cobb.uk.net>
2021-03-15 00:55:14 +00:00
Graham R. Cobb
4ffe9a2c45 Fixed bug where readonly value was not being read from config file.
Also simplified the setup of the `readonly` value in the tests which
fixes a test ordering issue found using --random-order.

Signed-off-by: Graham R. Cobb <g+beets@cobb.uk.net>
2021-03-12 17:58:35 +00:00
Graham R. Cobb
23c8d61104 Add tests for patch operations
Signed-off-by: Graham R. Cobb <g+beets@cobb.uk.net>
2021-03-11 22:55:42 +00:00
Graham R. Cobb
51d22b765e Add tests for delete operations
Signed-off-by: Graham R. Cobb <g+beets@cobb.uk.net>
2021-03-11 18:02:38 +00:00
Adrian Sampson
84f6d374c4
Merge pull request #3869 from GrahamCobb/web-regex-fix
Web regex fix
2021-03-10 20:36:03 -05:00
Graham R. Cobb
45cf9d00c7 Improve handling of paths for Windows tests
Signed-off-by: Graham R. Cobb <g+beets@cobb.uk.net>
2021-03-09 18:58:05 +00:00
Graham R. Cobb
ab2e858bce Aaargh! Forgot to run lint again
Signed-off-by: Graham R. Cobb <g+beets@cobb.uk.net>
2021-03-09 12:10:40 +00:00
Graham R. Cobb
f19faae1dc Attempt to make path-related tests portable to Windows
Signed-off-by: Graham R. Cobb <g+beets@cobb.uk.net>
2021-03-09 11:19:54 +00:00
Graham R. Cobb
4d5c5c02ae Lint fixes
Signed-off-by: Graham R. Cobb <g+beets@cobb.uk.net>
2021-03-08 17:26:04 +00:00
Graham R. Cobb
38fb1b5f08 Add tests for several web queries, including the regex queries fixed in
bugfix #3867.

Signed-off-by: Graham R. Cobb <g+beets@cobb.uk.net>
2021-03-08 17:00:41 +00:00
Adrian Sampson
09a6ec4f74
Merge branch 'master' into pr/item-album-fallback 2021-03-07 09:20:50 -05:00
Graham R. Cobb
9986b9892c Fix bug where album artpath not returned when INCLUDE_PATHS is set
Track item paths and album artpaths should be removed from results unless
INCLUDE_PATHS is set. This works for items but for albums the artpath is always
removed.

This patch makes the artpath removal conditional on INCLUDE_PATHS not being set
and includes a regression test. Note: the default value for INCLUDE_PATHS is
False so no changes will be seen by users unless they already have
INCLUDE_PATHS set.

Signed-off-by: Graham R. Cobb <g+beets@cobb.uk.net>
2021-03-06 15:25:48 +00:00
Graham R. Cobb
7d3fb0d7ec Fix lint errors
Signed-off-by: Graham R. Cobb <g+beets@cobb.uk.net>
2021-03-05 16:52:21 +00:00
Graham R. Cobb
de58334ecb Test web API /stats
Added a test (test_get_stats) for the /stats web API.
This involved adding another item so that we can check both items and albums
are being counted correctly, which required a few small changes to some item
tests.

Signed-off-by: Graham R. Cobb <g+beets@cobb.uk.net>
2021-03-05 16:29:26 +00:00
Graham R. Cobb
15be534e7c Test ?expand using documented syntax
Documentation says that ?expand does not need a value (i.e. ?expand=1 is wrong),
so the test is changed to reflect that syntax.

Signed-off-by: Graham R. Cobb <g+beets@cobb.uk.net>
2021-03-05 16:17:14 +00:00
Graham R. Cobb
79b41f6f38 Add test for getting album track listing using ?expand=1
Added test_get_album_details to test fetching /album/2?expand=1.
Also changed second album name to make tests more robust.

Signed-off-by: Graham R. Cobb <g+beets@cobb.uk.net>
2021-03-05 15:56:46 +00:00
Graham R. Cobb
dc55480f51 Document "id" handling in test setup and add test to confirm
self.lib.add ignores the "id" field from the entry being added and overwrites
it with the next free number. So remove the misleading id fields.
Add a test to confirm that the album query response contains the expected
album id number.

Signed-off-by: Graham R. Cobb <g+beets@cobb.uk.net>
2021-03-05 15:27:00 +00:00
Adam Tygart
1b1209a6c3 Add trackdisambig from musicbrainz.
fixes beetbox/beets#1904
2021-02-27 15:07:32 -06:00
Samuel Cook
ff4cec2e69
Removes support for bs1770gain.
References in the documentation to this plugin were removed in
beetbox/beets#3127 (beetbox/beets#3130) but no actual code
changes were made.

This PR removes support for this dependency entirely.
2021-01-27 17:42:18 -08:00
Vincent Ducamps
03a665861d reformating subsonicupdate.py
Co-authored-by: Jef LeCompte <jeffreylec@gmail.com>
2021-01-12 18:31:43 +01:00
vincent
811089af72 update test 2021-01-11 18:58:49 +01:00
FichteFoll
5ace2b626b
Merge remote-tracking branch 'upstream/master' into pr/item-album-fallback 2021-01-08 18:47:18 +01:00
Adrian Sampson
53dcb24d10
Merge pull request #3671 from dosoe/beets_test_parentwork
first try at mocking get_work_by_id
2020-12-22 12:01:17 -05:00
soergeld
03cc76375d style 2020-12-22 16:02:48 +01:00
soergeld
7803ce271e mock confined to test 2020-12-22 15:59:45 +01:00
soergeld
53474678e9 mock confined to test 2020-12-22 15:41:49 +01:00
soergeld
a8d1cc9ce4 mock confined to test 2020-12-22 15:40:50 +01:00
soergeld
a8b81ca193 style 2020-12-22 12:19:26 +01:00
soergeld
18bfefece7 revert changes to working version with external mock 2020-12-22 11:51:24 +01:00
wisp3rwind
30baf22e77 replaygain: Use on-disk database
there can only be a single connection to an in-memory database, but the
parallel replaygain code accesses the db from different threads
2020-12-21 11:13:45 +01:00
ybnd
e3205aacbd Merge remote-tracking branch 'origin/master' into parallel-replaygain 2020-12-14 22:19:28 +01:00
ybnd
363f71af2e Move OperationalError handler to test_replaygain.py 2020-12-14 22:10:54 +01:00
Adam Miller
e11687f80a keyfinder: Catch output from keyfinder-cli with no key 2020-12-07 22:04:05 -05:00
Adrian Sampson
9657919968
Merge pull request #3088 from rubdos/reflink
Add reflink option
2020-11-27 13:29:10 -05:00
FichteFoll
701cd6c42b
Merge remote-tracking branch 'upstream/master' into pr/item-album-fallback 2020-11-02 00:10:46 +01:00
Adrian Sampson
e99becb41e Use Unicode in lyrics tests 2020-10-18 07:32:44 -04:00
Adrian Sampson
ce80459110
Merge pull request #3767 from jackwilsdon/skip-azlyrics
Skip AZLyrics on GitHub actions
2020-10-05 20:48:49 -04:00
Jack Wilsdon
7138408491
Skip AZLyrics on GitHub actions 2020-10-06 00:05:48 +01:00
Jack Wilsdon
d115f3679b
Remove LyricWiki source
LyricWiki was shut down on 2020/09/21 and no longer serves lyrics.
2020-10-05 22:15:40 +01:00
Sam Thursfield
d9582f4bea export: Add --format=jsonlines option
This adds support for the JSON Lines format as documented at
https://jsonlines.org/.

In this mode the data is output incrementally, whereas the other
modes load every item into memory and don't produce output until
the end.
2020-10-02 12:41:29 +02:00
Adrian Sampson
b659ad6b0c Merge pull request #3670 from wisp3rwind/pr_remove_select
Add possibility to select individual items to the remove CLI command
2020-09-13 20:55:53 -04:00
djl
33b10d60fb
fetchart: Improve Cover Art Archive source. (#3748)
* fetchart: Improve Cover Art Archive source.

Instead of blindly selecting the first image, we now treat all "front"
images as candidates.

This is useful where some digital releases have both an animated cover
and a still image and the animated image is the first image returned
from the API.
2020-09-13 20:27:12 +01:00
wisp3rwind
1978484504 don't assume items are queried in any specific order in interactive delete test
The previous test worked (on my machine, and on Github CI and AppVeyor),
but it is not obvious whether the order is really guaranteed (given that
the full beets database stack and sqlite are involved). Thus, to prevent
this from exploding at some point, only verify the number of deletions
for now.
2020-09-13 15:55:09 +02:00
wisp3rwind
822bc1ce88 add possibility to select individual items to the remove CLI command 2020-09-13 14:26:00 +02:00
Jef LeCompte
3c8419dbe0
fix(plugin): subsonicupdate rest call
Signed-off-by: Jef LeCompte <jeffreylec@gmail.com>
2020-09-04 00:51:03 -04:00
Aidan Epstein
fce27e6fa9 mpdstats: Don't record a skip when stopping MPD.
MPD keeps the current track in the queue when stopping, so it's not
really like a skip, and I use it so that I can stop the music, and later
start at the beginning of a track.

I do this by keeping track of the current song id, and then comparing
them when we receive a stop signal.
2020-08-10 07:07:17 -07:00
soergeld
29a8eef281 problems importing patch 2020-08-10 11:02:14 +02:00
soergeld
4f0a483948 change function to method 2020-08-10 10:59:30 +02:00
soergeld
d727149dd4 first try at using patch 2020-08-10 10:55:30 +02:00
soergeld
76ca0549a9 move mocking to setUp 2020-08-09 15:45:58 +02:00
Samuel Cook
b89a2650cc
Delete after convert (#3700)
* If import move is true, files will be deleted after converting.
Fixes #2947

* Removed trailing whitespace to comply with W293, fixing build

* Add period to the end of the comment

Co-Authored-By: Adrian Sampson <adrian@radbox.org>

* Added changelog entry for this fix.

* Added delete_originals option to remove source files after transcode

* Added unit test, removed redundant syspath call

Co-authored-by: Logan Arens <logan-arens@users.noreply.github.com>
Co-authored-by: Logan Arens <heresmygithub@protonmail.com>
Co-authored-by: Adrian Sampson <adrian@radbox.org>
Co-authored-by: Logan Arens <logan.arens@protonmail.com>
2020-08-03 20:20:20 -05:00
Jacob Pavlock
96b9e7caa5 skip broken windows tests 2020-08-03 13:42:59 -07:00
Jack Wilsdon
92f425628d
Skip Genius integration test on GitHub actions 2020-08-02 17:56:22 +01:00
Gunther Schmidl
48d39ea11e fix regex, add test and changelog entry 2020-07-30 22:42:31 +02:00
FichteFoll
eda9930c59
Merge remote-tracking branch 'upstream/master' into pr/item-album-fallback 2020-07-27 19:32:44 +02:00
Gunther Schmidl
1eda0d39e6 better regex for drive letter; hopefully fixed tests for 2.7; added test to show only drive-letter like colons are affected 2020-07-25 22:11:07 +02:00
Gunther Schmidl
0a9a801b05 add unit tests 2020-07-25 21:50:33 +02:00