Added "refresh=true" API param to artist, track and album detail to retrieve up-to-date data if needed

Agate requested to merge refetch-remote-entities into develop

Even if we broadcast Update messages over federation when changes are submitted on artists, albums and tracks, it's still possible that other pods get out of sync (e.g if a pod is down when receiving the message).

To mitigate this, this MR implements basic refetching. When retriving an artist, album or track via the API, if you provide a ?refresh=true parameter and the entity comes from a remote pod, then Funkwhale will fetch the most up-to-date data before returning it to you. If fetching this data fails for any reason (e.g the remote pod is down), then we return the currently available data.

To avoid abuse and limit the traffic on remote pods, this can only occur once every FEDERATION_OBJECT_FETCH_DELAY minutes (defaults to three day) for each entity.

The front-end has been updated to pass refresh=true by default.

cc @funkwhale/reviewers-python

Merge request reports