package me.devsaki.hentoid.json;

import me.devsaki.hentoid.database.domains.ImageFile;
import me.devsaki.hentoid.enums.StatusContent;

class JsonImageFile {

    private Integer order;
    private String url;
    private String name;
    private boolean isCover;
    private boolean favourite;
    private boolean isRead;
    private StatusContent status;
    private String mimeType;

    private JsonImageFile() {
    }

    static JsonImageFile fromEntity(ImageFile f) {
        JsonImageFile result = new JsonImageFile();
        result.order = f.getOrder();
        result.url = f.getUrl();
        result.name = f.getName();
        result.status = f.getStatus();
        result.isCover = f.isCover();
        result.favourite = f.isFavourite();
        result.isRead = f.isRead();
        result.mimeType = f.getMimeType();
        return result;
    }

    ImageFile toEntity(int maxPages) {
        ImageFile result = new ImageFile(order, url, status, maxPages);
        result.setName(name);
        result.setIsCover(isCover);
        result.setFavourite(favourite);
        result.setRead(isRead);
        result.setMimeType(mimeType);
        return result;
    }
}

@@ -378,16 +378,40 @@
 imeType;
+%0A    private long pHash;
 %0A%0A    pr
@@ -845,24 +845,65 @@
 MimeType();%0A
+        result.pHash = f.getImageHash();%0A
         retu
@@ -1203,24 +1203,60 @@
 (mimeType);%0A
+        result.setImageHash(pHash);%0A
         retu

Serialize image pHash