This commit is contained in:
NotARoomba 2026-03-12 16:35:11 -04:00
parent 29d82b2f49
commit 8d2b90a482
2 changed files with 12 additions and 2 deletions

View file

@ -34330,6 +34330,7 @@ async function fetchOtherYswsHours(codeUrls, playableUrls) {
return urlHoursMap;
}
const baseUrl = `https://api.airtable.com/v0/${config.unifiedAirtableBaseId}/${config.unifiedAirtableTableId}`;
const seenRecordIds = new Set;
async function fetchByFormula(formula) {
const results = [];
let offset;
@ -34352,11 +34353,15 @@ async function fetchOtherYswsHours(codeUrls, playableUrls) {
break;
const data = await res.json();
for (const record of data.records) {
if (seenRecordIds.has(record.id))
continue;
seenRecordIds.add(record.id);
const overrideHours = record.fields["Override Hours Spent"];
const hoursSpent = record.fields["Hours Spent"];
const hours = Number(overrideHours ?? hoursSpent ?? 0);
if (hours > 0) {
results.push({
recordId: record.id,
codeUrl: record.fields["Code URL"] || "",
playableUrl: record.fields["Playable URL"] || "",
hours

View file

@ -25,8 +25,10 @@ export async function fetchOtherYswsHours(codeUrls: Set<string>, playableUrls: S
const baseUrl = `https://api.airtable.com/v0/${config.unifiedAirtableBaseId}/${config.unifiedAirtableTableId}`
async function fetchByFormula(formula: string): Promise<{ codeUrl: string; playableUrl: string; hours: number }[]> {
const results: { codeUrl: string; playableUrl: string; hours: number }[] = []
const seenRecordIds = new Set<string>()
async function fetchByFormula(formula: string): Promise<{ recordId: string; codeUrl: string; playableUrl: string; hours: number }[]> {
const results: { recordId: string; codeUrl: string; playableUrl: string; hours: number }[] = []
let offset: string | undefined
do {
const params = new URLSearchParams({
@ -47,11 +49,14 @@ export async function fetchOtherYswsHours(codeUrls: Set<string>, playableUrls: S
const data = await res.json() as { records: { id: string; fields: Record<string, any> }[]; offset?: string }
for (const record of data.records) {
if (seenRecordIds.has(record.id)) continue
seenRecordIds.add(record.id)
const overrideHours = record.fields['Override Hours Spent']
const hoursSpent = record.fields['Hours Spent']
const hours = Number(overrideHours ?? hoursSpent ?? 0)
if (hours > 0) {
results.push({
recordId: record.id,
codeUrl: record.fields['Code URL'] || '',
playableUrl: record.fields['Playable URL'] || '',
hours,