Expand description
Utility functions for the Qobuz API Rust library.
This module provides various utility functions used throughout the library including MD5 hashing, query string building, timestamp generation, credential management, filename sanitization, and HTTP response handling. These utilities support the core API functionality and provide common operations needed for working with the Qobuz API.
Functions§
- capitalize_
first_ letter - Helper function to capitalize the first letter of a string.
- deserialize_
response - Deserializes an HTTP response to the expected type.
- download_
image - Downloads an image from a URL asynchronously.
- get_
current_ timestamp - Gets the current Unix timestamp as a string.
- get_
md5_ hash - Computes the MD5 hash of the input string.
- get_
web_ player_ app_ id - Extracts the app ID from Qobuz Web Player’s bundle.js file.
- get_
web_ player_ app_ secret - Extracts the app secret from Qobuz Web Player’s bundle.js file.
- read_
app_ credentials_ from_ env - Reads app credentials from a .env file.
- sanitize_
filename - Sanitizes a string to be used as a filename by removing or replacing invalid characters.
- timestamp_
to_ date_ and_ year - Converts a Unix timestamp to a “YYYY-MM-DD” string and extracts the year.
- to_
query_ string - Builds a query string from a collection of key-value pairs.
- write_
app_ credentials_ to_ env - Writes app credentials to a .env file.