Skip to content
This repository has been archived by the owner on Aug 15, 2023. It is now read-only.

Commit

Permalink
fix filter channel based to fit yt variations
Browse files Browse the repository at this point in the history
  • Loading branch information
vecna committed Nov 15, 2021
1 parent 8877d71 commit 3606b1f
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion backend/routes/ads.js
Original file line number Diff line number Diff line change
Expand Up @@ -35,10 +35,17 @@ async function perChannel(req) {
const channelId = params.getString(req, 'channelId');
const mongoc = await mongo3.clientConnect({concurrency: 1});

const filter = {
'authorSource': { "$in": [
"/channel/" + channelId,
"/c/" + channelId
]}
};

const r = await mongo3.aggregate(mongoc,
nconf.get('schema').ads, [
{ $sort: { savingTime: -1} },
{ $match: { channelId }},
{ $match: filter },
{ $limit: 400 },
{ $lookup: {
from: 'metadata', foreignField: 'id',
Expand Down

0 comments on commit 3606b1f

Please sign in to comment.