Initialize empty values for some image URLs

This commit is contained in:
Alex Cabal 2024-12-29 15:10:41 -06:00
parent 31633ee8ac
commit 53fe66a364

View file

@ -464,6 +464,9 @@ final class Ebook{
if(file_exists(WEB_ROOT . '/images/covers/' . $this->UrlSafeIdentifier . '-hero.avif')){
$this->_HeroImageAvifUrl = '/images/covers/' . $this->UrlSafeIdentifier . '-' . substr(sha1($this->Updated->format(Enums\DateTimeFormat::UnixTimestamp->value)), 0, 8) . '-hero.avif';
}
else{
$this->_HeroImageAvifUrl = '';
}
}
return $this->_HeroImageAvifUrl;
@ -482,6 +485,9 @@ final class Ebook{
if(file_exists(WEB_ROOT . '/images/covers/' . $this->UrlSafeIdentifier . '-hero@2x.avif')){
$this->_HeroImage2xAvifUrl = '/images/covers/' . $this->UrlSafeIdentifier . '-' . substr(sha1($this->Updated->format(Enums\DateTimeFormat::UnixTimestamp->value)), 0, 8) . '-hero@2x.avif';
}
else{
$this->_HeroImage2xAvifUrl = '';
}
}
return $this->_HeroImage2xAvifUrl;
@ -500,6 +506,9 @@ final class Ebook{
if(file_exists(WEB_ROOT . '/images/covers/' . $this->UrlSafeIdentifier . '-cover.avif')){
$this->_CoverImageAvifUrl = '/images/covers/' . $this->UrlSafeIdentifier . '-' . substr(sha1($this->Updated->format(Enums\DateTimeFormat::UnixTimestamp->value)), 0, 8) . '-cover.avif';
}
else{
$this->_CoverImageAvifUrl = '';
}
}
return $this->_CoverImageAvifUrl;
@ -518,6 +527,9 @@ final class Ebook{
if(file_exists(WEB_ROOT . '/images/covers/' . $this->UrlSafeIdentifier . '-cover@2x.avif')){
$this->_CoverImage2xAvifUrl = '/images/covers/' . $this->UrlSafeIdentifier . '-' . substr(sha1($this->Updated->format(Enums\DateTimeFormat::UnixTimestamp->value)), 0, 8) . '-cover@2x.avif';
}
else{
$this->_CoverImage2xAvifUrl = '';
}
}
return $this->_CoverImage2xAvifUrl;