forked from rDrama/rDrama
dffd
parent
4b67476089
commit
70157c8c27
|
@ -4,6 +4,7 @@ from files.__main__ import Base
|
||||||
from os import environ
|
from os import environ
|
||||||
|
|
||||||
site = environ.get("DOMAIN").strip()
|
site = environ.get("DOMAIN").strip()
|
||||||
|
site_name = environ.get("SITE_NAME").strip()
|
||||||
|
|
||||||
class Image(Base):
|
class Image(Base):
|
||||||
__tablename__ = "images"
|
__tablename__ = "images"
|
||||||
|
@ -15,7 +16,7 @@ class Image(Base):
|
||||||
|
|
||||||
|
|
||||||
@property
|
@property
|
||||||
def path(self): return f"/assets/images/{site}/cover.png"
|
def path(self): return f"/assets/images/{site_name}/cover.png"
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -10,6 +10,7 @@ from .flags import *
|
||||||
from os import environ
|
from os import environ
|
||||||
|
|
||||||
site = environ.get("DOMAIN").strip()
|
site = environ.get("DOMAIN").strip()
|
||||||
|
site_name = environ.get("SITE_NAME").strip()
|
||||||
|
|
||||||
class SubmissionAux(Base):
|
class SubmissionAux(Base):
|
||||||
|
|
||||||
|
@ -203,7 +204,7 @@ class Submission(Base, Stndrd, Age_times, Scores, Fuzzing):
|
||||||
@lazy
|
@lazy
|
||||||
def thumb_url(self):
|
def thumb_url(self):
|
||||||
if self.over_18: return f"https://{site}/assets/images/nsfw.png"
|
if self.over_18: return f"https://{site}/assets/images/nsfw.png"
|
||||||
elif not self.url: return f"https://{site}/assets/images/{site}/default_thumb_text.png"
|
elif not self.url: return f"https://{site}/assets/images/{site_name}/default_thumb_text.png"
|
||||||
elif self.thumburl: return self.thumburl
|
elif self.thumburl: return self.thumburl
|
||||||
elif "youtu.be" in self.domain or "youtube.com" in self.domain: return f"https://{site}/assets/images/default_thumb_yt.png"
|
elif "youtu.be" in self.domain or "youtube.com" in self.domain: return f"https://{site}/assets/images/default_thumb_yt.png"
|
||||||
else: return f"https://{site}/assets/images/default_thumb_link.png"
|
else: return f"https://{site}/assets/images/default_thumb_link.png"
|
||||||
|
|
|
@ -3,6 +3,7 @@ from files.__main__ import app, limiter
|
||||||
from files.helpers.alerts import *
|
from files.helpers.alerts import *
|
||||||
|
|
||||||
site = environ.get("DOMAIN").strip()
|
site = environ.get("DOMAIN").strip()
|
||||||
|
site_name = environ.get("SITE_NAME").strip()
|
||||||
|
|
||||||
@app.get("/stats")
|
@app.get("/stats")
|
||||||
@auth_desired
|
@auth_desired
|
||||||
|
@ -97,7 +98,7 @@ def index():
|
||||||
|
|
||||||
@app.get("/assets/favicon.ico")
|
@app.get("/assets/favicon.ico")
|
||||||
def favicon():
|
def favicon():
|
||||||
return send_file(f"./assets/images/{site}/favicon.png")
|
return send_file(f"./assets/images/{site_name}/favicon.png")
|
||||||
|
|
||||||
@app.get("/api")
|
@app.get("/api")
|
||||||
@auth_desired
|
@auth_desired
|
||||||
|
|
Loading…
Reference in New Issue