Skip to main content

September 30

Hi all, hope you’re doing well ^^ Deserted Chateau updates below.

Video hosting changes

As I talked about in the last update (or the one before that, I forget), I’ve restructured various parts of the backend code and added separate file storage buckets and CDNs for video hosting. The benefit of this is that by having videos stored in separate places to images, if it turns out that volume CDN performance is making images load with very high latency or something, I can change the image hosting to be on normal CDN performance without making videos cost a load of money.

It meant having an extra three file storage buckets (public/private/subscribed content), another three CDN zones, configuring all that stuff, and code changes to upload videos to the new buckets instead of the existing ones.

HTML templates are now done for galleries. This makes the code much easier to maintain, since there is no longer a need to have tons of HTML inside Javascript strings in the gallery rendering code.

I encountered a rather horrific bug that took several hours to solve… when importing document fragments (<template> elements), the “nodes” of the document fragment include not only the other HTML you put inside the template, but any new lines as well. That wasn’t immediately obvious, so I ended up with galleries not rendering properly as all the images/videos would end up on different lines instead of the usual neat rows.

Solved by making sure the template importing code only considers HTML nodes and not text ones.

CSS refactoring

Up to now, the code for the gallery elements has sat in userprofile.css - which isn’t exactly the right place for it. I’ve refactored a lot of styling out of that file and into a separate gallery CSS file, as the two shouldn’t be linked (and it could cause problems later on if they are).

I’ve also started styling control panels for the browse and search pages, so that e.g. a user can toggle whether to show images and/or videos, to hide specific categories and that sort of thing.

Placeholder improvements

I realised while debugging the gallery template issue above that, when an image is hidden by a placeholder in a gallery (due to a user’s filter), it’s not too helpful if it doesn’t actually say what filters caused that behaviour. For instance, if you have a bunch of categories you don’t want to see by default, it’s probably useful to know precisely which categories an artwork has that are in your filters, so you can better decide if you want to click on it to go to its display page.

As such, I’ve implemented a tooltip on any artworks that have placeholders on them, so the user can see which of their filtered categories it has by hovering over the icon. The functionality is done, but I need to polish the styling a little bit and display proper messages instead of the category string. A visual example is here: https://i.imgur.com/i8H8992.png.

Template progress

Outside of galleries, templates are also going to be useful for the different user profile sub-pages (links, commission info, etc). I’ve started on that, and the links template is working in a basic form but needs styling and such.

Bug Fixes
  • Videos now fade in correctly with images. I thought I’d fixed that last time, but it turned out I hadn’t. I’ve sorted it now by making sure that when all images have loaded, they do not fade in until videos have loaded, at which point all of them fade in together.

  • I found a bug in private message sessions, where due to browser local storage and Redis only saving string data types, user IDs were getting misinterpreted client-side due to strict comparison. That’s been solved now.

Next on the list

  • Messaging server improvements. While it works at the moment, the messaging server code needs to be as unlikely to encounter unhandled errors as possible; I need to make sure the code logic accounts for this, and ensure it can handle any malformed inputs gracefully. In addition, I also need to decide on whether reauthorisation at periodic intervals is actually needed, and if so how to handle it to avoid client-side problems when a browser tab has sat idle for a long time.

  • Testing Stripe subscription upgrades and downgrades. From what the Stripe API tells me, this shouldn’t be difficult; the main point of it is to ensure that people moving from e.g. yearly to monthly subscription or vice versa can do so smoothly.