remotes/1693045480750635534/spooky-22
Aevann1 2021-09-24 04:02:25 +02:00
parent 0b0bc9418e
commit 79f1afa537
3 changed files with 3 additions and 28 deletions

View File

@ -151,7 +151,6 @@ def frontlist(v=None, sort="hot", page=1, t="all", ids_only=True, filter_words='
)
if not (v and v.changelogsub):
posts=posts.join(Submission.submission_aux)
posts=posts.filter(not_(Submission.title.ilike(f'[changelog]%')))
if v and filter_words:
@ -257,7 +256,7 @@ def changeloglist(v=None, sort="new", page=1 ,t="all", **kwargs):
Submission.author_id.notin_(blocked)
)
posts=posts.join(Submission.submission_aux).join(Submission.author)
posts=posts.join(Submission.author)
posts=posts.filter(Submission.title.ilike(f'_changelog%', User.admin_level == 6))
if t != 'all':

View File

@ -490,23 +490,6 @@ def thumbnail_thread(pid):
soup=BeautifulSoup(x.content, 'html.parser')
#parse html
#first, set metadata
try:
meta_title=soup.find('title')
if meta_title:
post.submission_aux.meta_title=str(meta_title.string)[0:500]
meta_desc = soup.find('meta', attrs={"name":"description"})
if meta_desc:
post.submission_aux.meta_description=meta_desc['content'][0:1000]
if meta_title or meta_desc:
db.add(post.submission_aux)
db.commit()
except Exception as e:
pass
#create list of urls to check
thumb_candidate_urls=[]
@ -616,7 +599,7 @@ def submit_post(v):
if url.startswith("https://streamable.com/") and not url.startswith("https://streamable.com/e/"):
url = url.replace("https://streamable.com/", "https://streamable.com/e/")
repost = g.db.query(Submission).join(Submission.submission_aux).options(lazyload('*')).filter(
repost = g.db.query(Submission).options(lazyload('*')).filter(
Submission.url.ilike(url),
Submission.deleted_utc == 0,
Submission.is_banned == False
@ -659,7 +642,7 @@ def submit_post(v):
body = request.values.get("body", "")
# check for duplicate
dup = g.db.query(Submission).join(Submission.submission_aux).options(lazyload('*')).filter(
dup = g.db.query(Submission).options(lazyload('*')).filter(
Submission.author_id == v.id,
Submission.deleted_utc == 0,
@ -716,8 +699,6 @@ def submit_post(v):
similar_posts = g.db.query(Submission).options(
lazyload('*')
).join(
Submission.submission_aux
).filter(
#or_(
# and_(
@ -735,8 +716,6 @@ def submit_post(v):
if url:
similar_urls = g.db.query(Submission).options(
lazyload('*')
).join(
Submission.submission_aux
).filter(
#or_(
# and_(
@ -934,7 +913,6 @@ def submit_post(v):
), 400
g.db.add(new_post)
g.db.add(new_post.submission_aux)
g.db.flush()

View File

@ -60,8 +60,6 @@ def searchposts(v):
posts = g.db.query(Submission).options(
lazyload('*')
).join(
Submission.submission_aux,
).join(
Submission.author
)