Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 10 additions & 1 deletion sites/tv.dir.bg/tv.dir.bg.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -204,6 +204,15 @@ function parseItems(content) {
}

const $ = cheerio.load(json.html)
// Now the site gives 3 columns (prev day, current day, next day)
// Before it was 2 columns (current day, next day)
const broadcasts = $('.day-broadcast-list')

// Remove prev day column
if (broadcasts.length >= 3) {
broadcasts.first().remove()
}

const items = $('.broadcast-item').toArray()

return items
Expand All @@ -213,4 +222,4 @@ function parseItems(content) {
console.error('Error stack:', error.stack)
return []
}
}
}
10 changes: 5 additions & 5 deletions sites/tv.dir.bg/tv.dir.bg.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -25,15 +25,15 @@ it('can parse response', () => {
return p
})

expect(results.length).toBe(63)
expect(results.length).toBe(46)

expect(results[0]).toMatchObject({
start: '2025-06-30T03:00:00.000Z',
stop: '2025-06-30T03:30:00.000Z',
title: 'Светът на здравето'
start: '2025-06-30T03:15:00.000Z',
stop: '2025-06-30T03:57:00.000Z',
title: 'Лице в лице'
})

expect(results[62]).toMatchObject({
expect(results[45]).toMatchObject({
start: '2025-07-01T02:00:00.000Z',
stop: '2025-07-01T02:30:00.000Z',
title: 'Убийства в Рая , сезон 1 , епизод 7'
Expand Down
Loading