Add script for importing match schedule and logging
Some checks failed
Code Analysis and Production Deploy / analyze (push) Has been skipped
Code Analysis and Production Deploy / deploy-production (push) Has been skipped
Code Analysis and Production Deploy / deploy-test (push) Successful in 2m2s
Code Analysis and Production Deploy / analyze (pull_request) Failing after 33s
Code Analysis and Production Deploy / deploy-production (pull_request) Has been skipped
Code Analysis and Production Deploy / deploy-test (pull_request) Has been skipped
Require Package Version Change / check (pull_request) Failing after 10s
Some checks failed
Code Analysis and Production Deploy / analyze (push) Has been skipped
Code Analysis and Production Deploy / deploy-production (push) Has been skipped
Code Analysis and Production Deploy / deploy-test (push) Successful in 2m2s
Code Analysis and Production Deploy / analyze (pull_request) Failing after 33s
Code Analysis and Production Deploy / deploy-production (pull_request) Has been skipped
Code Analysis and Production Deploy / deploy-test (pull_request) Has been skipped
Require Package Version Change / check (pull_request) Failing after 10s
- Created `import-spielplan.js` to fetch and parse the match schedule from the specified URL, saving the output as JSON. - Added `run-spielplan-import.sh` to automate the execution of the import script and log output. - Introduced `spielplan.html` file to store the downloaded HTML content for further processing.
This commit is contained in:
24
server/api/spielplan/seasons.get.js
Normal file
24
server/api/spielplan/seasons.get.js
Normal file
@@ -0,0 +1,24 @@
|
||||
import { getCurrentSeasonSlug, listSpielplanSeasons } from '../../utils/spielplan-data.js'
|
||||
|
||||
export default defineEventHandler(async () => {
|
||||
try {
|
||||
const seasons = await listSpielplanSeasons()
|
||||
const currentSeason = getCurrentSeasonSlug()
|
||||
const defaultSeason = seasons.find((season) => season.slug === currentSeason)?.slug || seasons[0]?.slug || null
|
||||
|
||||
return {
|
||||
success: true,
|
||||
seasons,
|
||||
currentSeason,
|
||||
defaultSeason
|
||||
}
|
||||
} catch (error) {
|
||||
console.error('Fehler beim Laden der Spielplan-Saisons:', error)
|
||||
return {
|
||||
success: false,
|
||||
seasons: [],
|
||||
currentSeason: getCurrentSeasonSlug(),
|
||||
defaultSeason: null
|
||||
}
|
||||
}
|
||||
})
|
||||
Reference in New Issue
Block a user