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