Commit graph

11013 commits

Author SHA1 Message Date
Alok Saboo
1e3fee8495 Use temp folder instead of cwd 2023-04-14 08:08:59 -04:00
Alok Saboo
023f3d7df7 Merge remote-tracking branch 'upstream/master' into embedart_url 2023-04-09 15:11:21 -04:00
Šarūnas Nejus
d05c34ec4e
Merge pull request #4741 from snejus/use-regex-for-path-lookup
Perform regex and `bareasc` lookups using SQL

- Define a custom function which performs regex lookups natively in SQL. This improves
performance of lookups like beet list path::hello.
- Define a SQL function which runs unidecode for the bareasc lookups
2023-04-09 19:27:30 +01:00
Alok Saboo
3a1e4bd845 Remove temporary logging 2023-04-09 14:07:55 -04:00
Alok Saboo
8357617f02 Change indentation 2023-04-09 14:02:10 -04:00
Alok Saboo
4d39b4037a Merge remote-tracking branch 'upstream/master' into embedart_url 2023-04-09 13:59:42 -04:00
Alok Saboo
34a4e7be5f Move away from PIL and use mimetypes instead 2023-04-09 13:58:26 -04:00
Šarūnas Nejus
b5b1afbfff
Also perform bareasc queries in SQL 2023-04-09 18:43:33 +01:00
Šarūnas Nejus
0f1b5d6f7c
Perform regex lookup in SQL
This improves performance of some string field lookups, for example
`beet list path::aa`
2023-04-09 18:43:32 +01:00
Adrian Sampson
5f7a6aa669
Merge pull request #4744 from snejus/define-singleton-query
Define SingletonQuery to perform filtering through SQL
2023-04-09 10:38:45 -07:00
Šarūnas Nejus
699e12bd88
Add explanatory docstring 2023-04-09 18:22:32 +01:00
Alok Saboo
99ca3e96d4 Add more error handling for the img.save function 2023-04-09 09:58:31 -04:00
Alok Saboo
9c3f4a4ac8 Change image format to PNG 2023-04-08 22:03:59 -04:00
Alok Saboo
b3008b74b8 Remove unused imports 2023-04-08 21:12:23 -04:00
Alok Saboo
23b42e80e2 Merge remote-tracking branch 'upstream/master' into embedart_url 2023-04-08 21:07:41 -04:00
Alok Saboo
93f4068cca Address review comments 2023-04-08 21:01:10 -04: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
Adrian Sampson
6955c53349
Merge pull request #4730 from elyang0214/master
Enforced utf-8 encoding on imported files
2023-04-07 12:19:19 -07:00
J0J0 Todos
8705457d24
Merge pull request #4399 from JOJ0/convert_playlist
convert: New feature "Write m3u playlist to destination folder"
2023-04-03 07:21:06 +02:00
J0J0 Todos
94784c2c29 convert: playlist: Documentation overhaul 2023-04-02 21:14:50 +02:00
J0J0 Todos
86929eb6a0 convert: playlist: Adapt code comments
- Remove initial comment around playlist entry condition (which is better
  suited for user docs anyway, and stated there already)
- Add explanation above the items_paths playlist contents creation list
  comprehension.
2023-04-02 19:34:13 +02:00
elyang0214
09de7909ce Merge branch 'master' of https://github.com/elyang0214/beets 2023-04-02 11:14:52 -04:00
elyang0214
b3b26efe88 Updated documentation to be less redundant in docs/referece/cli.rst and more accurate in docs/changelog.rst. 2023-04-02 11:13:53 -04:00
elyang0214
fbd665a417
Merge branch 'beetbox:master' into master 2023-04-02 11:06:13 -04:00
J0J0 Todos
16e361baf3 convert: playlist: item_paths relative to playlist
Ensure entries in items_paths are generated with a path relative to the
location of the playlist file.
2023-04-02 13:10:14 +02:00
Adrian Sampson
1f290f532f
Merge pull request #4396 from arogl/archive_mtime
Preserve mtimes from archives #4392
2023-04-01 16:07:34 -07:00
Adrian Sampson
6777b49bcf
Appease flake8 2023-04-01 15:46:02 -07:00
Adrian Sampson
c4a62fc248
Merge branch 'master' into archive_mtime 2023-04-01 15:33:35 -07: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 Todos
0884e67d35 convert: playlist: Handle errors on read/write
operations of a playlist in M3UFile class, by catching any "OSError" and
raising util.FilesystemError.
2023-03-29 07:46:08 +02:00
J0J0 Todos
952aa0badd convert: playlist: Handle playlist path subdirs
The M3UFile.write() method now creates potential parent directories in a passed
playlist path.

util.mkdirall() handles errors nicely already and would exit the mainprogram
before potential subsequent failures could happen (it raises
util.FilesystemError).
2023-03-29 07:46:08 +02:00
J0J0 Todos
46fb8fef91 convert: playlist: Fix typo in m3u module docstring 2023-03-29 07:46:08 +02:00
J0J0 Todos
20a0012f79 convert: playlist: Use normpath for playlist file
Fixes FileNotFoundError when for example a tilde (~) characteris used for a
--dest path.
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
d248063f96 convert: playlist: Improve --playlist help text 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
e4213714ba convert: playlist: Disable prefix in syspath on
in load method when loading media files to content list.
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
b3d0c1cc1c Revert "convert: playlist: Debug commit: Learn syspath()"
This reverts commit 8a7519e5057e9c11a5f95c979b2fd5ac6c1fd9e2.
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
5f5be52a89 convert: playlist: Debug commit: Learn syspath()
Learn what's happening in syspath().
2023-03-29 07:46:08 +02:00
J0J0 T
da01be3d93 convert: playlist: Enforce utf-8 encoding on load()
and write().
2023-03-29 07:46:08 +02:00
J0J0 T
785ef1576c convert: playlist: Use syspath() for media files
loading as well.
2023-03-29 07:46:08 +02:00
J0J0 T
a1baf9e94b convert: playlist: Fix rst linter error in docs
Fix "inline empasis start string without endstring" error in docs.
2023-03-29 07:46:08 +02:00