feat: Update API versioning and parser handling for improved schedule updates and error management
This commit is contained in:
@@ -61,8 +61,6 @@ import {
|
||||
subgroupsOf,
|
||||
} from "../shared/lessons";
|
||||
import qrcode from "qrcode-generator";
|
||||
/** Matches PARSER_VERSION on the server: older saved schedules are re-read once. */
|
||||
const SCHEMA_VERSION = 7;
|
||||
const SOURCE =
|
||||
"https://nextcloud.psu.by/index.php/s/no5zKbMrns6j5jQ?dir=/2026-2027";
|
||||
const DAYS = [
|
||||
@@ -710,10 +708,8 @@ export default function App() {
|
||||
lastCheck.current = Date.now();
|
||||
const c = known === undefined ? await loadCatalog() : known;
|
||||
if (!c || !schedule) return;
|
||||
const found = scheduleUpdate(schedule, c, group, {
|
||||
dismissed: readDismissed(),
|
||||
schemaVersion: SCHEMA_VERSION,
|
||||
});
|
||||
// A schedule read by an older parser than the server's (c.parserVersion) is re-read once.
|
||||
const found = scheduleUpdate(schedule, c, group, { dismissed: readDismissed() });
|
||||
if (!found) return setUpdate(null);
|
||||
// activate() reports what changed for the group.
|
||||
if (found.changed) await loadFile(found.changed, false, group);
|
||||
|
||||
@@ -61,4 +61,6 @@ export interface Catalog {
|
||||
year: string;
|
||||
currentYear?: boolean;
|
||||
expectedYear?: string;
|
||||
/** The server's parser: saved schedules read by an older one are re-read (API 10+). */
|
||||
parserVersion?: number;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user