Result from running the program.
This project aims to create a personalized image collage of your music experience throughout the year.
It uses album data exported from foobar2000's complement: discord-rich-presence
.
The script fetches album covers from either a set URL or the MusicBrainz database and falls back on placeholders if no cover art is found.
- 🔌 Integrates with JSON data originating from foobar2000's
discord-rich-presence
complement. - 🌐 Fetches album covers using the MusicBrainz API.
- 🖼️ Constructs a grid-style collage featuring album covers alongside artist names.
- 🚫 Uses a default placeholder image when artwork is unavailable.
- 📁 Outputs the final collage as
year_in_review.png
.
This project adheres to coding standards mandated by flake8, ensuring code quality and consistency. In addition, it includes several development dependencies for enhanced functionality:
- Flake8: Ensures compliance with PEP 8 style standards.
- Black: Aims for consistent code formatting.
- Mypy: Provides static type checking to ensure type correctness. (Not really enforced).
- types-requests: Supplies type hints for the
requests
library to enhance static analysis.
These tools are included as optional development dependencies when you set up the project using Poetry.
This project utilizes Poetry for dependency management and packaging.
-
Install Poetry: If you haven't done so yet, install Poetry by following the instructions on their official website.
-
Install Dependencies: Navigate to the project root directory and run:
For users:
poetry install --without dev
For developers:
poetry install
This installs all required and development dependencies.
-
Activate Virtual Environment:
poetry shell
This creates and activates a virtual environment with both runtime and development dependencies.
-
Load Album Data: Reads album information from a JSON file generated by the
discord-rich-presence
complement used in foobar2000 (must be installed manually beforehand). -
Fetch Images:
- Attempts to load the covers provided in the JSON as URLs.
- Queries MusicBrainz for album covers based on artist and album titles if the URL is
null
. - Defaults to a placeholder image if no cover art is found after a set number of retries.
-
Create Image Collage:
- Produces an image with a grid layout of album covers. The number of columns is customizable.
- Displays album and artist names beneath each cover.
- Saves the collage as
year_in_review.png
.
-
Ensure your
album.json
file (generated bydiscord-rich-presence
) is structured correctly, similar to:{ "Artist1|Album1": "CoverURL1", "Artist2|Album2": "CoverURL2", "Artist3|Album3": null }
Note: This file is usually located in:
%APPDATA%\foobar2000-v2\foo_discord_rich\images\art_urls.v2.0.1.json
Rename it asalbum.json
and place it in the directory. -
Execute the script within the Poetry shell:
python your_script.py
-
Wait for the collage to pop up or find the resulting collage as
year_in_review.png
in the directory.
- Adjust the
num_columns
variable within thecreate_review_image
function to change the number of columns in the collage. - Font preferences default to
tahoma.ttf
, reverting to system default fonts if unavailable.
- 🔄 Will be compatible with playback statistics in the future.
- 🤝 Support for MusicBee
We welcome contributions to improve this project! To contribute, please follow these steps:
-
Fork the Repository: Click on the 'Fork' button at the top of this page to make a copy of this repository to your GitHub account.
-
Clone your Fork: Clone your forked repository to your local machine.
git clone https://github.com/YOUR-USERNAME/foobar2000-discord-rpc-year-in-review.git
-
Create a Branch: Create a new branch for your feature or bug fix.
git checkout -b feature-or-bugfix-name
-
Make Changes: Make changes to the code on your branch.
-
Open a Pull Request: Go to your forked repository on GitHub and click on 'Compare & pull request'. Submit your pull request to merge your changes into the main project.
Before contributing, please ensure your code aligns with the project's coding standards. If you have any questions or need help, feel free to open an issue.
This project is licensed under the CC0-1.0 License, dedicating it to the public domain - see the LICENSE file for details.