aboutsummaryrefslogtreecommitdiff
path: root/controllers/archive.php
diff options
context:
space:
mode:
authorSyndamia <kamen@syndamia.com>2025-02-01 10:02:14 +0200
committerSyndamia <kamen@syndamia.com>2025-02-01 10:28:22 +0200
commitfaabc462d3080cac67687f450135a078731fb3d1 (patch)
treeb0d050b510386c3abcc48852bda16480b7c27e8e /controllers/archive.php
parent5a0d4f4a00c9162fbf773ca6b73d34354c6650fe (diff)
downloadnowayforward_human-faabc462d3080cac67687f450135a078731fb3d1.tar
nowayforward_human-faabc462d3080cac67687f450135a078731fb3d1.tar.gz
nowayforward_human-faabc462d3080cac67687f450135a078731fb3d1.zip
feat: Rework models methods to be more object-oriented where applicable
Diffstat (limited to 'controllers/archive.php')
-rw-r--r--controllers/archive.php3
1 files changed, 3 insertions, 0 deletions
diff --git a/controllers/archive.php b/controllers/archive.php
index 9b8ac16..70f2b6d 100644
--- a/controllers/archive.php
+++ b/controllers/archive.php
@@ -37,6 +37,9 @@ class DownloadPage {
$page_url_pattern = $this->getCorrectLinkPattern($this->page_url);
$simular_pages = Database\Webpage::getArchivePathsByPattern('%' . $page_url_pattern . '%');
if ($website_exists) {
+ // NOTE: This is incredibly dumb, Databas\Webpage::create returns the
+ // auto-incremented ID, so it should be used here.
+ // The logic needs to be reorganized!
$this->folder_name = Database\Webpage::getPagesCount() + 1;
$this->page_contents = $this->downloadFile($this->page_url);
$this->createArchive($simular_pages);