Update JSON serialization to match class model

This commit is contained in:
Junior 2022-02-15 16:26:22 +00:00
parent 32da820217
commit dc582438de
2 changed files with 7 additions and 1 deletions

View File

@ -221,6 +221,8 @@ class Album implements JsonSerializable {
return [
'id' => $this->getID(),
'foldername' => $this->getFolderName(),
'thumbnail' => $this->getThumbnail(),
'thumburl' => ($this->getThumbnail() == "") ? "graphics/no-image-available_thm.gif" : THUMBNAILFOLDER . $this->getFolderName() . $this->getThumbnail(),
'title' => $this->getTitle(),
'description' => $this->getDescription(),
'createtime' => $this->getCreateTime(),

View File

@ -252,7 +252,11 @@ class Image implements JsonSerializable {
return [
'id' => $this->getID(),
'album_id' => $this->getAlbumID(),
'img' => basename(ALBUMFOLDER) . "/" . $this->albumfolder . "/" . $this->getFileName(),
'albumfolder' => $this->getAlbumFolder(),
'imageurl' => basename(ALBUMFOLDER) . "/" . $this->getAlbumFolder() . "/" . $this->getFileName(),
'thumburl' => basename(THUMBNAILFOLDER) . "/" . $this->getAlbumFolder() . "/" . $this->getFileName(),
'title' => $this->getTitle(),
'description' => $this->getDescription(),
'createtime' => $this->getCreateTime()
];
}