app:show_collection: extract max count

master
Felix Stupp 2 years ago
parent 1b8b684b73
commit e028e0abf7
Signed by: zocker
GPG Key ID: 93E1BD26F6B02FB7

@ -414,6 +414,7 @@ def list_pinned_collection():
@flask_app.route("/collection/<int:collection_id>")
def show_collection(collection_id):
SMALL_COLLECTION_MAX_COUNT = 100
collection: MediaCollection = MediaCollection.get(id=collection_id)
if collection is None:
return make_response(f"Not found", 404)
@ -421,7 +422,7 @@ def show_collection(collection_id):
MediaCollectionLink.sorted(
MediaCollectionLink.select(lambda l: l.collection == collection)
)
if orm.count(collection.media_links) <= 100
if orm.count(collection.media_links) <= SMALL_COLLECTION_MAX_COUNT
else None
)
return render_template(

Loading…
Cancel
Save