Skip to content

armgit / dub

Public Imported from GitHub
0

The modern link attribution platform. Loved by world-class engineering teams at Twilio, Zillow, Jobber, Vercel, Raycast, and more.

Update backfill-youtube-stats.ts

Steven Teyb963225c3fe6
diff --git a/apps/web/scripts/partners/backfill-youtube-stats.ts b/apps/web/scripts/partners/backfill-youtube-stats.ts
index 90aa13f827..99dd162b17 100644
--- a/apps/web/scripts/partners/backfill-youtube-stats.ts
+++ b/apps/web/scripts/partners/backfill-youtube-stats.ts
@@ -38,6 +38,9 @@ async function main() {
id: true,
youtube: true,
},
+ orderBy: {
+ createdAt: "asc",
+ },
take: 10,
});
@@ -58,15 +61,19 @@ async function main() {
const stats = response.data.items;
if (!stats) {
+ console.log("No stats found");
return;
}
for (const stat of stats) {
const partner = youtubeVerifiedPartners.find(
- (p) => p.youtube === stat.snippet?.customUrl,
+ (p) =>
+ p.youtube?.toLowerCase() ===
+ stat.snippet?.customUrl?.replace("@", "").toLowerCase(),
);
if (!partner || !stat.statistics) {
+ console.log("No partner or stats found");
continue;
}