learningequality / learningequality/studio

Remove thumbnail encoding wherever possible and store as files

Open
#2,504 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

DEV: backend DEV: content TAG: tech update / debt
Dominant language
Python
Stars
191
Forks
307
Avg merge
5d 6h
Merged PRs (30d)
10

Description

Summary

Currently we store thumbnails as a thumbnail encoding on both ContentNodes and Channels.

This is problematic when we come to publish channels because we have to create thumbnail files for all of the encoded thumbnails.

It is not as simple as just create files and discarding the thumbnail file object, as frequently thumbnails are uploaded 'whole' and then cropped to create a thumbnail. We need to retain both copies to allow later editing.

Suggested solution:

A new file preset: THUMBNAIL_SOURCE that is applied to the uploaded original file, while a THUMBNAIL preset is created to represent the actually currently used thumbnail (this is also to remove the current disaggregation of the thumbnail presets by kind).

A similar mechanism should be done for the Channel thumbnail also, with the thumbnail files being attached to the root node of the channel main tree.

Two caveats:

  • an encoding will still need to be generated at publish time to send as part of the public channels endpoint for Kolibri and in Kolibri channel databases
  • A migration will need to happen to update all current data to accord to this new pattern - this can happen in a background job, and then we can remove the legacy code that handles the encoding

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by mapping the existing thumbnail encoding paths for ContentNodes and Channels, including how channel thumbnails attach to the root node. The work is complete when source and current thumbnail files use the proposed presets, publish-time encodings still work, and existing data has been migrated without the legacy encoding path.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
backend, database
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.