compatible with Mastodon iOS

This commit is contained in:
Your Name 2024-06-02 17:41:23 -04:00 committed by Henri Dickson
parent e38764caea
commit 680df2e4ad
2 changed files with 8 additions and 6 deletions

View file

@ -116,14 +116,14 @@ class DiscoverGenerator(BaseJob):
"provider_name": str(i.category.label),
"history": [
{
"day": int(time.time() / 38600 - 3) * 38600,
"accounts": cnt,
"uses": cnt,
"day": str(int(time.time() / 38400 - 3) * 38400),
"accounts": str(cnt),
"uses": str(cnt),
}
],
}
)
trends.sort(key=lambda x: x["history"][0]["accounts"], reverse=True)
trends.sort(key=lambda x: int(x["history"][0]["accounts"]), reverse=True)
collection_ids = (
Collection.objects.filter(visibility=0)
.annotate(num=Count("interactions"))
@ -134,4 +134,6 @@ class DiscoverGenerator(BaseJob):
cache.set(cache_key, gallery_list, timeout=None)
cache.set("trends_links", trends, timeout=None)
cache.set("featured_collections", collection_ids, timeout=None)
logger.info(f"Discover data updated, trends: {len(trends)}.")
logger.info(
f"Discover data updated, trends: {len(trends)}, collections: {len(collection_ids)}."
)

@ -1 +1 @@
Subproject commit a30021784b52f9d55d33af927145c273f9c49b96
Subproject commit 1522364d4fd399ba2560656e7e714ee7cea7a905