Reduce number of indexed pages

Removes some package search pages from search results. Also removes all package thread lists (as they are redundant)
This commit is contained in:
rubenwardy
2023-04-24 00:17:26 +01:00
parent d16969837c
commit b785a66ae8
4 changed files with 12 additions and 3 deletions

View File

@@ -103,7 +103,7 @@ def list_all():
return render_template("packages/list.html",
query_hint=title, packages=query.items, pagination=query,
query=search, tags=tags, selected_tags=selected_tags, type=type_name,
authors=authors, packages_count=query.total, topics=topics)
authors=authors, packages_count=query.total, topics=topics, noindex=qb.noindex)
def getReleases(package):

View File

@@ -40,7 +40,7 @@ def list_all():
pid = request.args.get("pid")
if pid:
pid = get_int_or_abort(pid)
package = Package.query.get(pid)
package = Package.query.get_or_404(pid)
query = query.filter_by(package=package)
query = query.filter_by(review_id=None)
@@ -52,7 +52,8 @@ def list_all():
pagination = query.paginate(page=page, per_page=num)
return render_template("threads/list.html", pagination=pagination, threads=pagination.items, package=package)
return render_template("threads/list.html", pagination=pagination, threads=pagination.items,
package=package, noindex=pid)
@bp.route("/threads/<int:id>/subscribe/", methods=["POST"])