Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Releases/2.4.1 #101

Merged
merged 18 commits into from
May 4, 2023
Merged

Releases/2.4.1 #101

merged 18 commits into from
May 4, 2023

Conversation

a-rich
Copy link
Owner

@a-rich a-rich commented May 4, 2023

No description provided.

a-rich and others added 18 commits March 2, 2023 11:31
Why?
Combiner playlists that include playlist selectors previously did not include tracks that were added to those playlists in the same run.

What?
Delay the creation of the playlist selector tag -> track lookup until after any other TagParser implementations have been run.

In addition, this MR inserts all auto-playlists into a folder called AUTO_PLAYLISTS so as to make it simpler to bulk import these playlists.

Fixed broken image links for READMEs.
Why?
The underlying `aiohttp` calls for the `spotify.playlist_builder` module
occasionally timeout. These `TimeoutError` exceptions need to be caught
so that potentially successful Reddit submissions retrievals can occur.

What?
Wrap the `asyncpraw` method that returns an AsyncGenerator with another
generator which applies try / except logic that differentiates between
`StopAsyncIteration` exceptions and other exceptions.
Why?
Testing time should be minimized.

What?
Factor out `rekordbox.xml` loading into a session scoped fixture. Use
`tmpdir_factory` to create a temporary directory which may be session scoped;
use this temporary directory, in combination with the factored out
`rekordbox.xml` loading fixture, in the `test_xml` fixture. Mock `os.system`
calls in `test_upload_log` and `test_download_xml`. Minimize the amount of
content in `rekordbox.xml` so as to speed up reading and writing that file.
Why?
When looking at code using os.path operations, developers have to
evaluate expressions the same way as the Python interpreter
(inside -> out). By comparison, pathlib.Path uses method chaining which
is much more intuitive. In addition, pathlib.Path accounts for the
eccentricities of Windows paths under the hood; this means all the
ridiculous `.replace(os.sep, "/")` calls can be removed.

What?
Replace all uses, where appropriate, of `os.path` with `pathlib.Path`.
Why?
`USB_PATH` was being serialized as a `pathlib.Path` instead of a string
when writing to `registered_users.yaml`. The return of the call to
`subprocess.check_output` inside of `get_beatcloud_tracks` was not being
decoded as a string.

What?
Have `USB_PATH` be a string type by default. Add a validator to
`SyncConfig` to convert a non-empty string to a `pathlib.Path`. Add
validation upon `SyncConfig` initialization to ensure `USB_PATH` exists
before performing either the `DOWNLOAD_MUSIC` or `UPLOAD_MUSIC`
operation. Cast `USB_PATH` to a string before writing it to
`registered_users.yaml`. Fix bug where the output of
`subprocess.check_output` was not being decoded.
* [FIX] Fix Unix/Windows discrepancies

Why?
The refactor to use `pathlib.Path` instead of `os.path` broke in some
places where the paths used are still in the `WindowsPath` format.

What?
Ensure paths generated are in the Unix-style and, when not possible
(in certain tests), comparisons are made with native path formats.
Ensure Youtube-DL and `shutil.copyfile` are operating on posix paths.
[ENHANCEMENT] Collapse djtools directory

Why?
test_data was in the src directory creating an unnecessary level
between the root and the library source.

What?
Move test_data to the project root, collapse src/djtools into
djtools.
Why?
The `--check-tracks` feature logs too verbosely and also omits info that
would be nice to have such as the count of local files. There's also an
uncaught error when trying to zip emtpy lists of tracks.

What?
Simplify logging and include local file counts. Skip comparison loop if
there aren't any tracks.
* [ENHANCEMENT] Diataxis docs

Why?
There are no docs!

What?
Create docs. Use the Diataxis framework to organize the docs and use
`mkdocs` and `mkdocstring` to generate the docs. Host the docs on GitHub
Pages. Added a `.pylintrc` and linted the entire repo's `.py` files.

A few functions were renamed for clarity.
* `randomize_playlists` is not `shuffle_playlists`
* `set_tag` is now `set_track_number`
* `rekordbox_playlists` is now `build_playlists`
* `get_playlist_track_locations` is now `get_playlist_tracks`

The `Combiner` class was removed from `tag_parsers.py`, made to not inherit from `TagParser`, and moved into it's own module `playlist_combiner.py`.
@a-rich a-rich merged commit 1c7069a into main May 4, 2023
@a-rich a-rich deleted the releases/2.4.1 branch May 4, 2023 18:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Stability issues with requests to the search endpoint of the Spotify API
1 participant