File size: 1,422 Bytes
947c08e
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
from django.db import models
from backend.module.utils import date_utils
import uuid

def get_current_utc_time(): return date_utils.utc_time().get()

class RequestCache(models.Model):
    client = models.UUIDField(primary_key=True)
    datetime = models.DateTimeField(default=get_current_utc_time)

class CloudflareTurnStileCache(models.Model):
    token = models.TextField(primary_key=True)
    datetime = models.DateTimeField(default=get_current_utc_time)
    
class ComicStorageCache(models.Model):
    id = models.UUIDField(primary_key = True, default = uuid.uuid4, editable = False)
    source = models.TextField()
    comic_id = models.TextField()
    chapter_id = models.TextField()
    chapter_idx = models.IntegerField()
    file_path = models.TextField()
    colorize = models.BooleanField()
    translate = models.BooleanField()
    target_lang = models.TextField()
    datetime = models.DateTimeField(default=get_current_utc_time)


class SocketRequestChapterQueueCache(models.Model):
    id = models.UUIDField(primary_key = True, default = uuid.uuid4, editable = False)
    socket_id = models.UUIDField()
    channel_name = models.TextField()
    source = models.TextField()
    comic_id = models.TextField()
    chapter_id = models.TextField()
    chapter_idx = models.IntegerField()
    
    options = models.JSONField()
    datetime = models.DateTimeField(default=get_current_utc_time)