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 @@