summaryrefslogtreecommitdiffstats
AgeCommit message (Collapse)Author
2023-04-09Add the ability to register arbitrary db functionsgeneric-db-functionsŠarūnas Nejus
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.
2023-04-09Merge pull request #4741 from snejus/use-regex-for-path-lookupŠarūnas Nejus
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-09Also perform bareasc queries in SQLŠarūnas Nejus
2023-04-09Perform regex lookup in SQLŠarūnas Nejus
This improves performance of some string field lookups, for example `beet list path::aa`
2023-04-09Merge pull request #4744 from snejus/define-singleton-queryAdrian Sampson
Define SingletonQuery to perform filtering through SQL
2023-04-09Add explanatory docstringŠarūnas Nejus
2023-04-08Define SingletonQuery to perform filtering through SQLŠarūnas Nejus
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-07Merge pull request #4730 from elyang0214/masterAdrian Sampson
Enforced utf-8 encoding on imported files
2023-04-03Merge pull request #4399 from JOJ0/convert_playlistJ0J0 Todos
convert: New feature "Write m3u playlist to destination folder"
2023-04-02convert: playlist: Documentation overhaulJ0J0 Todos
2023-04-02convert: playlist: Adapt code commentsJ0J0 Todos
- 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-02Merge branch 'master' of https://github.com/elyang0214/beetselyang0214
2023-04-02Updated documentation to be less redundant in docs/referece/cli.rst and more ↵elyang0214
accurate in docs/changelog.rst.
2023-04-02Merge branch 'beetbox:master' into masterelyang0214
2023-04-02convert: playlist: item_paths relative to playlistJ0J0 Todos
Ensure entries in items_paths are generated with a path relative to the location of the playlist file.
2023-04-01Merge pull request #4396 from arogl/archive_mtimeAdrian Sampson
Preserve mtimes from archives #4392
2023-04-01Appease flake8Adrian Sampson
2023-04-01Merge branch 'master' into archive_mtimeAdrian Sampson
2023-03-29convert: playlist: M3U read as bytesJ0J0 Todos
- 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-29convert: playlist: M3U write + contents as bytesJ0J0 Todos
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-29convert: playlist: Handle errors on read/writeJ0J0 Todos
operations of a playlist in M3UFile class, by catching any "OSError" and raising util.FilesystemError.
2023-03-29convert: playlist: Handle playlist path subdirsJ0J0 Todos
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-29convert: playlist: Fix typo in m3u module docstringJ0J0 Todos
2023-03-29convert: playlist: Use normpath for playlist fileJ0J0 Todos
Fixes FileNotFoundError when for example a tilde (~) characteris used for a --dest path.
2023-03-29convert: Fix copyright year in test_m3ufile.pyJ0J0 T
2023-03-29convert: playlist: Improve --playlist help textJ0J0 T
2023-03-29convert: playlist: Remove debug print winpathJ0J0 T
in test.
2023-03-29convert: playlist: Add another Windows testJ0J0 T
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-29convert: playlist: Fix winpath driveletter in testJ0J0 T
Needs to be put including (double) backslash!
2023-03-29convert: playlist: debug winpath in testJ0J0 T
2023-03-29convert: playlist: Construct winpath before assertJ0J0 T
2023-03-29convert: playlist: Disable prefix in syspath onJ0J0 T
in load method when loading media files to content list.
2023-03-29convert: playlist: Construct Windows path programaticallyJ0J0 T
2023-03-29convert: playlist: Put actual Windows pathsJ0J0 T
into fixture file for the Windows unittest.
2023-03-29Revert "convert: playlist: Debug commit: Learn syspath()"J0J0 T
This reverts commit 8a7519e5057e9c11a5f95c979b2fd5ac6c1fd9e2.
2023-03-29convert: playlist: Separate unicode test for WindowsJ0J0 T
2023-03-29convert: playlist: Debug commit: Learn syspath()J0J0 T
Learn what's happening in syspath().
2023-03-29convert: playlist: Enforce utf-8 encoding on load()J0J0 T
and write().
2023-03-29convert: playlist: Use syspath() for media filesJ0J0 T
loading as well.
2023-03-29convert: playlist: Fix rst linter error in docsJ0J0 T
Fix "inline empasis start string without endstring" error in docs.
2023-03-29convert: playlist: Linter and import fixesJ0J0 T
in m3u module and testsuite.
2023-03-29convert: playlist: Document the featureJ0J0 T
leaving out the fact that #EXTM3U is added to the playlist file header (that important?).
2023-03-29convert: playlist: Also use syspath() for contentsJ0J0 T
of playlist. We want to have processed every entry in the media list we pass to the M3UFile instance.
2023-03-29convert: playlist: Use syspath()J0J0 T
for file read and write operations.
2023-03-29convert: playlist: Move M3UFile class to separateJ0J0 T
module in util package.
2023-03-29convert: playlist: Add changelog entryJ0J0 Todos
2023-03-29convert: playlist: Add tests checking extm3u andJ0J0 T
fix extm3u check in load method.
2023-03-29convert: playlist: Add EmptyPlaylistError and testJ0J0 T
- 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.
2023-03-29convert: playlist: Add test_m3ufile and fixturesJ0J0 T
Add several tests checking loading and saving unicode and regular ascii text playlist files.
2023-03-29convert: playlist: Fix filename attr in load methodJ0J0 T