Commit graph

3763 commits

Author SHA1 Message Date
Karl Besser
15d652dbae Update log message for keeping artist in ftintitle
Update the log message when the artist is kept unchanged due to setting
the keep_in_artist option to true.
2024-09-05 12:28:51 +02:00
Karl Besser
c046dc3976 Add new keep_in_artist option for ftintitle plugin
The new keep_in_artist option allows keeping the feat. part in the
artist metadata field while still changing the title.
2024-07-09 23:49:20 -04:00
Serene
de0742b9d6
Merge branch 'master' into bug-fetchart-resize-logic-fix 2024-06-25 14:30:39 +10:00
Šarūnas Nejus
4e06b59b60
Filter albums by tracks fields and vice versa (#5327)
Fixes #4360

This PR enables querying albums by track fields and tracks by album
fields, and speeds up querying albums by `path` field.

It originally was part of #5240, however we found that the changes
related to the flexible attributes caused degradation in performance. So
this PR contains the first part of #5240 which joined `items` and
`albums` tables in queries.
2024-06-25 02:04:45 +01:00
Arkadiy Illarionov
1c020b8264 Check Python version instead of catching ImportError 2024-06-22 19:55:52 +03:00
Arkadiy Illarionov
859072ee9e Use typing_extensions only when needed
Self was added in Python 3.11
TypeAlias was added in Python 3.10
2024-06-22 16:02:24 +03:00
Šarūnas Nejus
981a61bd56
Add support for filtering relations 2024-06-21 15:05:29 +01:00
Šarūnas Nejus
2800a323a2
Revert "Make queries fast, filter all flexible attributes (#5240)"
This reverts commit 143b9202f3, reversing
changes made to 8508a57d77.
2024-06-19 21:51:44 +01:00
Šarūnas Nejus
2c4b42d167
Keep the same FieldQuery.field interface as before 2024-06-17 08:59:20 +01:00
Šarūnas Nejus
1f93207823
Add any_writable_field_query to fix bpd search 2024-06-16 15:28:46 +01:00
Šarūnas Nejus
e0c50c5501
Remove slow lookups from beetsplug/aura
It seems like previously filtering by flexible attributes did not work
- I'd receive '{"data": []}' trying to GET `/aura/tracks?filter[play_count]=11`

Now this works, not only for tracks, but for `/aura/artists` and
`/aura/albums` too.

Additionally, this improves `/aura/tracks` response time significantly.
I tried loading the default of 500 tracks from my library:

On `master`, it took ~20s
After this commit, it takes under 1s.
2024-06-16 15:28:46 +01:00
Šarūnas Nejus
b0154d5cde
Fix querying fields present in both tables 2024-06-16 15:28:45 +01:00
Šarūnas Nejus
19470f3d76
Use native os.cpu_count
os.cpu_count has only been available since Python 3.4
2024-06-16 00:52:38 +01:00
Šarūnas Nejus
f388ff6ec1
Replace py3_path with builtin os.fsdecode
`os.fsdecode` has only been available since Python 3.2.
2024-06-16 00:52:37 +01:00
Arav K.
549fea14cd [util/pipeline] use 'Queue' without generics
Apparently Python 3.8 does not support generic type parameters on the
built-in 'queue.Queue' type?
2024-06-12 15:59:31 +02:00
Arav K.
d3bdf137ea Resolve some 'mypy' errors 2024-06-12 15:58:00 +02:00
Šarūnas Nejus
0966e3c653
Test aura (#5239)
In #4746 I was making a small adjustment in beetsplug/aura.py and found
that the module wasn't tested. So this PR adds some high-level tests to
act a safeguard for any future adjustments.
2024-06-10 13:07:48 +01:00
Šarūnas Nejus
179405ed82
A couple of small updates in the code 2024-06-05 04:41:02 +01:00
Lev Gorodetskiy
2a4cf0d335
Codestyle 2024-05-26 11:57:24 -03:00
Lev Gorodetskiy
2130404217
Add timeout to all requests calls 2024-05-25 12:24:53 -03:00
Šarūnas Nejus
e9ce625879
Dedupe get_attribute_converter 2024-05-07 21:15:00 +01:00
Šarūnas Nejus
6ee734685d
Feed in app context and args into Document to allow testing
This will be help with testing each of the documents which do not
any more depend on the 'global' `current_app` and `request`. These two
can now be provided at the time the objects are instantiated.
2024-05-07 19:55:02 +01:00
Šarūnas Nejus
7d636d8f22
Add support for a specific type in InQuery 2024-04-30 22:20:36 +01:00
Šarūnas Nejus
68eee96c03
Define InQuery and use it in PlaylistQuery
While working on the DB optimisation I discovered one query which does
not follow the 'FieldQuery' interface - 'PlaylistQuery', so I looked
into it in more detail.

One special thing about it is that it uses 'IN' SQL operator, so
I defined 'InQuery' query class to have this logic outside of the
playlist context.

Otherwise, it seems like 'PlaylistQuery' is a field query, even if it
has a very special way of resolving values it wants to query. In the
future, we may want to consider moving this kind of custom
_initialisation_ logic away from '__init__' methods to
factory/@classmethod: this should make it more clear that the purpose of
such logic is to resolve the data that is required to define
a particular FieldQuery class fully.
2024-04-30 22:20:36 +01:00
wisp3rwind
a9423b7b2d lyrics: remove version switch that became obsolete when we dropped Python 3.5 2024-04-27 16:02:26 +02:00
J0J0 Todos
d510177820
Merge pull request #5121 from mgoltzsche/generate-playlist-item-attributes 2024-04-20 08:04:32 +02:00
Max Goltzsche
883bbb3e4b
smartplaylist: rename output format m3u8 to extm3u 2024-04-13 04:55:43 +02:00
Max Goltzsche
c0afd3eb3c
smartplaylist: allow exporting item fields
Allow generating extm3u playlists so that they contain additional item fields such as the `id`.

The feature is required by the mgoltzsche/beets-webm3u plugin (M3U server) to transform playlists using a request based item URI template which may require additional fields such as the `id`, e.g. `beets:library:track;$id`.
2024-04-13 04:55:37 +02:00
Dr-Blank
6a27a8de3c
satisfy the linter 2024-04-11 13:42:56 -04:00
Dr-Blank
c88953805b
bugfix: ignore subdirectories of ignored
directories in unimported plugin
2024-03-22 18:20:47 -04:00
Dr-Blank
66b459b8d0
Refactor Candidate class in fetchart.py to improve
validation and resizing logic
2024-03-18 09:17:33 -04:00
Serene
3548e35360
Merge pull request #5122 from Bobo1239/master
convert: Correctly identify WAVE format as lossless
2024-03-02 09:05:53 +10:00
Boris-Chengbiao Zhou
47ba590999 convert: Correctly identify WAVE format as lossless
Seems like this entry was added before mediafile gained support for WAVE
files in commit 832f3d. Adjust it to fix detection.
2024-03-01 17:58:26 +01: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
35e8eb985f
Merge pull request #5058 from arsaboo/lb
Add initial version of the Listenbrainz plugin
2024-03-01 15:51:50 +10:00
Serene-Arc
83242fd7cf Apply formatting 2024-03-01 15:21:25 +10:00
Maxr1998
ba66808c74
advancedrewrite: Fix multi-valued fields specified as a single string 2024-01-01 19:33:22 +01:00
Maxr1998
b1d9169abe
advancedrewrite: Fix simple rules being overwritten by advanced rules 2024-01-01 18:32:06 +01:00
Alok Saboo
ce023a3c53 Revert unwanted commits 2023-12-25 17:14:45 -05:00
Alok Saboo
7838e70d41 Revert "Merge remote-tracking branch 'upstream/master' into lb"
This reverts commit 6bfe26642c, reversing
changes made to 9b8dbe8055.
2023-12-23 12:25:22 -05:00
Alok Saboo
6bfe26642c Merge remote-tracking branch 'upstream/master' into lb 2023-12-23 12:19:30 -05:00
Alok Saboo
9b8dbe8055 Add logging 2023-12-23 12:19:04 -05:00
Alok Saboo
47584f20cb Formatting 2023-12-22 16:13:01 -05:00
Alok Saboo
537b57d99d Make sure only Jams and Exploration playlists are added.
Sometimes, there are other playlists that are created (e.g., Top Missed Recordings of 2023, Top Discoveries of 2023). Right now, I am excluding these. We may want to address them separately.
2023-12-22 16:12:42 -05:00
Alok Saboo
71a6a4fb4a Formatting 2023-12-22 10:25:42 -05:00
Alok Saboo
7440ca51fb Error handling 2023-12-22 10:25:27 -05:00
Alok Saboo
2eb8000a0b Update docstrings 2023-12-21 12:24:04 -05:00
Alok Saboo
0ed65564b3 Update listenbrainz.py 2023-12-21 12:16:24 -05:00
Alok Saboo
4541644961 Updated docs 2023-12-21 11:57:14 -05:00
Alok Saboo
e8dc2cb5da Sort imports 2023-12-21 09:27:21 -05:00