- 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.
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.
- Move the creation of the playlist file to the very end, right after
self._parallel_convert, in the convert plugin's main function.
- In the test code, the destination directory is created when the
conversion happens, thus this fixes test_playlist and doesn't hurt the
feature - The playlist creation can as well be the very last step in
the process.
Use Item.destination method for generation of relative paths to media
files in playlist. The fragment keyword enables returning the path as
unicode instead of bytes, let's keep that in mind.
- Improve --help text
- Use unicode instead of bytes when adding media file paths to the
playlist file.
- The "standard" (?) of m3u8 defines that unicode should ensure support
of special characters in media file names. util.displayable_path() is
used to do the conversion from bytes. We save everything in bytes in
the config since it seemes to be the way this plugin or beets in
general likes to save paths.
- Join dest and playlist in the config reader method already to have it
ready in both methods that require the full path to the playlist file.
The idea in this PR is to converge on Python's `fsdecode` and `fsencode`
for argument manipulation. This seems to match up with the Python
standard library's assumptions: namely, on Windows, we use `fsdecode` to
get back to Unicode strings:
54bbb5e336/Lib/subprocess.py (L561)
So let's start by dropping this utility and going straight for
`fsdecode` here to match.
It looks like the convert option for wma used to be called windows media. We could just remove this alias, but might be good to keep for backwards compatibility.
Rectify a couple of things in that PR, pointed out here:
https://github.com/beetbox/beets/pull/4226#issuecomment-1011499620
- Undo the `pretend` sensitivity in the import path, because it's not
clear how this setting could ever be true.
- Preserve the log message in debug mode, even when quiet.
When the delete_originals was set, beets would print the following, regardless
of the presence of the quiet parameter:
convert: Removing original file /path/to/file.ext
This commit ensures that the log is only printed when quiet is not present.
* 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>