fix: update documentation and fix smaller issues (#1520)

This commit is contained in:
Markos Gogoulos
2026-05-13 21:14:02 +03:00
committed by GitHub
parent c7a1d60d73
commit d6a11514e5
15 changed files with 34 additions and 273 deletions
-4
View File
@@ -6,7 +6,6 @@ from django.core.files import File
from django.db import models
from django.db.models.signals import post_delete, post_save
from django.dispatch import receiver
from django.urls import reverse
from .. import helpers
from .utils import (
@@ -136,9 +135,6 @@ class Encoding(models.Model):
def __str__(self):
return f"{self.profile.name}-{self.media.title}"
def get_absolute_url(self):
return reverse("api_get_encoding", kwargs={"encoding_id": self.id})
@receiver(post_save, sender=Encoding)
def encoding_file_save(sender, instance, created, **kwargs):
+2 -4
View File
@@ -559,9 +559,8 @@ class Media(models.Model):
profiles.remove(profile)
encoding = Encoding(media=self, profile=profile)
encoding.save()
enc_url = settings.SSL_FRONTEND_HOST + encoding.get_absolute_url()
tasks.encode_media.apply_async(
args=[self.friendly_token, profile.id, encoding.id, enc_url],
args=[self.friendly_token, profile.id, encoding.id],
kwargs={"force": force},
priority=0,
)
@@ -575,13 +574,12 @@ class Media(models.Model):
continue
encoding = Encoding(media=self, profile=profile)
encoding.save()
enc_url = settings.SSL_FRONTEND_HOST + encoding.get_absolute_url()
if profile.resolution in settings.MINIMUM_RESOLUTIONS_TO_ENCODE:
priority = 9
else:
priority = 0
tasks.encode_media.apply_async(
args=[self.friendly_token, profile.id, encoding.id, enc_url],
args=[self.friendly_token, profile.id, encoding.id],
kwargs={"force": force},
priority=priority,
)