trends: notes -> #e, normalize
This commit is contained in:
parent
76c882d836
commit
fc11e34499
|
@ -68,7 +68,7 @@ async function getTrendingHashtags() {
|
|||
return label.created_at >= since && label.created_at < until;
|
||||
});
|
||||
|
||||
const [, , accounts, uses] = label?.tags.find(([name, value]) => name === 't' && value === hashtag) ?? [];
|
||||
const [, , , accounts, uses] = label?.tags.find(([name, value]) => name === 't' && value === hashtag) ?? [];
|
||||
|
||||
return {
|
||||
day: String(date.getTime() / 1000),
|
||||
|
@ -97,7 +97,7 @@ const trendingStatusesController: AppController = async (c) => {
|
|||
const [label] = await store.query([{
|
||||
kinds: [1985],
|
||||
'#L': ['pub.ditto.trends'],
|
||||
'#l': ['notes'],
|
||||
'#l': ['#e'],
|
||||
authors: [Conf.pubkey],
|
||||
limit: 1,
|
||||
}]);
|
||||
|
|
|
@ -32,7 +32,7 @@ async function updateTrendingNotes() {
|
|||
content: '',
|
||||
tags: [
|
||||
['L', 'pub.ditto.trends'],
|
||||
['l', 'notes', 'pub.ditto.trends'],
|
||||
['l', '#e', 'pub.ditto.trends'],
|
||||
...events.map(({ id }) => ['e', id, Conf.relay]),
|
||||
],
|
||||
created_at: Math.floor(Date.now() / 1000),
|
||||
|
@ -64,7 +64,7 @@ async function updateTrendingHashtags() {
|
|||
tags: [
|
||||
['L', 'pub.ditto.trends'],
|
||||
['l', '#t', 'pub.ditto.trends'],
|
||||
...hashtags.map(({ value, authors, uses }) => ['t', value, authors.toString(), uses.toString()]),
|
||||
...hashtags.map(({ value, authors, uses }) => ['t', '', value, authors.toString(), uses.toString()]),
|
||||
],
|
||||
created_at: Math.floor(Date.now() / 1000),
|
||||
});
|
||||
|
@ -95,7 +95,7 @@ async function updateTrendingLinks() {
|
|||
tags: [
|
||||
['L', 'pub.ditto.trends'],
|
||||
['l', '#r', 'pub.ditto.trends'],
|
||||
...links.map(({ value, authors, uses }) => ['r', value, authors.toString(), uses.toString()]),
|
||||
...links.map(({ value, authors, uses }) => ['r', '', value, authors.toString(), uses.toString()]),
|
||||
],
|
||||
created_at: Math.floor(Date.now() / 1000),
|
||||
});
|
||||
|
|
Loading…
Reference in New Issue