Age | Commit message (Collapse) | Author |
|
Add a decorator which records the function it wraps.
In the DB initialization stage, define each recorded function as an
SQLite function.
This way, the SQLite function definition stays together with the SQL
query that uses it. It also allows flexibility, since 'add_db_function'
can be imported from anywhere.
Its implementation had to be moved away from `beets/dbcore/db.py`
because it would have caused circular import issues between `db.py` and
`query.py`.
See https://github.com/beetbox/beets/pull/4741 for the context.
|
|
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
|
|
|
|
This improves performance of some string field lookups, for example
`beet list path::aa`
|
|
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.
|
|
Enforced utf-8 encoding on imported files
|
|
convert: New feature "Write m3u playlist to destination folder"
|
|
|
|
- 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.
|
|
|
|
accurate in docs/changelog.rst.
|
|
|
|
Ensure entries in items_paths are generated with a path relative to the
location of the playlist file.
|
|
Preserve mtimes from archives #4392
|
|
|
|
|
|
- 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)
|
|
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.
|
|
operations of a playlist in M3UFile class, by catching any "OSError" and
raising util.FilesystemError.
|
|
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).
|
|
|
|
Fixes FileNotFoundError when for example a tilde (~) characteris used for a
--dest path.
|
|
|
|
|
|
in 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.
|
|
Needs to be put including (double) backslash!
|
|
|
|
|
|
in load method when loading media files to content list.
|
|
|
|
into fixture file for the Windows unittest.
|
|
This reverts commit 8a7519e5057e9c11a5f95c979b2fd5ac6c1fd9e2.
|
|
|
|
Learn what's happening in syspath().
|
|
and write().
|
|
loading as well.
|
|
Fix "inline empasis start string without endstring" error in docs.
|
|
in m3u module and testsuite.
|
|
leaving out the fact that #EXTM3U is added to the playlist file header
(that important?).
|
|
of playlist. We want to have processed every entry in the media list we
pass to the M3UFile instance.
|
|
for file read and write operations.
|
|
module in util package.
|
|
|
|
fix extm3u check in load method.
|
|
- 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.
|
|
Add several tests checking loading and saving unicode and regular ascii
text playlist files.
|
|
|