@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "harheimertc-website",
|
"name": "harheimertc-website",
|
||||||
"version": "1.5.0",
|
"version": "1.5.1",
|
||||||
"description": "Moderne Webseite für den Harheimer Tischtennis Club",
|
"description": "Moderne Webseite für den Harheimer Tischtennis Club",
|
||||||
"private": true,
|
"private": true,
|
||||||
"type": "module",
|
"type": "module",
|
||||||
|
|||||||
@@ -259,7 +259,13 @@
|
|||||||
:class="isCurrentTeamRow(row) ? 'bg-primary-50' : 'bg-white'"
|
:class="isCurrentTeamRow(row) ? 'bg-primary-50' : 'bg-white'"
|
||||||
>
|
>
|
||||||
<td class="px-4 py-3 whitespace-nowrap text-sm text-gray-900">
|
<td class="px-4 py-3 whitespace-nowrap text-sm text-gray-900">
|
||||||
{{ row.table_rank ?? '-' }}
|
{{ row.table_rank ?? '-' }}<span
|
||||||
|
v-if="row.rise_fall_state === 'rise'"
|
||||||
|
class="ml-1 text-green-600"
|
||||||
|
>▲</span><span
|
||||||
|
v-else-if="row.rise_fall_state === 'fall'"
|
||||||
|
class="ml-1 text-red-600"
|
||||||
|
>▼</span>
|
||||||
</td>
|
</td>
|
||||||
<td class="px-4 py-3 whitespace-nowrap text-sm text-gray-900 font-medium">
|
<td class="px-4 py-3 whitespace-nowrap text-sm text-gray-900 font-medium">
|
||||||
{{ row.team_name || '-' }}
|
{{ row.team_name || '-' }}
|
||||||
|
|||||||
@@ -136,13 +136,19 @@ function sanitizeSeasonSlug(value) {
|
|||||||
return /^\d{2}--\d{2}$/.test(seasonSlug) ? seasonSlug : null
|
return /^\d{2}--\d{2}$/.test(seasonSlug) ? seasonSlug : null
|
||||||
}
|
}
|
||||||
|
|
||||||
async function resolveMannschaftenCsvPath() {
|
async function resolveMannschaftenCsvPath(seasonSlug) {
|
||||||
const candidates = [
|
const seasonalName = sanitizeSeasonSlug(seasonSlug) ? `mannschaften_${seasonSlug}.csv` : null
|
||||||
getServerDataPath('public-data', 'mannschaften.csv'),
|
const fileNames = seasonalName ? [seasonalName, 'mannschaften.csv'] : ['mannschaften.csv']
|
||||||
getServerDataPath('mannschaften.csv'),
|
|
||||||
getProjectPath('.output', 'public', 'data', 'mannschaften.csv'),
|
const candidates = []
|
||||||
getProjectPath('public', 'data', 'mannschaften.csv')
|
for (const fileName of fileNames) {
|
||||||
]
|
candidates.push(
|
||||||
|
getServerDataPath('public-data', fileName),
|
||||||
|
getServerDataPath(fileName),
|
||||||
|
getProjectPath('.output', 'public', 'data', fileName),
|
||||||
|
getProjectPath('public', 'data', fileName)
|
||||||
|
)
|
||||||
|
}
|
||||||
|
|
||||||
for (const candidate of candidates) {
|
for (const candidate of candidates) {
|
||||||
if (await fileExists(candidate)) return candidate
|
if (await fileExists(candidate)) return candidate
|
||||||
@@ -204,7 +210,7 @@ async function fetchTable(url) {
|
|||||||
export async function importLeagueTables(options = {}) {
|
export async function importLeagueTables(options = {}) {
|
||||||
const today = options.today ?? new Date()
|
const today = options.today ?? new Date()
|
||||||
const season = getSpieljahrForDate(today)
|
const season = getSpieljahrForDate(today)
|
||||||
const csvPath = await resolveMannschaftenCsvPath()
|
const csvPath = await resolveMannschaftenCsvPath(season.seasonSlug)
|
||||||
const csvContent = await fs.readFile(csvPath, 'utf8')
|
const csvContent = await fs.readFile(csvPath, 'utf8')
|
||||||
const teams = extractRowsWithTableUrl(csvContent)
|
const teams = extractRowsWithTableUrl(csvContent)
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user