Skip to content


Agate requested to merge attachments into develop

This MR is a rework of the way we handle non-audio files (like user avatar and album covers), to scale better and support more advanced use cases (e.g suggest a new cover for an album, or add banners for artist profiles). This is a hard requirement for #170 (closed) and #588 (closed).

Basically, we now have a dedicated attachment table, which can be referenced whenever we need to associate one or more images to an object. Although currently restricted to images, the table could other type of files if we need it.


  • New attachment table
  • API endpoints:
    • Create attachment
    • On the fly fetching of remote attachments
    • Destroy attachment
    • Documentation
  • Use attachment table for album covers (instead of a field on the album table)
    • Update import code to create attachments
    • Expose attachment in the API / federation
    • Data migration to convert existing covers to the new system
  • Manual testing (to ensure we're backward compatible):
    • Subsonic
    • Open Graph / Oembed
    • Remote / federation
    • Performance (n+1 queries, etc.)

Review is recommended commit-by-commit (I've been extra careful to keep a clean history, given the size of the work)

Edited by Agate

Merge request reports