Update stod2.is.config.js

This commit is contained in:
freearhey 2025-01-04 17:01:56 +03:00
parent d156add197
commit cf52b0c3b0

View file

@ -39,8 +39,8 @@ module.exports = {
description: item.lysing,
actors: item.adalhlutverk,
directors: item.leikstjori,
start: start.toISOString,
stop: stop.toISOString
start,
stop
})
})
}
@ -48,21 +48,21 @@ module.exports = {
return programs
},
async channels() {
try {
const response = await axios.get('https://api.stod2.is/dagskra/api')
if (!response.data || !Array.isArray(response.data)) {
console.error('Error: No channels data found')
return []
try {
const response = await axios.get('https://api.stod2.is/dagskra/api')
if (!response.data || !Array.isArray(response.data)) {
console.error('Error: No channels data found')
return []
}
return response.data.map(item => {
return {
lang: 'is',
site_id: item
return response.data.map(item => {
return {
lang: 'is',
site_id: item
}
})
} catch (error) {
console.error('Error fetching channels:', error)
return []
console.error('Error fetching channels:', error)
return []
}
}
}