Allow Avatar URL to change in channel.

This commit is contained in:
FireMaskterK 2021-10-31 17:48:34 +00:00
parent d18a019640
commit 86154a1a29
No known key found for this signature in database
GPG key ID: 49451E4482CC5BCD
2 changed files with 4 additions and 2 deletions

View file

@ -24,7 +24,7 @@ public class CustomServletDecorator implements AsyncServlet {
}
@Override
public @NotNull Promisable<HttpResponse> serve(@NotNull HttpRequest request) {
public @NotNull Promisable<HttpResponse> serve(@NotNull HttpRequest request) throws Exception {
long before = System.nanoTime();
return servlet.serve(request).promise().map(response -> {

View file

@ -218,8 +218,10 @@ public class ResponseHelper {
me.kavin.piped.utils.obj.db.Channel channel = DatabaseHelper.getChannelFromId(s, info.getId());
if (channel != null) {
if (channel.isVerified() != info.isVerified()) {
if (channel.isVerified() != info.isVerified()
|| !channel.getUploaderAvatar().equals(info.getAvatarUrl())) {
channel.setVerified(info.isVerified());
channel.setUploaderAvatar(info.getAvatarUrl());
if (!s.getTransaction().isActive())
s.getTransaction().begin();
s.update(channel);