Skip to content

Year in review generator for Foobar2000's Discord Rich Presence component. Made in Python with Pillow.

License

Notifications You must be signed in to change notification settings

Neutrovertido/foobar2000-discord-rpc-year-in-review

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

11 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

🎨 Year in Review Album Art Generator 🎶

Year in Review Screenshot
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.

✨ Features

  • 🔌 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.

🛠️ Development Standards and Tools

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.

📦 Project Setup

This project utilizes Poetry for dependency management and packaging.

📝 Installation Steps

  1. Install Poetry: If you haven't done so yet, install Poetry by following the instructions on their official website.

  2. 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.

  3. Activate Virtual Environment:

    poetry shell

    This creates and activates a virtual environment with both runtime and development dependencies.

⚙️ How It Works

  1. 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).

  2. 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.
  3. 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.

🚀 Usage

  1. Ensure your album.json file (generated by discord-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 as album.json and place it in the directory.

  2. Execute the script within the Poetry shell:

    python your_script.py
  3. Wait for the collage to pop up or find the resulting collage as year_in_review.png in the directory.

🎨 Customization

  • Adjust the num_columns variable within the create_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.

🗂️ TODO

🤝 Contributing

We welcome contributions to improve this project! To contribute, please follow these steps:

  1. 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.

  2. 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
  3. Create a Branch: Create a new branch for your feature or bug fix.

    git checkout -b feature-or-bugfix-name
  4. Make Changes: Make changes to the code on your branch.

  5. 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.

📜 License

This project is licensed under the CC0-1.0 License, dedicating it to the public domain - see the LICENSE file for details.

About

Year in review generator for Foobar2000's Discord Rich Presence component. Made in Python with Pillow.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages