Skip to content

Commit c50f3b0

Browse files
rtibblesbotclaude
andcommitted
feat: add included_presets column to File mirrors
Add a nullable included_presets IntegerField to the abstract kolibri_content.base_models.File, inherited by both the kolibri_content (sqlite export) and kolibri_public (import-metadata API) File mirrors. It holds a bitmask of the renderable presets a device needs to render a file. The column is additive and nullable, so old Kolibri ignores it. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
1 parent 2e326c0 commit c50f3b0

3 files changed

Lines changed: 39 additions & 0 deletions

File tree

contentcuration/kolibri_content/base_models.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -132,6 +132,9 @@ class File(models.Model):
132132
supplementary = models.BooleanField(default=False)
133133
thumbnail = models.BooleanField(default=False)
134134
priority = models.IntegerField(blank=True, null=True, db_index=True)
135+
# Bitmask of the renderable presets a device needs to render this file,
136+
# including the file's own preset. NULL for supplementary files.
137+
included_presets = models.IntegerField(blank=True, null=True)
135138

136139
class Meta:
137140
abstract = True
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
# Generated by Django 3.2.25 on 2026-07-12 22:27
2+
3+
from django.db import migrations, models
4+
5+
6+
class Migration(migrations.Migration):
7+
8+
dependencies = [
9+
('content', '0023_auto_20250417_1516'),
10+
]
11+
12+
operations = [
13+
migrations.AddField(
14+
model_name='file',
15+
name='included_presets',
16+
field=models.IntegerField(blank=True, null=True),
17+
),
18+
]
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
# Generated by Django 3.2.25 on 2026-07-12 22:27
2+
3+
from django.db import migrations, models
4+
5+
6+
class Migration(migrations.Migration):
7+
8+
dependencies = [
9+
('kolibri_public', '0008_channelmetadata_categories_bitmask_0'),
10+
]
11+
12+
operations = [
13+
migrations.AddField(
14+
model_name='file',
15+
name='included_presets',
16+
field=models.IntegerField(blank=True, null=True),
17+
),
18+
]

0 commit comments

Comments
 (0)