()
| 21 | } |
| 22 | |
| 23 | async generate() { |
| 24 | const files = this.streams.groupBy((stream: Stream) => stream.getFilename()) |
| 25 | |
| 26 | for (const filename of files.keys()) { |
| 27 | const streams = new Collection(files.get(filename)).map((stream: Stream) => { |
| 28 | const groupTitle = stream |
| 29 | .getCategories() |
| 30 | .map(category => category.name) |
| 31 | .sort() |
| 32 | .join(';') |
| 33 | if (groupTitle) stream.groupTitle = groupTitle |
| 34 | |
| 35 | return stream |
| 36 | }) |
| 37 | const playlist = new Playlist(streams, { public: true }) |
| 38 | const filepath = `raw/${filename}` |
| 39 | await this.storage.save(filepath, playlist.toString()) |
| 40 | this.logFile.append( |
| 41 | JSON.stringify({ type: 'raw', filepath, count: playlist.streams.count() }) + EOL |
| 42 | ) |
| 43 | } |
| 44 | } |
| 45 | } |
nothing calls this directly
no test coverage detected