forked from forks/microblog.pub
Fix collections
This commit is contained in:
parent
2dcc7319ea
commit
14e5e6b7e7
1 changed files with 4 additions and 4 deletions
|
@ -470,7 +470,7 @@ def build_ordered_collection(
|
||||||
# Returns an empty page if there's a cursor
|
# Returns an empty page if there's a cursor
|
||||||
if cursor:
|
if cursor:
|
||||||
return {
|
return {
|
||||||
"@context": ap.COLLECTION_CTX,
|
"@context": DEFAULT_CTX,
|
||||||
"type": ap.ActivityType.ORDERED_COLLECTION_PAGE.value,
|
"type": ap.ActivityType.ORDERED_COLLECTION_PAGE.value,
|
||||||
"id": BASE_URL + "/" + col_name + "?cursor=" + cursor,
|
"id": BASE_URL + "/" + col_name + "?cursor=" + cursor,
|
||||||
"partOf": BASE_URL + "/" + col_name,
|
"partOf": BASE_URL + "/" + col_name,
|
||||||
|
@ -478,7 +478,7 @@ def build_ordered_collection(
|
||||||
"orderedItems": [],
|
"orderedItems": [],
|
||||||
}
|
}
|
||||||
return {
|
return {
|
||||||
"@context": ap.COLLECTION_CTX,
|
"@context": DEFAULT_CTX,
|
||||||
"id": BASE_URL + "/" + col_name,
|
"id": BASE_URL + "/" + col_name,
|
||||||
"totalItems": 0,
|
"totalItems": 0,
|
||||||
"type": ap.ActivityType.ORDERED_COLLECTION.value,
|
"type": ap.ActivityType.ORDERED_COLLECTION.value,
|
||||||
|
@ -496,7 +496,7 @@ def build_ordered_collection(
|
||||||
# No cursor, this is the first page and we return an OrderedCollection
|
# No cursor, this is the first page and we return an OrderedCollection
|
||||||
if not cursor:
|
if not cursor:
|
||||||
resp = {
|
resp = {
|
||||||
"@context": ap.COLLECTION_CTX,
|
"@context": DEFAULT_CTX,
|
||||||
"id": f"{BASE_URL}/{col_name}",
|
"id": f"{BASE_URL}/{col_name}",
|
||||||
"totalItems": total_items,
|
"totalItems": total_items,
|
||||||
"type": ap.ActivityType.ORDERED_COLLECTION.value,
|
"type": ap.ActivityType.ORDERED_COLLECTION.value,
|
||||||
|
@ -521,7 +521,7 @@ def build_ordered_collection(
|
||||||
|
|
||||||
# If there's a cursor, then we return an OrderedCollectionPage
|
# If there's a cursor, then we return an OrderedCollectionPage
|
||||||
resp = {
|
resp = {
|
||||||
"@context": ap.COLLECTION_CTX,
|
"@context": DEFAULT_CTX,
|
||||||
"type": ap.ActivityType.ORDERED_COLLECTION_PAGE.value,
|
"type": ap.ActivityType.ORDERED_COLLECTION_PAGE.value,
|
||||||
"id": BASE_URL + "/" + col_name + "?cursor=" + start_cursor,
|
"id": BASE_URL + "/" + col_name + "?cursor=" + start_cursor,
|
||||||
"totalItems": total_items,
|
"totalItems": total_items,
|
||||||
|
|
Loading…
Reference in a new issue