mirror of
https://github.com/iptv-org/epg
synced 2025-12-16 10:26:41 -05:00
Update save-results.js
This commit is contained in:
@@ -34,7 +34,7 @@ async function main() {
|
||||
if (result.channel.logo) {
|
||||
await db.channels.update(
|
||||
{ _id: result.channel._id },
|
||||
{ $set: { logo: result.channel.logo } }
|
||||
{ $set: { logo: result.channel.logo, programCount: result.programs.length } }
|
||||
)
|
||||
}
|
||||
|
||||
|
||||
@@ -42,6 +42,22 @@ it('can save results', () => {
|
||||
|
||||
const channels = content('tests/__data__/output/database/channels.db')
|
||||
|
||||
expect(Object.keys(channels[0]).sort()).toEqual([
|
||||
'_id',
|
||||
'channelsPath',
|
||||
'cluster_id',
|
||||
'configPath',
|
||||
'country',
|
||||
'groups',
|
||||
'lang',
|
||||
'logo',
|
||||
'name',
|
||||
'programCount',
|
||||
'site',
|
||||
'site_id',
|
||||
'xmltv_id'
|
||||
])
|
||||
|
||||
expect(channels[1]).toMatchObject({
|
||||
_id: '0Wefq0oMR3feCcuY',
|
||||
logo: 'https://example.com/logo.png'
|
||||
|
||||
Reference in New Issue
Block a user