fix images not loading on akkoma

closes sk22#25
This commit is contained in:
sk 2023-01-16 21:38:47 +01:00 committed by LucasGGamerM
parent 480d4ad904
commit 13b5462f63
1 changed files with 9 additions and 1 deletions

View File

@ -14,9 +14,11 @@ import org.parceler.Parcel;
import org.parceler.ParcelConstructor;
import org.parceler.ParcelProperty;
import java.util.UUID;
@Parcel
public class Attachment extends BaseModel{
@RequiredField
// @RequiredField
public String id;
@RequiredField
public Type type;
@ -85,6 +87,12 @@ public class Attachment extends BaseModel{
if(placeholder!=null)
blurhashPlaceholder=new BlurHashDrawable(placeholder, getWidth(), getHeight());
}
if (id == null) {
// akkoma servers doesn't provide IDs for attachments,
// but IDs are needed by the AudioPlayerService
id = "" + this.hashCode();
}
}
@Override