1 | _ = require 'lodash'
|
2 | ChannelDownloader = require './channel-downloader'
|
3 |
|
4 | # outside the class so cache is maintained
|
5 | Downloader = new ChannelDownloader
|
6 |
|
7 | class ChannelConfig
|
8 | constructor: (options) ->
|
9 | Downloader.setOptions options
|
10 |
|
11 | get: (type) =>
|
12 | _.findWhere @channels, type: type
|
13 |
|
14 | update: (callback) =>
|
15 | Downloader.update (error, @channels) =>
|
16 | callback error
|
17 |
|
18 | module.exports = ChannelConfig
|