feat: added scrapedAt property (#149)

* feat: added scrapedAt property

* fix: type-check
This commit is contained in:
Sriram Hariharan
2024-03-12 00:57:00 -05:00
committed by GitHub
parent 44af9e16e4
commit 8e181b3010
11 changed files with 45 additions and 1 deletions

View File

@@ -73,11 +73,16 @@ export class Course {
instructionMode: InstructionMode;
/** Which semester is the course from */
semester: Semester;
/** Unix timestamp of when the course was last scraped */
scrapedAt: number;
constructor(course: Serialized<Course>) {
Object.assign(this, course);
this.schedule = new CourseSchedule(course.schedule);
this.instructors = course.instructors.map(i => new Instructor(i));
if (!course.scrapedAt) {
this.scrapedAt = Date.now();
}
}
/**