|
|
|
@ -440,18 +440,15 @@ def show_collection(collection_id: int) -> ResponseReturnValue:
|
|
|
|
|
collection: MediaCollection = MediaCollection.get(id=collection_id)
|
|
|
|
|
if collection is None:
|
|
|
|
|
return make_response(f"Not found", 404)
|
|
|
|
|
media_links = (
|
|
|
|
|
MediaCollectionLink.sorted(
|
|
|
|
|
media_links = None
|
|
|
|
|
media_titles = None
|
|
|
|
|
if orm.count(collection.media_links) <= SMALL_COLLECTION_MAX_COUNT:
|
|
|
|
|
media_links = MediaCollectionLink.sorted(
|
|
|
|
|
MediaCollectionLink.select(lambda l: l.collection == collection)
|
|
|
|
|
)
|
|
|
|
|
if orm.count(collection.media_links) <= SMALL_COLLECTION_MAX_COUNT
|
|
|
|
|
else None
|
|
|
|
|
)
|
|
|
|
|
media_titles = (
|
|
|
|
|
remove_common_trails([link.element.title for link in media_links])
|
|
|
|
|
if media_links is not None
|
|
|
|
|
else None
|
|
|
|
|
)
|
|
|
|
|
media_titles = remove_common_trails(
|
|
|
|
|
[link.element.title for link in media_links]
|
|
|
|
|
)
|
|
|
|
|
return render_template(
|
|
|
|
|
"collection_element.htm",
|
|
|
|
|
collection=collection,
|
|
|
|
|