Fix some bugs

This commit is contained in:
Alexander Rosenberg 2024-09-15 02:10:12 -07:00
parent fab791d2e9
commit a2b5773be0
Signed by: Zander671
GPG Key ID: 5FD0394ADBD72730
5 changed files with 8 additions and 4 deletions

View File

@ -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'};
if (property_exists($root, 'metadata')) {
$this->metadata = $root->{'metadata'};
} else {
$this->metadata = null;
}
}
private function invalidate() {

View File

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

View File

@ -6,6 +6,7 @@
<head>
<?php
const INITIAL_ALBUMS = 15;
require 'options.php';
require 'library.php';
require 'Album.php';
if ($_SERVER['REQUEST_METHOD'] != 'GET' && $_SERVER['REQUEST_METHOD'] != 'HEAD') {

View File

@ -2,8 +2,6 @@
/* Copyright (C) 2021 Alexander Rosenberg
* This file is AGPL v3. See LICENSE file for more information
*/
require 'options.php';
const CONFIG_PATH = AM_OPTIONS['root'] . '/config.json';
function display_error_message($msg, $html_tags = '') {

View File

@ -4,6 +4,7 @@
-->
<html>
<?php
require 'options.php';
require 'library.php';
require 'Album.php';
if ($_SERVER['REQUEST_METHOD'] != 'GET' && $_SERVER['REQUEST_METHOD'] != 'HEAD') {