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 @Override
public @NotNull Promisable<HttpResponse> serve(@NotNull HttpRequest request) { public @NotNull Promisable<HttpResponse> serve(@NotNull HttpRequest request) throws Exception {
long before = System.nanoTime(); long before = System.nanoTime();
return servlet.serve(request).promise().map(response -> { 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()); me.kavin.piped.utils.obj.db.Channel channel = DatabaseHelper.getChannelFromId(s, info.getId());
if (channel != null) { if (channel != null) {
if (channel.isVerified() != info.isVerified()) { if (channel.isVerified() != info.isVerified()
|| !channel.getUploaderAvatar().equals(info.getAvatarUrl())) {
channel.setVerified(info.isVerified()); channel.setVerified(info.isVerified());
channel.setUploaderAvatar(info.getAvatarUrl());
if (!s.getTransaction().isActive()) if (!s.getTransaction().isActive())
s.getTransaction().begin(); s.getTransaction().begin();
s.update(channel); s.update(channel);