Commit graph

3002 commits

Author SHA1 Message Date
Šarūnas Nejus
05bc57f1fb
autotag: split tests into test_match.py and test_hooks.py 2025-11-30 23:09:40 +00:00
Šarūnas Nejus
2789a9d342
import: simplify tagging item 2025-11-30 23:09:40 +00:00
Šarūnas Nejus
4b244204e9
tagging: fix list albumartists field 2025-11-30 23:09:40 +00:00
Šarūnas Nejus
fb50fdd829
autotag: refactor autotag tests to use single comprehensive test
Consolidate multiple granular test methods in ApplyTest into a single
comprehensive test that validates all applied metadata at once. This
improves test maintainability and clarity by:

- Replacing ~20 individual test methods with one data-driven test
- Using expected data dictionaries to validate all fields together
- Removing ApplyCompilationTest class (covered by va=True in main test)
- Keeping focused tests for edge cases (artist_credit, date handling)
- Switching from BeetsTestCase to standard TestCase for speed
- Adding operator import for efficient data extraction

The new approach makes it easier to validate all applied metadata at once.
2025-11-30 23:09:40 +00:00
Šarūnas Nejus
26da02284b
autotag: add a test for overwrite_null configuration 2025-11-30 23:09:40 +00:00
Šarūnas Nejus
3731142d13
hooks: make AlbumMatch.mapping a tuple 2025-11-30 23:09:40 +00:00
Šarūnas Nejus
26fde1ebf0
Merge branch 'master' into fix-reflink 2025-11-30 05:37:48 +00:00
Gabriel Push
51164024c0 Fixed unit tests import 2025-11-25 18:41:31 -05:00
Gabriel Push
c59134bdb6 Fixed unit tests import 2025-11-25 18:38:09 -05:00
Gabriel Push
e827d43213 Fixed unit tests 2025-11-25 18:35:03 -05:00
Gabriel Push
eb11537328
Merge branch 'master' into gabepush-test-fix 2025-11-25 18:16:08 -05:00
Gabriel Push
13f95dcf3a Added documentation header 2025-11-25 18:15:18 -05:00
henry
b902352139
New Plugin: Titlecase (#6133)
This plugin aims to address the shortcomings of the %title function, as
brought up in issues #152, #3298 and an initial look to improvement with
#3411. It supplies a new string format command, `%titlecase` which
doesn't interfere with any prior expected behavior of the `%title`
format command.

It also adds the ability to apply titlecase logic to metadata fields
that a user selects, which is useful if you, like me, are looking for
stylistic consistency and the minor stylistic differences between
Musizbrainz, Discogs, Deezer etc, with title case are slightly
infuriating.

This will add an optional dependency of
[titlecase](https://pypi.org/project/titlecase/), which allows the
titlecase core logic to be externally maintained.

If there's not enough draw to have this as a core plugin, I can also
spin this into an independent one, but it seemed like a recurring theme
that the %title string format didn't really behave as expected, and I
wanted my metadata to match too.

- [x] Documentation. (If you've added a new command-line flag, for
example, find the appropriate page under `docs/` to describe it.)
- [x] Changelog. (Add an entry to `docs/changelog.rst` to the bottom of
one of the lists near the top of the document.)
- [x] Tests. - Not 100% coverage, but didn't see a lot of other plugins
with testing for import stages.
2025-11-23 10:34:05 -08:00
Stefano Rivera
4a17901c1d reflink() doesn't take Path parameters
Fix `test_successful_reflink`, by passing the right kinds of parameters.

This was failing inside the reflink package:

```
/usr/lib/python3/dist-packages/reflink/reflink.py:34: in reflink
    backend.clone(oldpath, newpath)
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _

oldpath = PosixPath('/tmp/tmpx3jirmhp/testfile')
newpath = PosixPath('/tmp/tmpx3jirmhp/testfile.dest')

    def clone(oldpath, newpath):
        if isinstance(oldpath, unicode):
            oldpath = oldpath.encode(sys.getfilesystemencoding())
        if isinstance(newpath, unicode):
            newpath = newpath.encode(sys.getfilesystemencoding())

>       newpath_c = ffi.new('char[]', newpath)
                    ^^^^^^^^^^^^^^^^^^^^^^^^^^
E       TypeError: expected new array length or list/tuple/str, not PosixPath
```
2025-11-23 13:50:57 -04:00
asardaes
9c37f94171 Add album template value in ftintitle plugin 2025-11-21 18:31:59 +01:00
Gabriel Push
c0ca045c20
Merge branch 'master' into gabepush-test-fix 2025-11-20 16:15:59 -05:00
Gabriel Push
ba45fedde5 Fix inline recursion test formatting 2025-11-20 16:09:01 -05:00
Gabriel Push
aced802c56 Fix recursion in inline plugin when item_fields shadow DB fields (#6115) 2025-11-20 15:57:22 -05:00
Théophile Bastian
666c412b0e plugins/web: fix endpoints /…/values/…
Following #4709 and #5447, the web plugin used single-quotes (ie. string
litteral) in the SQL query for table columns. Thus, for instance, the query
`GET /item/values/albumartist` would return the litteral "albumartist"
instead of a list of unique album artists.
2025-11-15 21:02:38 +01:00
Aidan Epstein
672bf0bf41 Add tests. 2025-11-11 17:08:46 -08:00
Emi Katagiri-Simpson
29a5b06f67
Merge remote-tracking branch 'upstream/master' into dereference-symlinks-while-hardlinking 2025-11-11 07:58:10 -05:00
Šarūnas Nejus
d486885af3
pyupgrade Python 3.10 2025-11-08 12:09:52 +00:00
Emi Katagiri-Simpson
0e74605efd
Merge remote-tracking branch 'upstream/master' into dereference-symlinks-while-hardlinking 2025-11-06 20:30:40 -05:00
Emi Katagiri-Simpson
86a74970f9
Merge remote-tracking branch 'upstream/master' into HEAD 2025-11-06 20:11:57 -05:00
Sebastian Mohr
a59e41a883 tests: move command tests into dedicated files
Moved tests related to ui into own folder.
Moved 'modify' command tests into own file.
Moved 'write' command tests into own file.
Moved 'fields' command tests into own file.
Moved 'do_query' test into own file.
Moved 'list' command tests into own file.
Moved 'remove' command tests into own file.
Moved 'move' command tests into own file.
Moved 'update' command tests into own file.
Moved 'show_change' test into test_import file.
Moved 'summarize_items' test into test_import file.
Moved 'completion' command test into own file.
2025-11-03 14:00:58 +01:00
asardaes
c087851770 Prefer alias if import languages not defined 2025-11-01 13:52:14 +01:00
asardaes
040b2dd940 Add custom_tags_only mode for mbpseudo plugin 2025-11-01 13:52:14 +01:00
asardaes
cb758988ed Fix data source penalty for mbpseudo 2025-11-01 13:52:14 +01:00
asardaes
160297b086 Add tests for mbpseudo plugin 2025-11-01 13:51:34 +01:00
J0J0 Todos
02a662e923 importfeeds: Fix tests
- Use self.config instead of global config, which was interfering whith
  other plugin tests (test_importsource) when run alongside (eg in CI)
- Rename test
2025-10-29 08:50:01 +01:00
Doron Behar
e181ebeaae importsource: Add new plugin (+docs/tests/changlog) 2025-10-29 08:50:01 +01:00
Emi Katagiri-Simpson
19665cd8cf
Merge remote-tracking branch 'upstream/master' into dereference-symlinks-while-hardlinking 2025-10-28 17:13:51 -04:00
Emi Katagiri-Simpson
1e1c649398
Use already generated config path in test_edit_config_with_custom_path 2025-10-28 16:56:43 -04:00
Emi Katagiri-Simpson
1a1fcbc3bc
Merge remote-tracking branch 'upstream/master' into edit-custom-config 2025-10-28 16:55:39 -04:00
Ember Light
00e3da1a92
Merge branch 'master' into ftintitle-continue-even-if-albumartist-and-artist-is-the-same 2025-10-20 15:24:43 +02:00
Jacob Danell
027b775fcd Change arg name 2025-10-20 15:22:27 +02:00
cvx35isl
1275ccf8c1
play plugin: $playlist marker for precise control where the playlist … (#4728)
…file is placed in the command

## Description

see included doc; placing the playlist filename at the end of command
just isn't working for all players

I have this in use with `mpv`

Co-authored-by: cvx35isl <cvx35isl@users.noreply.github.com>
Co-authored-by: J0J0 Todos <2733783+JOJ0@users.noreply.github.com>
2025-10-19 08:38:20 +02:00
Ember Light
ca8df30ec3 Add missing test parameter 2025-10-16 19:06:56 +02:00
Ember Light
f275835cd3 Add test 2025-10-16 18:49:24 +02:00
Šarūnas Nejus
88011a7c65
Show genre change using show_model_changes 2025-10-15 11:14:26 +01:00
Šarūnas Nejus
c2d5c1f17c
Update test 2025-10-15 09:55:51 +01:00
J0J0 Todos
654c14490e
lastgenre: Refactor test_pretend to pytest 2025-10-15 09:54:41 +01:00
J0J0 Todos
d617e67199
lastgenre: Fix test_pretend_option
only one arg is passed to the info log anymore.
2025-10-15 09:52:32 +01:00
henry
0bf248d355
Add custom feat words for ftintitle (#6090)
## Description

For non English tracks (Swedish in my case) feat. words might be
something that ftintitle doesn't pick up.
Eg. for the song `Promoe med Afasi - Inflation`
[https://musicbrainz.org/recording/8e236347-61d6-4e11-9980-52f4cc6b905f](https://musicbrainz.org/recording/8e236347-61d6-4e11-9980-52f4cc6b905f)
the word `med` is `feat.` in Swedish.
With this PR you can add what ever word you wish to match as feat. so it
should cover any kind of language.

The config.yaml could look like this:
ftintitle:
  custom_feat_words: ["med"]

## To Do

<!--
- If you believe one of below checkpoints is not required for the change
you
are submitting, cross it out and check the box nonetheless to let us
know.
  For example: - [x] ~Changelog~
- Regarding the changelog, often it makes sense to add your entry only
once
reviewing is finished. That way you might prevent conflicts from other
PR's in
that file, as well as keep the chance high your description fits with
the
  latest revision of your feature/fix.
- Regarding documentation, bugfixes often don't require additions to the
docs.
- Please remove the descriptive sentences in braces from the enumeration
below,
  which helps to unclutter your PR description.
-->

- [x] Documentation. (If you've added a new command-line flag, for
example, find the appropriate page under `docs/` to describe it.)
- [x] Changelog. (Add an entry to `docs/changelog.rst` to the bottom of
one of the lists near the top of the document.)
- [x] Tests. (Very much encouraged but not strictly required.)
2025-10-14 20:38:02 -07:00
Sebastian Mohr
365ff6b030 Added test additions 2025-10-14 19:55:50 +02:00
Sebastian Mohr
670c300625 Fixed issue with legacy plugin copy not copying properties. Also
added test for it
2025-10-14 19:55:50 +02:00
Michael Krieger
df8cd23ae7 Add back tests as they were.
Add back tests as they were.
2025-10-14 03:17:34 +01:00
Michael Krieger
dc13308784 Remove tests. Update docs. Remove unnecessary return
Remove tests.  Update docs.  Remove unnecessary return.
2025-10-14 03:17:34 +01:00
Michael Krieger
b1c87cd98c Change parameter name, add return, add tests
Change the parameter name to omit_single_disc (vs previously zero_disc_if_single_disc)

Add return of 'fields_set' so that, if triggered by the command line `beets zero`, it will still effect the item.write.

Added tests.
2025-10-14 03:17:34 +01:00
Ember Light
b95a17d8d3 remove feat from custom_feat_words 2025-10-12 22:40:27 +02:00