Skip to content

Commit

Permalink
Merge pull request #704 from da7a90-backup/channelstats
Browse files Browse the repository at this point in the history
Fix: added channel stats lookup using host
  • Loading branch information
gagansuie authored Sep 14, 2023
2 parents 4be6dab + c805a47 commit 133292b
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
6 changes: 3 additions & 3 deletions src/routes/[username]/+page.server.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,11 @@ export const load = (async ({ params }: { params: any }) => {
lazy: {
channels: get(`channels/user?userId=${profile._id}&skip=${0}&limit=${10}`),
totalPageViews: get(`stats/views/total-views?viewType=user&viewId=${profile._id}`),
totalChannelViews: get(`stats/views/total-views?viewType=channel&userId=${profile._id}`),
totalChannelViews: get(`stats/views/total-views?viewType=channel&host=${profile._id}`),
totalChannelViews4Weeks: get(
`stats/views/total-views/4-weeks?viewType=channel&userId=${profile._id}`
`stats/views/total-views/4-weeks?viewType=channel&host=${profile._id}`
),
viewsMonthlyIncr: get(`stats/views/monthly-increase?viewType=channel&userId=${profile._id}`),
viewsMonthlyIncr: get(`stats/views/monthly-increase?viewType=channel&host=${profile._id}`),
highestAndCurrentStreak: get(`stats/stream/streak?userId=${profile._id}`),
streakMonthlyIncr: get(`stats/stream/streak/monthly-increase?userId=${profile._id}`),
totalMins: get(`stats/stream/total-mins?userId=${profile._id}`),
Expand Down
3 changes: 2 additions & 1 deletion src/routes/channel/[channelId]/+page.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,8 @@
type: 'view',
userId: $page.data.user?.userId,
viewType: 'channel',
viewId: channel?._id
viewId: channel?._id,
host: channel?.user
},
{
userId: $page.data.user?.userId,
Expand Down

0 comments on commit 133292b

Please sign in to comment.