From a2b5773be01edf560aec49cb1dc7983a033e024a Mon Sep 17 00:00:00 2001 From: Alexander Rosenberg Date: Sun, 15 Sep 2024 02:10:12 -0700 Subject: [PATCH] Fix some bugs --- root/Album.php | 7 +++++-- root/get-album-entries.php | 1 + root/index.php | 1 + root/library.php | 2 -- root/view.php | 1 + 5 files changed, 8 insertions(+), 4 deletions(-) diff --git a/root/Album.php b/root/Album.php index 1409473..5dc7271 100644 --- a/root/Album.php +++ b/root/Album.php @@ -2,7 +2,6 @@ /* Copyright (C) 2021 Alexander Rosenberg * This file is AGPL v3. See LICENSE file for more information */ -require 'options.php'; class Album { private const PATH_PREFIX = 'albums'; @@ -38,7 +37,11 @@ class Album { $this->title = $root->{'title'}; $this->thumbnail = $root->{'thumbnail'}; $this->images = $root->{'images'}; - $this->metadata = $root->{'metadata'}; + if (property_exists($root, 'metadata')) { + $this->metadata = $root->{'metadata'}; + } else { + $this->metadata = null; + } } private function invalidate() { diff --git a/root/get-album-entries.php b/root/get-album-entries.php index 91a5b5a..92050ee 100644 --- a/root/get-album-entries.php +++ b/root/get-album-entries.php @@ -2,6 +2,7 @@ /* Copyright (C) 2021 Alexander Rosenberg * This file is AGPL v3. See LICENSE file for more information */ +require 'options.php'; require 'library.php'; require 'Album.php'; diff --git a/root/index.php b/root/index.php index c51dbed..52c286c 100644 --- a/root/index.php +++ b/root/index.php @@ -6,6 +6,7 @@