Commit graph

3081 commits

Author SHA1 Message Date
Sam Thursfield
b7ccb6f516 export,info: Improve performance of --library mode
The library mode was slow due to use of item.formatted(), which
runs multiple database queries per item. The --include-keys option
didn't help because it filtered the after the queries had already
happened.

This commit reworks filtering so that we only query the fields
that the user requests. In many cases this can dramatically speed up
execution.

Before:

    > /usr/bin/time beet  export -l Bob Dylan > /dev/null
    13.42user 21.56system 0:35.71elapsed 97%CPU (0avgtext+0avgdata 52396maxresident)k

    > /usr/bin/time beet  export -l -i artist,title,path Bob Dylan > /dev/null
    13.25user 21.17system 0:35.14elapsed 97%CPU (0avgtext+0avgdata 52112maxresident)k

After:

    > /usr/bin/time beet  export -l Bob Dylan > /dev/null
    1.46user 0.09system 0:01.60elapsed 97%CPU (0avgtext+0avgdata 51188maxresident)k

    > /usr/bin/time beet  export -l -i artist,title,path Bob Dylan > /dev/null
    0.50user 0.07system 0:00.58elapsed 97%CPU (0avgtext+0avgdata 50632maxresident)k
2020-09-30 20:12:02 +02:00
Sam Thursfield
aae422eaf2 export: Correctly export 'path' field when requested
This fixes a crash that could be seen by running:

    beet export --include=path .
2020-09-30 20:05:05 +02:00
Sam Thursfield
591038d246 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-09-30 17:36:23 +02:00
Cadel Watson
d1f93a26a6 Fix lint errors 2020-09-20 11:30:12 +10:00
Cadel Watson
a18b317240 Add PATCH method to item queries 2020-09-20 10:46:48 +10:00
Cadel Watson
afcde697e0 Add PATCH method to Items 2020-09-20 10:45:12 +10:00
Cadel Watson
29672a434f Add DELETE method to resource queries 2020-09-20 10:23:25 +10:00
Cadel Watson
76220fb148 Add DELETE method for items and albums 2020-09-20 10:18:07 +10: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
Jef LeCompte
f2a4864ab0
Merge pull request #3731 from jef/jef/fix-subsonic 2020-09-04 08:06:55 -04: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
PotcFdk
2039f26f96 Update file metadata after generating fingerprintsthrough the submit command. 2020-08-26 13:36:40 +02: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
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
Gunther Schmidl
48d39ea11e fix regex, add test and changelog entry 2020-07-30 22:42:31 +02:00
jtpavlock
335776ff30
Merge pull request #3666 from jtpavlock/flake8-errors
Unignore flake8 E221, E226, E242, E704
2020-07-20 12:24:52 -07:00
José Albornoz
dc7e433768
Fix thumbnail plugin pathlib bug (#3360)
PathlibURI.uri() would fail if given a path as bytes instead of as string.

Co-authored-by: Jacob Pavlock <jtpavlock@gmail.com>
2020-07-15 21:00:50 -05:00
Adrian Sampson
8537d1e36d Merge pull request #2554 from musoke/python3-plugin-ipfs
compatibility of IPFS plugin with Python 3
2020-07-14 06:58:20 -04:00
wisp3rwind
44e4d558c9 lyrics: fix bad_triggers in the google plugin
regression from 117d16f
2020-07-12 22:23:17 +02:00
Jacob Pavlock
124c882b4d un-ignore E221 2020-07-11 18:33:08 -07:00
Adrian Sampson
32e54a29fa
Merge pull request #3655 from aereaux/add_parentwork_date
Get the date of the parentwork, which may be different from the date of the child work.
2020-07-07 07:48:23 -04:00
jtpavlock
45abc9ed7a
Clean up code and tests for Genius Lyrics plugin backend (#3641)
* clean-up code & add tests for genius lyrics backend

* add genius fetch tests

* organize imports: standard lib -> pip -> local

* check in sample genius lyrics page

* fix mock import

* force utf-8 encoding for opened files

* use io.open to force utf-8 encoding w/ python2.7
2020-07-06 08:41:27 -05:00
Aidan Epstein
27199abac8 Get the date of the parentwork, which may be different from the date of the child work.
Also add a changelog entry and docs.
2020-07-03 09:35:15 -07:00
Mark Trolley
0f767ffa66 fetchart: Use Cover Art Archive thumbnails
The Cover Art Archive API offers pre-resized thumbnails of cover
art. If the `maxwidth` option of `fetchart` matches one of the
supported Cover Art Archive thumbnail sizes, and a thumbnail of
that size exists in the Cover Art Archive, fetch it directly
instead of fetching the full size image then resizing it.
2020-06-28 17:18:42 -04:00
Adrian Sampson
533cc88df2
Merge pull request #3639 from trolley/topic/coverart-fallback
Revert Cover Art Archive thumbnails
2020-06-27 19:46:45 -04:00
Adrian Sampson
3e32a4fb87
Merge pull request #3635 from jtpavlock/master
Fix genius lyrics backend artist matching with hyphens
2020-06-27 19:38:26 -04:00
Mark Trolley
a4c647be46 Revert "fetchart: Use Cover Art Archive thumbnails"
This reverts commit 2131f6f7d9.
2020-06-27 16:26:52 -04:00
Mark Trolley
3232a5b8b7 Revert "Indentation fix"
This reverts commit 1e527ed4e5.
2020-06-27 16:26:20 -04:00
Adrian Sampson
1e527ed4e5 Indentation fix 2020-06-27 12:49:32 -04:00
Mark Trolley
2131f6f7d9 fetchart: Use Cover Art Archive thumbnails
The Cover Art Archive API offers pre-resized thumbnails of cover
art. If the `maxwidth` option of `fetchart` matches one of the
supported Cover Art Archive thumbnail sizes fetch it directly
instead of fetching the full size image then resizing it.
2020-06-27 12:34:43 -04:00
Jacob Pavlock
7220c91d2a generalize genius artist matching to use slug() 2020-06-26 18:56:20 -07:00
Jacob Pavlock
bb5740d63c better debug message for no genius artist match 2020-06-26 16:41:20 -07:00
Jacob Pavlock
ae175e156b fix genius lyrics artist matching when artist contains a hyphen 2020-06-26 16:10:33 -07:00
Mark Trolley
6d41f31309 Rename use_secure to secure and add to changelog 2020-06-08 20:19:19 -04:00
Mark Trolley
22d74a3b8a feat: support secure Plex connections 2020-06-08 18:05:43 -04:00
Adrian Sampson
3aad6f42ce Merge pull request #3602 from jef/jef/github-actions
feat: added github actions
2020-06-05 09:56:59 -04:00
ybnd
d1f3d664d7 Implement comments & add to changelog 2020-06-04 16:43:42 +02:00
ybnd
b239a0b3d2 Fix item == None issues when writing lyrics ReST
* Skip ReST writing & sphinx info messages if query doesn't yield anything
* `writerest` into `appendrest` and `writerest`, don't call `writerest(item=None)` to flush state at the end.
2020-06-04 11:15:34 +02:00
Jef LeCompte
42e5844564
fix: revert flake8 change 2020-06-04 02:09:04 -04:00
Jef LeCompte
9f8bd4cd3f
style: flake8 linting 2020-05-25 20:06:43 -04:00
Jef LeCompte
0c3201930c
feat: added github actions
only working with linux for now. exact replica of travis basically.
should probably try to implement the rest of tox or deprecate some
functionality.
2020-05-25 19:35:15 -04:00
Jef LeCompte
66e6b11404
refactor: moved static methods inside class
made them static private class methods
2020-05-22 21:23:25 -04:00
Jef LeCompte
d9603788bc
fix: use endwith() instead of endWith() 2020-05-22 21:23:25 -04:00
Jef LeCompte
1374aa2aea feat: uses new subsonic format as default
also gets rid of warning that port must be `int` when it's default was a `string`
2020-05-18 10:23:26 -04:00
Adrian Sampson
485abb08c0 Merge pull request #3594 from stlutz/master
Scrape new Genius song page html
2020-05-17 14:44:57 -04:00
stlutz
5d306d6fd9 Remove debugging statement and conform to line length. 2020-05-16 17:48:56 +02:00
stlutz
15402f6aa7 Add alternative scraping algorithm to deal with Genius's new song page html layout. 2020-05-16 17:15:45 +02:00
stlutz
46143d9762 Remove unnecessary intermediate web request to genius.com when fetching lyrics.
The search results already include the correct song page url, making it superfluous to do another request via the /song api just to get it.
2020-05-16 16:28:17 +02:00
Adrian Sampson
d4a82b1fa5
Merge pull request #3592 from thenktor/patch-2
Update genres-tree.yaml
2020-05-16 10:03:44 -04:00
stlutz
ac043f9be0 When fetching lyrics from Genius, search for title and artist.
Searching only for the title and just verifying the artist afterwards leads to songs with very common titles not being found, since Genius limits the amount of returned hits.
An example would be 'Saviour' by 'Circa Waves'.
2020-05-16 13:26:09 +02:00