I added a new route to get files from the /archive directory but
needed to expand on the original /storage/view/:slug route so I could
seperate out the two (/storage/media and /storage/archive)
directories.
I added a check to make sure the archive entry
requested (/edit/archive/:slug) exists and return a 404 if it doesn't.
These functions are to help with standardising on the naming formats
when storing files and keywords (for Meilisearch database). The
asciify and slugify functions are not enough. They either leave spaces
in the file names or the file extension gets lost in the standardising
process. Going forward, file names should look like
'this-is-an-example.png' instead of either 'this is an Example.png' or
'this-is-an-example-png'.
I was getting errors when trying to quickload the system because a
custom djula filter (defined in view.lisp) couldn't find one of the
specific ritherdon-archive packages/files. I can't remember which one
because I made the change earlier in the day and didn't commit the
change at the time.
Both templates aim to list out all the archives stored in the
system. The /user/archive.html template, also, includes admin/back-end
features like edit and delete links/controls.
This is part of an end-of-session commit. I'm currently working on the
/create/archive-entry section (most the HTTP POST request). I still
need to start the view archive, edit archive and delete archive
parts. I've not even looked at the Meilisearch stuff. For now, the aim
is to get the website's main database (nera.db) working and then
integrate the Meilisearch stuff in after that.
I still need to write the edit and delete functions (I.E. the 'U' and
'D' in 'CRUD') to have a basic CRUD system in place for this
section. I'm commiting this as an part of an end-of-session commit,
hence the partical amount of work done.
The only intended use for this function is to generate an Id. number
which will be used in the Meilisearch database and linking it to
Nera's database (I.E. this site's main database).
This is a rough sketching out of what the model/data needs to look
like. This model is what will be connecting the site's archive (Nic's
artwork entries) with the Meilisearch service -- running alongside
each other. I don't know how much this model is going to change but
expect it to in future commits.
When uploading a file, a thumbnail is made (if an image, using the
Image Magick program with Bash). This file is not stored in the
database. It is a file-system only thing. The reason for adding this
is some I can create HTML templates/defroutes which show a list of the
images in /storage/media without saturating the viewers bandwidth.
I need to work on this functionality a bit more. This is an end of
session commit. Started it and it works but needs expanding.
I could do with adding file-type checks and changing 'octet/stream' to
something like 'image/png' depending on the file-type (storage in
DB). This will stop the browser from downloading every file in
/storage/media and allow the files which can be viewed in the
browser (like images).
This is an end-of-session commit. I've got the route up and running
with the /user/storage HTML template rendering in the browser and
listing out the files in storage. I could do with adding a model and
storing the files meta-data in the database. This page could do with
rendering the images and placeholders (E.G.generic text file icon) for
non-image files.
The original code was very ham-fisted in how it dealt with storing
files -- based on their file-types. The changes made here improves on
it and the store-file (for both raw and /storage paths) functions now
accepts more file types because of it.