clickable links
Gitea Actions Demo / Explore-Gitea-Actions (push) Successful in 4s

This commit is contained in:
pierre.geeraert
2026-09-04 15:52:38 +01:00
parent f658a018ac
commit 87257fb0b5
3 changed files with 38 additions and 14 deletions
+11 -1
View File
@@ -1,6 +1,7 @@
from django.db import models
from apps.betaserie.utils import betaserieUtils
from django_code.core.settings import ENVIRONMENT
# Create your models here.
@@ -20,7 +21,7 @@ class StreamingRedirectData(models.Model):
name = models.CharField(primary_key=True,max_length=1000, help_text="Name of the show")
season = models.IntegerField(null=False,default=1)
episode = models.IntegerField(null=False,default=0)
url_example = models.CharField(max_length=1000, help_text="https://www.1shows.org/tv/456-the-simpsons?streaming=true&season=18&episode=5")
url_display = models.CharField(max_length=1000, help_text="https://www.1shows.org/tv/456-the-simpsons?streaming=true&season=18&episode=5",blank=True, null=True)
prefix = models.CharField(max_length=1000, help_text="https://www.1shows.org/tv/456-the-simpsons?streaming=true&season=",blank=True, null=True)
infix = models.CharField(max_length=1000, help_text="&episode=",blank=True, null=True)
suffix = models.CharField(max_length=1000, help_text="" ,blank=True, null=True)
@@ -52,6 +53,13 @@ class StreamingRedirectData(models.Model):
print(betaserie.identify_serie(serie_name))
return betaserie.identify_serie(serie_name)
def url_display_set(self,alias):
if ENVIRONMENT == "PRODUCTION":
url = "https://streaming.geeraert.eu/"
else:
url = "https://streaming-testing.geeraert.eu/"
return url+alias
def save(self, *args, **kwargs):
@@ -63,6 +71,8 @@ class StreamingRedirectData(models.Model):
self.betaserieShowId = self.betaserie_show_id(self.name)
if not self.maximumNumberSeason:
self.maximumNumberSeason = self.maximum_Number_Season(self.name)
if not self.url_display:
self.url_display = self.url_display_set(self.alias)
super().save(*args, **kwargs)
class Meta: