|
@@ -13,29 +13,32 @@ export default class ChannelCommand extends ContentDirectoryCommandBase {
|
|
|
|
|
|
async run() {
|
|
|
const { channelId } = this.parse(ChannelCommand).args
|
|
|
- const [id, aChannel] = await this.channelEntryById(channelId)
|
|
|
-
|
|
|
- displayCollapsedRow({
|
|
|
- 'ID': id.toString(),
|
|
|
- 'Owner': JSON.stringify(aChannel.owner.toJSON()),
|
|
|
- 'IsCensored': aChannel.is_censored.toString(),
|
|
|
- 'RewardAccount': aChannel.reward_account? aChannel.reward_account.toString() : 'NONE'
|
|
|
- })
|
|
|
-
|
|
|
- displayHeader(`Media`)
|
|
|
-
|
|
|
- displayCollapsedRow({
|
|
|
- 'NumberOfVideos': aChannel.videos.length,
|
|
|
- 'NumberOfPlaylists': aChannel.playlists.length,
|
|
|
- 'NumberOfSeries': aChannel.series.length,
|
|
|
- })
|
|
|
-
|
|
|
- displayHeader(`MediaData`)
|
|
|
-
|
|
|
- displayCollapsedRow({
|
|
|
- 'Videos': JSON.stringify(aChannel.videos.toJSON()),
|
|
|
- 'Playlists': JSON.stringify(aChannel.playlists.toJSON()),
|
|
|
- 'Series': JSON.stringify(aChannel.series.toJSON()),
|
|
|
- })
|
|
|
+ const aChannel = await this.getApi().channelById(channelId)
|
|
|
+ if (aChannel) {
|
|
|
+ displayCollapsedRow({
|
|
|
+ 'ID': channelId.toString(),
|
|
|
+ 'Owner': JSON.stringify(aChannel.owner.toJSON()),
|
|
|
+ 'IsCensored': aChannel.is_censored.toString(),
|
|
|
+ 'RewardAccount': aChannel.reward_account? aChannel.reward_account.toString() : 'NONE'
|
|
|
+ })
|
|
|
+
|
|
|
+ displayHeader(`Media`)
|
|
|
+
|
|
|
+ displayCollapsedRow({
|
|
|
+ 'NumberOfVideos': aChannel.videos.length,
|
|
|
+ 'NumberOfPlaylists': aChannel.playlists.length,
|
|
|
+ 'NumberOfSeries': aChannel.series.length,
|
|
|
+ })
|
|
|
+
|
|
|
+ displayHeader(`MediaData`)
|
|
|
+
|
|
|
+ displayCollapsedRow({
|
|
|
+ 'Videos': JSON.stringify(aChannel.videos.toJSON()),
|
|
|
+ 'Playlists': JSON.stringify(aChannel.playlists.toJSON()),
|
|
|
+ 'Series': JSON.stringify(aChannel.series.toJSON()),
|
|
|
+ })
|
|
|
+ } else {
|
|
|
+ this.error(`Channel not found by channel id: "${channelId}"!`)
|
|
|
+ }
|
|
|
}
|
|
|
}
|