work on the redirection
Gitea Actions Demo / Explore-Gitea-Actions (push) Successful in 3s

This commit is contained in:
2026-08-07 16:26:50 +01:00
parent 60aafb55b8
commit de1977fd2a
7 changed files with 130 additions and 14 deletions
+28 -7
View File
@@ -1,7 +1,10 @@
from django.db import models
from apps.betaserie.utils import betaserieUtils
# Create your models here.
class streamingData(models.Model):
class StreamingSiteTestingData(models.Model):
url = models.CharField(max_length=1000)
addedDate = models.DateField('Published', blank=True, null=True, auto_now_add=True)
status = models.CharField(max_length=1000, blank=True, null=True)
@@ -10,19 +13,37 @@ class streamingData(models.Model):
class Meta:
db_table = 'streaming'
class urlData(models.Model):
def sanitize(self):
print(self)
return 1
class StreamingRedirectData(models.Model):
name = models.CharField(primary_key=True,max_length=1000, help_text="Name of the show")
season_to_watch = models.IntegerField(null=False,default=1)
episode_to_watch = models.IntegerField(null=False,default=1)
url_example = models.CharField(max_length=1000, help_text="https://www.1shows.org/tv/456-the-simpsons?streaming=true&season=18&episode=5")
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)
addedDate = models.DateField('Published', blank=True, null=True, auto_now_add=True)
alias = models.CharField(max_length=1000, default=sanitize)
alias = models.CharField(max_length=1000, null=True,blank=True)
seasonInformation = models.JSONField(default="",max_length=1000,blank=True)
def sanitize(self, name):
return name.replace(" ", "")
def season_information(self, serie_name):
betaserie = betaserieUtils()
print(serie_name)
print(betaserie.identify_serie(serie_name))
return betaserie.series_information(betaserie.identify_serie(serie_name))[0]
def save(self, *args, **kwargs):
if not self.seasonInformation :
self.seasonInformation = self.season_information(self.name)
if not self.alias:
self.alias = self.sanitize(self.name)
super().save(*args, **kwargs)
class Meta:
db_table = 'redirectUrl'
db_table = 'StreamingRedirect'