Procházet zdrojové kódy

content-metadata: update docs and tests

Mokhtar Naamani před 4 roky
rodič
revize
7525ac2111

+ 1 - 0
content-metadata/.eslintignore

@@ -1,3 +1,4 @@
 lib/
 proto/
+compiled/
 .eslintrc.js

+ 2 - 0
content-metadata/.prettierignore

@@ -1,2 +1,4 @@
 lib/
 doc/
+proto/
+compiled/

+ 30 - 13
content-metadata/README.md

@@ -1,13 +1,32 @@
-# Joystream Content Directory Metadata Library
+## Joystream Content Directory Metadata Library
 
-## Message Specs
+This package contains protobuf message definitions compiled to Javascript/Typescript used for creating and updating various metadata blobs in the joystream content directory.
 
-Specs are documented in [doc](./doc) folder
+### Message Specs
 
-## Helper methods
-Simple methods to construct Licenses messages
+Documented in [doc](./doc) folder
+
+### Choice of protobuf protocol v2
+
+For our usecase we wish to re-use same message to create and update  subset of fields.
+For this reason we need the explicit information about wether a field has been set or not and this is only possible with proto v2.
+
+Background: required/optional feilds are deprecated in [proto v3](https://www.ben-morris.com/handling-protocol-buffers-backwards-compatibility-between-versions-2-and-3-using-c/)
+
+
+### Helper methods
+The custom Joystream types such as License have helper methods to construct pre-defined well known values.
+
+### Example code:
+
+Best place to look at are the [tests specs](./test)
+
+### Opaque types
+We use simple [ISO_639-1](https://en.wikipedia.org/wiki/List_of_ISO_639-1_codes) code representation for Language.
+useful npm package https://www.npmjs.com/package/iso-639-1
+
+### Compiling `.proto` files:
 
-## Compiling `.proto` files:
 pre-requisists:
     - [protoc](https://github.com/protocolbuffers/protobuf/releases)
     - [golang](https://golang.org/)
@@ -17,16 +36,14 @@ pre-requisists:
 yarn compile
 ```
 
-## Test
-```
-yarn test
-```
-
-## Build
+### Build
 After compiling proto files
 
 ```
 yarn build
 ```
 
-
+### Test
+```
+yarn test
+```

+ 1 - 1
content-metadata/compile.sh

@@ -4,7 +4,7 @@
 PROTOC_GEN_TS_PATH="./node_modules/.bin/protoc-gen-ts"
 
 # Directory to write generated code to (.js and .d.ts files)
-OUT_DIR="./"
+OUT_DIR="./compiled"
 # mkdir -p ${OUT_DIR}
 
 # Directory to write generated documentation to

+ 45 - 0
content-metadata/compiled/proto/Channel_pb.d.ts

@@ -0,0 +1,45 @@
+// package: 
+// file: proto/Channel.proto
+
+import * as jspb from "google-protobuf";
+
+export class ChannelMetadata extends jspb.Message {
+  hasTitle(): boolean;
+  clearTitle(): void;
+  getTitle(): string | undefined;
+  setTitle(value: string): void;
+
+  hasDescription(): boolean;
+  clearDescription(): void;
+  getDescription(): string | undefined;
+  setDescription(value: string): void;
+
+  hasIsPublic(): boolean;
+  clearIsPublic(): void;
+  getIsPublic(): boolean | undefined;
+  setIsPublic(value: boolean): void;
+
+  hasLanguage(): boolean;
+  clearLanguage(): void;
+  getLanguage(): string | undefined;
+  setLanguage(value: string): void;
+
+  serializeBinary(): Uint8Array;
+  toObject(includeInstance?: boolean): ChannelMetadata.AsObject;
+  static toObject(includeInstance: boolean, msg: ChannelMetadata): ChannelMetadata.AsObject;
+  static extensions: {[key: number]: jspb.ExtensionFieldInfo<jspb.Message>};
+  static extensionsBinary: {[key: number]: jspb.ExtensionFieldBinaryInfo<jspb.Message>};
+  static serializeBinaryToWriter(message: ChannelMetadata, writer: jspb.BinaryWriter): void;
+  static deserializeBinary(bytes: Uint8Array): ChannelMetadata;
+  static deserializeBinaryFromReader(message: ChannelMetadata, reader: jspb.BinaryReader): ChannelMetadata;
+}
+
+export namespace ChannelMetadata {
+  export type AsObject = {
+    title?: string,
+    description?: string,
+    isPublic?: boolean,
+    language?: string,
+  }
+}
+

+ 331 - 0
content-metadata/compiled/proto/Channel_pb.js

@@ -0,0 +1,331 @@
+// source: proto/Channel.proto
+/**
+ * @fileoverview
+ * @enhanceable
+ * @suppress {messageConventions} JS Compiler reports an error if a variable or
+ *     field starts with 'MSG_' and isn't a translatable message.
+ * @public
+ */
+// GENERATED CODE -- DO NOT EDIT!
+/* eslint-disable */
+// @ts-nocheck
+
+var jspb = require('google-protobuf');
+var goog = jspb;
+var global = Function('return this')();
+
+goog.exportSymbol('proto.ChannelMetadata', null, global);
+/**
+ * Generated by JsPbCodeGenerator.
+ * @param {Array=} opt_data Optional initial data array, typically from a
+ * server response, or constructed directly in Javascript. The array is used
+ * in place and becomes part of the constructed object. It is not cloned.
+ * If no data is provided, the constructed object will be empty, but still
+ * valid.
+ * @extends {jspb.Message}
+ * @constructor
+ */
+proto.ChannelMetadata = function(opt_data) {
+  jspb.Message.initialize(this, opt_data, 0, -1, null, null);
+};
+goog.inherits(proto.ChannelMetadata, jspb.Message);
+if (goog.DEBUG && !COMPILED) {
+  /**
+   * @public
+   * @override
+   */
+  proto.ChannelMetadata.displayName = 'proto.ChannelMetadata';
+}
+
+
+
+if (jspb.Message.GENERATE_TO_OBJECT) {
+/**
+ * Creates an object representation of this proto.
+ * Field names that are reserved in JavaScript and will be renamed to pb_name.
+ * Optional fields that are not set will be set to undefined.
+ * To access a reserved field use, foo.pb_<name>, eg, foo.pb_default.
+ * For the list of reserved names please see:
+ *     net/proto2/compiler/js/internal/generator.cc#kKeyword.
+ * @param {boolean=} opt_includeInstance Deprecated. whether to include the
+ *     JSPB instance for transitional soy proto support:
+ *     http://goto/soy-param-migration
+ * @return {!Object}
+ */
+proto.ChannelMetadata.prototype.toObject = function(opt_includeInstance) {
+  return proto.ChannelMetadata.toObject(opt_includeInstance, this);
+};
+
+
+/**
+ * Static version of the {@see toObject} method.
+ * @param {boolean|undefined} includeInstance Deprecated. Whether to include
+ *     the JSPB instance for transitional soy proto support:
+ *     http://goto/soy-param-migration
+ * @param {!proto.ChannelMetadata} msg The msg instance to transform.
+ * @return {!Object}
+ * @suppress {unusedLocalVariables} f is only used for nested messages
+ */
+proto.ChannelMetadata.toObject = function(includeInstance, msg) {
+  var f, obj = {
+    title: (f = jspb.Message.getField(msg, 1)) == null ? undefined : f,
+    description: (f = jspb.Message.getField(msg, 2)) == null ? undefined : f,
+    isPublic: (f = jspb.Message.getBooleanField(msg, 3)) == null ? undefined : f,
+    language: (f = jspb.Message.getField(msg, 4)) == null ? undefined : f
+  };
+
+  if (includeInstance) {
+    obj.$jspbMessageInstance = msg;
+  }
+  return obj;
+};
+}
+
+
+/**
+ * Deserializes binary data (in protobuf wire format).
+ * @param {jspb.ByteSource} bytes The bytes to deserialize.
+ * @return {!proto.ChannelMetadata}
+ */
+proto.ChannelMetadata.deserializeBinary = function(bytes) {
+  var reader = new jspb.BinaryReader(bytes);
+  var msg = new proto.ChannelMetadata;
+  return proto.ChannelMetadata.deserializeBinaryFromReader(msg, reader);
+};
+
+
+/**
+ * Deserializes binary data (in protobuf wire format) from the
+ * given reader into the given message object.
+ * @param {!proto.ChannelMetadata} msg The message object to deserialize into.
+ * @param {!jspb.BinaryReader} reader The BinaryReader to use.
+ * @return {!proto.ChannelMetadata}
+ */
+proto.ChannelMetadata.deserializeBinaryFromReader = function(msg, reader) {
+  while (reader.nextField()) {
+    if (reader.isEndGroup()) {
+      break;
+    }
+    var field = reader.getFieldNumber();
+    switch (field) {
+    case 1:
+      var value = /** @type {string} */ (reader.readString());
+      msg.setTitle(value);
+      break;
+    case 2:
+      var value = /** @type {string} */ (reader.readString());
+      msg.setDescription(value);
+      break;
+    case 3:
+      var value = /** @type {boolean} */ (reader.readBool());
+      msg.setIsPublic(value);
+      break;
+    case 4:
+      var value = /** @type {string} */ (reader.readString());
+      msg.setLanguage(value);
+      break;
+    default:
+      reader.skipField();
+      break;
+    }
+  }
+  return msg;
+};
+
+
+/**
+ * Serializes the message to binary data (in protobuf wire format).
+ * @return {!Uint8Array}
+ */
+proto.ChannelMetadata.prototype.serializeBinary = function() {
+  var writer = new jspb.BinaryWriter();
+  proto.ChannelMetadata.serializeBinaryToWriter(this, writer);
+  return writer.getResultBuffer();
+};
+
+
+/**
+ * Serializes the given message to binary data (in protobuf wire
+ * format), writing to the given BinaryWriter.
+ * @param {!proto.ChannelMetadata} message
+ * @param {!jspb.BinaryWriter} writer
+ * @suppress {unusedLocalVariables} f is only used for nested messages
+ */
+proto.ChannelMetadata.serializeBinaryToWriter = function(message, writer) {
+  var f = undefined;
+  f = /** @type {string} */ (jspb.Message.getField(message, 1));
+  if (f != null) {
+    writer.writeString(
+      1,
+      f
+    );
+  }
+  f = /** @type {string} */ (jspb.Message.getField(message, 2));
+  if (f != null) {
+    writer.writeString(
+      2,
+      f
+    );
+  }
+  f = /** @type {boolean} */ (jspb.Message.getField(message, 3));
+  if (f != null) {
+    writer.writeBool(
+      3,
+      f
+    );
+  }
+  f = /** @type {string} */ (jspb.Message.getField(message, 4));
+  if (f != null) {
+    writer.writeString(
+      4,
+      f
+    );
+  }
+};
+
+
+/**
+ * optional string title = 1;
+ * @return {string}
+ */
+proto.ChannelMetadata.prototype.getTitle = function() {
+  return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 1, ""));
+};
+
+
+/**
+ * @param {string} value
+ * @return {!proto.ChannelMetadata} returns this
+ */
+proto.ChannelMetadata.prototype.setTitle = function(value) {
+  return jspb.Message.setField(this, 1, value);
+};
+
+
+/**
+ * Clears the field making it undefined.
+ * @return {!proto.ChannelMetadata} returns this
+ */
+proto.ChannelMetadata.prototype.clearTitle = function() {
+  return jspb.Message.setField(this, 1, undefined);
+};
+
+
+/**
+ * Returns whether this field is set.
+ * @return {boolean}
+ */
+proto.ChannelMetadata.prototype.hasTitle = function() {
+  return jspb.Message.getField(this, 1) != null;
+};
+
+
+/**
+ * optional string description = 2;
+ * @return {string}
+ */
+proto.ChannelMetadata.prototype.getDescription = function() {
+  return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 2, ""));
+};
+
+
+/**
+ * @param {string} value
+ * @return {!proto.ChannelMetadata} returns this
+ */
+proto.ChannelMetadata.prototype.setDescription = function(value) {
+  return jspb.Message.setField(this, 2, value);
+};
+
+
+/**
+ * Clears the field making it undefined.
+ * @return {!proto.ChannelMetadata} returns this
+ */
+proto.ChannelMetadata.prototype.clearDescription = function() {
+  return jspb.Message.setField(this, 2, undefined);
+};
+
+
+/**
+ * Returns whether this field is set.
+ * @return {boolean}
+ */
+proto.ChannelMetadata.prototype.hasDescription = function() {
+  return jspb.Message.getField(this, 2) != null;
+};
+
+
+/**
+ * optional bool is_public = 3;
+ * @return {boolean}
+ */
+proto.ChannelMetadata.prototype.getIsPublic = function() {
+  return /** @type {boolean} */ (jspb.Message.getBooleanFieldWithDefault(this, 3, false));
+};
+
+
+/**
+ * @param {boolean} value
+ * @return {!proto.ChannelMetadata} returns this
+ */
+proto.ChannelMetadata.prototype.setIsPublic = function(value) {
+  return jspb.Message.setField(this, 3, value);
+};
+
+
+/**
+ * Clears the field making it undefined.
+ * @return {!proto.ChannelMetadata} returns this
+ */
+proto.ChannelMetadata.prototype.clearIsPublic = function() {
+  return jspb.Message.setField(this, 3, undefined);
+};
+
+
+/**
+ * Returns whether this field is set.
+ * @return {boolean}
+ */
+proto.ChannelMetadata.prototype.hasIsPublic = function() {
+  return jspb.Message.getField(this, 3) != null;
+};
+
+
+/**
+ * optional string language = 4;
+ * @return {string}
+ */
+proto.ChannelMetadata.prototype.getLanguage = function() {
+  return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 4, ""));
+};
+
+
+/**
+ * @param {string} value
+ * @return {!proto.ChannelMetadata} returns this
+ */
+proto.ChannelMetadata.prototype.setLanguage = function(value) {
+  return jspb.Message.setField(this, 4, value);
+};
+
+
+/**
+ * Clears the field making it undefined.
+ * @return {!proto.ChannelMetadata} returns this
+ */
+proto.ChannelMetadata.prototype.clearLanguage = function() {
+  return jspb.Message.setField(this, 4, undefined);
+};
+
+
+/**
+ * Returns whether this field is set.
+ * @return {boolean}
+ */
+proto.ChannelMetadata.prototype.hasLanguage = function() {
+  return jspb.Message.getField(this, 4) != null;
+};
+
+
+goog.object.extend(exports, proto);

+ 189 - 0
content-metadata/compiled/proto/Video_pb.d.ts

@@ -0,0 +1,189 @@
+// package: 
+// file: proto/Video.proto
+
+import * as jspb from "google-protobuf";
+
+export class PublishedBeforeJoystream extends jspb.Message {
+  hasIsPublished(): boolean;
+  clearIsPublished(): void;
+  getIsPublished(): boolean | undefined;
+  setIsPublished(value: boolean): void;
+
+  hasTimestamp(): boolean;
+  clearTimestamp(): void;
+  getTimestamp(): number | undefined;
+  setTimestamp(value: number): void;
+
+  serializeBinary(): Uint8Array;
+  toObject(includeInstance?: boolean): PublishedBeforeJoystream.AsObject;
+  static toObject(includeInstance: boolean, msg: PublishedBeforeJoystream): PublishedBeforeJoystream.AsObject;
+  static extensions: {[key: number]: jspb.ExtensionFieldInfo<jspb.Message>};
+  static extensionsBinary: {[key: number]: jspb.ExtensionFieldBinaryInfo<jspb.Message>};
+  static serializeBinaryToWriter(message: PublishedBeforeJoystream, writer: jspb.BinaryWriter): void;
+  static deserializeBinary(bytes: Uint8Array): PublishedBeforeJoystream;
+  static deserializeBinaryFromReader(message: PublishedBeforeJoystream, reader: jspb.BinaryReader): PublishedBeforeJoystream;
+}
+
+export namespace PublishedBeforeJoystream {
+  export type AsObject = {
+    isPublished?: boolean,
+    timestamp?: number,
+  }
+}
+
+export class License extends jspb.Message {
+  hasCode(): boolean;
+  clearCode(): void;
+  getCode(): number | undefined;
+  setCode(value: number): void;
+
+  hasAttribution(): boolean;
+  clearAttribution(): void;
+  getAttribution(): string | undefined;
+  setAttribution(value: string): void;
+
+  hasCustomText(): boolean;
+  clearCustomText(): void;
+  getCustomText(): string | undefined;
+  setCustomText(value: string): void;
+
+  serializeBinary(): Uint8Array;
+  toObject(includeInstance?: boolean): License.AsObject;
+  static toObject(includeInstance: boolean, msg: License): License.AsObject;
+  static extensions: {[key: number]: jspb.ExtensionFieldInfo<jspb.Message>};
+  static extensionsBinary: {[key: number]: jspb.ExtensionFieldBinaryInfo<jspb.Message>};
+  static serializeBinaryToWriter(message: License, writer: jspb.BinaryWriter): void;
+  static deserializeBinary(bytes: Uint8Array): License;
+  static deserializeBinaryFromReader(message: License, reader: jspb.BinaryReader): License;
+}
+
+export namespace License {
+  export type AsObject = {
+    code?: number,
+    attribution?: string,
+    customText?: string,
+  }
+}
+
+export class MediaType extends jspb.Message {
+  hasCodecName(): boolean;
+  clearCodecName(): void;
+  getCodecName(): string | undefined;
+  setCodecName(value: string): void;
+
+  hasContainer(): boolean;
+  clearContainer(): void;
+  getContainer(): string | undefined;
+  setContainer(value: string): void;
+
+  hasMimeMediaType(): boolean;
+  clearMimeMediaType(): void;
+  getMimeMediaType(): string | undefined;
+  setMimeMediaType(value: string): void;
+
+  serializeBinary(): Uint8Array;
+  toObject(includeInstance?: boolean): MediaType.AsObject;
+  static toObject(includeInstance: boolean, msg: MediaType): MediaType.AsObject;
+  static extensions: {[key: number]: jspb.ExtensionFieldInfo<jspb.Message>};
+  static extensionsBinary: {[key: number]: jspb.ExtensionFieldBinaryInfo<jspb.Message>};
+  static serializeBinaryToWriter(message: MediaType, writer: jspb.BinaryWriter): void;
+  static deserializeBinary(bytes: Uint8Array): MediaType;
+  static deserializeBinaryFromReader(message: MediaType, reader: jspb.BinaryReader): MediaType;
+}
+
+export namespace MediaType {
+  export type AsObject = {
+    codecName?: string,
+    container?: string,
+    mimeMediaType?: string,
+  }
+}
+
+export class VideoMetadata extends jspb.Message {
+  hasTitle(): boolean;
+  clearTitle(): void;
+  getTitle(): string | undefined;
+  setTitle(value: string): void;
+
+  hasDescription(): boolean;
+  clearDescription(): void;
+  getDescription(): string | undefined;
+  setDescription(value: string): void;
+
+  hasDuration(): boolean;
+  clearDuration(): void;
+  getDuration(): number | undefined;
+  setDuration(value: number): void;
+
+  hasMediaPixelHeight(): boolean;
+  clearMediaPixelHeight(): void;
+  getMediaPixelHeight(): number | undefined;
+  setMediaPixelHeight(value: number): void;
+
+  hasMediaPixelWidth(): boolean;
+  clearMediaPixelWidth(): void;
+  getMediaPixelWidth(): number | undefined;
+  setMediaPixelWidth(value: number): void;
+
+  hasMediaType(): boolean;
+  clearMediaType(): void;
+  getMediaType(): MediaType | undefined;
+  setMediaType(value?: MediaType): void;
+
+  hasLanguage(): boolean;
+  clearLanguage(): void;
+  getLanguage(): string | undefined;
+  setLanguage(value: string): void;
+
+  hasLicense(): boolean;
+  clearLicense(): void;
+  getLicense(): License | undefined;
+  setLicense(value?: License): void;
+
+  hasPublishedBeforeJoystream(): boolean;
+  clearPublishedBeforeJoystream(): void;
+  getPublishedBeforeJoystream(): PublishedBeforeJoystream | undefined;
+  setPublishedBeforeJoystream(value?: PublishedBeforeJoystream): void;
+
+  hasHasMarketing(): boolean;
+  clearHasMarketing(): void;
+  getHasMarketing(): boolean | undefined;
+  setHasMarketing(value: boolean): void;
+
+  hasIsPublic(): boolean;
+  clearIsPublic(): void;
+  getIsPublic(): boolean | undefined;
+  setIsPublic(value: boolean): void;
+
+  hasIsExplicit(): boolean;
+  clearIsExplicit(): void;
+  getIsExplicit(): boolean | undefined;
+  setIsExplicit(value: boolean): void;
+
+  serializeBinary(): Uint8Array;
+  toObject(includeInstance?: boolean): VideoMetadata.AsObject;
+  static toObject(includeInstance: boolean, msg: VideoMetadata): VideoMetadata.AsObject;
+  static extensions: {[key: number]: jspb.ExtensionFieldInfo<jspb.Message>};
+  static extensionsBinary: {[key: number]: jspb.ExtensionFieldBinaryInfo<jspb.Message>};
+  static serializeBinaryToWriter(message: VideoMetadata, writer: jspb.BinaryWriter): void;
+  static deserializeBinary(bytes: Uint8Array): VideoMetadata;
+  static deserializeBinaryFromReader(message: VideoMetadata, reader: jspb.BinaryReader): VideoMetadata;
+}
+
+export namespace VideoMetadata {
+  export type AsObject = {
+    title?: string,
+    description?: string,
+    duration?: number,
+    mediaPixelHeight?: number,
+    mediaPixelWidth?: number,
+    mediaType?: MediaType.AsObject,
+    language?: string,
+    license?: License.AsObject,
+    publishedBeforeJoystream?: PublishedBeforeJoystream.AsObject,
+    hasMarketing?: boolean,
+    isPublic?: boolean,
+    isExplicit?: boolean,
+  }
+}
+

+ 1474 - 0
content-metadata/compiled/proto/Video_pb.js

@@ -0,0 +1,1474 @@
+// source: proto/Video.proto
+/**
+ * @fileoverview
+ * @enhanceable
+ * @suppress {messageConventions} JS Compiler reports an error if a variable or
+ *     field starts with 'MSG_' and isn't a translatable message.
+ * @public
+ */
+// GENERATED CODE -- DO NOT EDIT!
+/* eslint-disable */
+// @ts-nocheck
+
+var jspb = require('google-protobuf');
+var goog = jspb;
+var global = Function('return this')();
+
+goog.exportSymbol('proto.License', null, global);
+goog.exportSymbol('proto.MediaType', null, global);
+goog.exportSymbol('proto.PublishedBeforeJoystream', null, global);
+goog.exportSymbol('proto.VideoMetadata', null, global);
+/**
+ * Generated by JsPbCodeGenerator.
+ * @param {Array=} opt_data Optional initial data array, typically from a
+ * server response, or constructed directly in Javascript. The array is used
+ * in place and becomes part of the constructed object. It is not cloned.
+ * If no data is provided, the constructed object will be empty, but still
+ * valid.
+ * @extends {jspb.Message}
+ * @constructor
+ */
+proto.PublishedBeforeJoystream = function(opt_data) {
+  jspb.Message.initialize(this, opt_data, 0, -1, null, null);
+};
+goog.inherits(proto.PublishedBeforeJoystream, jspb.Message);
+if (goog.DEBUG && !COMPILED) {
+  /**
+   * @public
+   * @override
+   */
+  proto.PublishedBeforeJoystream.displayName = 'proto.PublishedBeforeJoystream';
+}
+/**
+ * Generated by JsPbCodeGenerator.
+ * @param {Array=} opt_data Optional initial data array, typically from a
+ * server response, or constructed directly in Javascript. The array is used
+ * in place and becomes part of the constructed object. It is not cloned.
+ * If no data is provided, the constructed object will be empty, but still
+ * valid.
+ * @extends {jspb.Message}
+ * @constructor
+ */
+proto.License = function(opt_data) {
+  jspb.Message.initialize(this, opt_data, 0, -1, null, null);
+};
+goog.inherits(proto.License, jspb.Message);
+if (goog.DEBUG && !COMPILED) {
+  /**
+   * @public
+   * @override
+   */
+  proto.License.displayName = 'proto.License';
+}
+/**
+ * Generated by JsPbCodeGenerator.
+ * @param {Array=} opt_data Optional initial data array, typically from a
+ * server response, or constructed directly in Javascript. The array is used
+ * in place and becomes part of the constructed object. It is not cloned.
+ * If no data is provided, the constructed object will be empty, but still
+ * valid.
+ * @extends {jspb.Message}
+ * @constructor
+ */
+proto.MediaType = function(opt_data) {
+  jspb.Message.initialize(this, opt_data, 0, -1, null, null);
+};
+goog.inherits(proto.MediaType, jspb.Message);
+if (goog.DEBUG && !COMPILED) {
+  /**
+   * @public
+   * @override
+   */
+  proto.MediaType.displayName = 'proto.MediaType';
+}
+/**
+ * Generated by JsPbCodeGenerator.
+ * @param {Array=} opt_data Optional initial data array, typically from a
+ * server response, or constructed directly in Javascript. The array is used
+ * in place and becomes part of the constructed object. It is not cloned.
+ * If no data is provided, the constructed object will be empty, but still
+ * valid.
+ * @extends {jspb.Message}
+ * @constructor
+ */
+proto.VideoMetadata = function(opt_data) {
+  jspb.Message.initialize(this, opt_data, 0, -1, null, null);
+};
+goog.inherits(proto.VideoMetadata, jspb.Message);
+if (goog.DEBUG && !COMPILED) {
+  /**
+   * @public
+   * @override
+   */
+  proto.VideoMetadata.displayName = 'proto.VideoMetadata';
+}
+
+
+
+if (jspb.Message.GENERATE_TO_OBJECT) {
+/**
+ * Creates an object representation of this proto.
+ * Field names that are reserved in JavaScript and will be renamed to pb_name.
+ * Optional fields that are not set will be set to undefined.
+ * To access a reserved field use, foo.pb_<name>, eg, foo.pb_default.
+ * For the list of reserved names please see:
+ *     net/proto2/compiler/js/internal/generator.cc#kKeyword.
+ * @param {boolean=} opt_includeInstance Deprecated. whether to include the
+ *     JSPB instance for transitional soy proto support:
+ *     http://goto/soy-param-migration
+ * @return {!Object}
+ */
+proto.PublishedBeforeJoystream.prototype.toObject = function(opt_includeInstance) {
+  return proto.PublishedBeforeJoystream.toObject(opt_includeInstance, this);
+};
+
+
+/**
+ * Static version of the {@see toObject} method.
+ * @param {boolean|undefined} includeInstance Deprecated. Whether to include
+ *     the JSPB instance for transitional soy proto support:
+ *     http://goto/soy-param-migration
+ * @param {!proto.PublishedBeforeJoystream} msg The msg instance to transform.
+ * @return {!Object}
+ * @suppress {unusedLocalVariables} f is only used for nested messages
+ */
+proto.PublishedBeforeJoystream.toObject = function(includeInstance, msg) {
+  var f, obj = {
+    isPublished: (f = jspb.Message.getBooleanField(msg, 1)) == null ? undefined : f,
+    timestamp: (f = jspb.Message.getField(msg, 2)) == null ? undefined : f
+  };
+
+  if (includeInstance) {
+    obj.$jspbMessageInstance = msg;
+  }
+  return obj;
+};
+}
+
+
+/**
+ * Deserializes binary data (in protobuf wire format).
+ * @param {jspb.ByteSource} bytes The bytes to deserialize.
+ * @return {!proto.PublishedBeforeJoystream}
+ */
+proto.PublishedBeforeJoystream.deserializeBinary = function(bytes) {
+  var reader = new jspb.BinaryReader(bytes);
+  var msg = new proto.PublishedBeforeJoystream;
+  return proto.PublishedBeforeJoystream.deserializeBinaryFromReader(msg, reader);
+};
+
+
+/**
+ * Deserializes binary data (in protobuf wire format) from the
+ * given reader into the given message object.
+ * @param {!proto.PublishedBeforeJoystream} msg The message object to deserialize into.
+ * @param {!jspb.BinaryReader} reader The BinaryReader to use.
+ * @return {!proto.PublishedBeforeJoystream}
+ */
+proto.PublishedBeforeJoystream.deserializeBinaryFromReader = function(msg, reader) {
+  while (reader.nextField()) {
+    if (reader.isEndGroup()) {
+      break;
+    }
+    var field = reader.getFieldNumber();
+    switch (field) {
+    case 1:
+      var value = /** @type {boolean} */ (reader.readBool());
+      msg.setIsPublished(value);
+      break;
+    case 2:
+      var value = /** @type {number} */ (reader.readUint32());
+      msg.setTimestamp(value);
+      break;
+    default:
+      reader.skipField();
+      break;
+    }
+  }
+  return msg;
+};
+
+
+/**
+ * Serializes the message to binary data (in protobuf wire format).
+ * @return {!Uint8Array}
+ */
+proto.PublishedBeforeJoystream.prototype.serializeBinary = function() {
+  var writer = new jspb.BinaryWriter();
+  proto.PublishedBeforeJoystream.serializeBinaryToWriter(this, writer);
+  return writer.getResultBuffer();
+};
+
+
+/**
+ * Serializes the given message to binary data (in protobuf wire
+ * format), writing to the given BinaryWriter.
+ * @param {!proto.PublishedBeforeJoystream} message
+ * @param {!jspb.BinaryWriter} writer
+ * @suppress {unusedLocalVariables} f is only used for nested messages
+ */
+proto.PublishedBeforeJoystream.serializeBinaryToWriter = function(message, writer) {
+  var f = undefined;
+  f = /** @type {boolean} */ (jspb.Message.getField(message, 1));
+  if (f != null) {
+    writer.writeBool(
+      1,
+      f
+    );
+  }
+  f = /** @type {number} */ (jspb.Message.getField(message, 2));
+  if (f != null) {
+    writer.writeUint32(
+      2,
+      f
+    );
+  }
+};
+
+
+/**
+ * optional bool is_published = 1;
+ * @return {boolean}
+ */
+proto.PublishedBeforeJoystream.prototype.getIsPublished = function() {
+  return /** @type {boolean} */ (jspb.Message.getBooleanFieldWithDefault(this, 1, false));
+};
+
+
+/**
+ * @param {boolean} value
+ * @return {!proto.PublishedBeforeJoystream} returns this
+ */
+proto.PublishedBeforeJoystream.prototype.setIsPublished = function(value) {
+  return jspb.Message.setField(this, 1, value);
+};
+
+
+/**
+ * Clears the field making it undefined.
+ * @return {!proto.PublishedBeforeJoystream} returns this
+ */
+proto.PublishedBeforeJoystream.prototype.clearIsPublished = function() {
+  return jspb.Message.setField(this, 1, undefined);
+};
+
+
+/**
+ * Returns whether this field is set.
+ * @return {boolean}
+ */
+proto.PublishedBeforeJoystream.prototype.hasIsPublished = function() {
+  return jspb.Message.getField(this, 1) != null;
+};
+
+
+/**
+ * optional uint32 timestamp = 2;
+ * @return {number}
+ */
+proto.PublishedBeforeJoystream.prototype.getTimestamp = function() {
+  return /** @type {number} */ (jspb.Message.getFieldWithDefault(this, 2, 0));
+};
+
+
+/**
+ * @param {number} value
+ * @return {!proto.PublishedBeforeJoystream} returns this
+ */
+proto.PublishedBeforeJoystream.prototype.setTimestamp = function(value) {
+  return jspb.Message.setField(this, 2, value);
+};
+
+
+/**
+ * Clears the field making it undefined.
+ * @return {!proto.PublishedBeforeJoystream} returns this
+ */
+proto.PublishedBeforeJoystream.prototype.clearTimestamp = function() {
+  return jspb.Message.setField(this, 2, undefined);
+};
+
+
+/**
+ * Returns whether this field is set.
+ * @return {boolean}
+ */
+proto.PublishedBeforeJoystream.prototype.hasTimestamp = function() {
+  return jspb.Message.getField(this, 2) != null;
+};
+
+
+
+
+
+if (jspb.Message.GENERATE_TO_OBJECT) {
+/**
+ * Creates an object representation of this proto.
+ * Field names that are reserved in JavaScript and will be renamed to pb_name.
+ * Optional fields that are not set will be set to undefined.
+ * To access a reserved field use, foo.pb_<name>, eg, foo.pb_default.
+ * For the list of reserved names please see:
+ *     net/proto2/compiler/js/internal/generator.cc#kKeyword.
+ * @param {boolean=} opt_includeInstance Deprecated. whether to include the
+ *     JSPB instance for transitional soy proto support:
+ *     http://goto/soy-param-migration
+ * @return {!Object}
+ */
+proto.License.prototype.toObject = function(opt_includeInstance) {
+  return proto.License.toObject(opt_includeInstance, this);
+};
+
+
+/**
+ * Static version of the {@see toObject} method.
+ * @param {boolean|undefined} includeInstance Deprecated. Whether to include
+ *     the JSPB instance for transitional soy proto support:
+ *     http://goto/soy-param-migration
+ * @param {!proto.License} msg The msg instance to transform.
+ * @return {!Object}
+ * @suppress {unusedLocalVariables} f is only used for nested messages
+ */
+proto.License.toObject = function(includeInstance, msg) {
+  var f, obj = {
+    code: (f = jspb.Message.getField(msg, 1)) == null ? undefined : f,
+    attribution: (f = jspb.Message.getField(msg, 2)) == null ? undefined : f,
+    customText: (f = jspb.Message.getField(msg, 3)) == null ? undefined : f
+  };
+
+  if (includeInstance) {
+    obj.$jspbMessageInstance = msg;
+  }
+  return obj;
+};
+}
+
+
+/**
+ * Deserializes binary data (in protobuf wire format).
+ * @param {jspb.ByteSource} bytes The bytes to deserialize.
+ * @return {!proto.License}
+ */
+proto.License.deserializeBinary = function(bytes) {
+  var reader = new jspb.BinaryReader(bytes);
+  var msg = new proto.License;
+  return proto.License.deserializeBinaryFromReader(msg, reader);
+};
+
+
+/**
+ * Deserializes binary data (in protobuf wire format) from the
+ * given reader into the given message object.
+ * @param {!proto.License} msg The message object to deserialize into.
+ * @param {!jspb.BinaryReader} reader The BinaryReader to use.
+ * @return {!proto.License}
+ */
+proto.License.deserializeBinaryFromReader = function(msg, reader) {
+  while (reader.nextField()) {
+    if (reader.isEndGroup()) {
+      break;
+    }
+    var field = reader.getFieldNumber();
+    switch (field) {
+    case 1:
+      var value = /** @type {number} */ (reader.readInt32());
+      msg.setCode(value);
+      break;
+    case 2:
+      var value = /** @type {string} */ (reader.readString());
+      msg.setAttribution(value);
+      break;
+    case 3:
+      var value = /** @type {string} */ (reader.readString());
+      msg.setCustomText(value);
+      break;
+    default:
+      reader.skipField();
+      break;
+    }
+  }
+  return msg;
+};
+
+
+/**
+ * Serializes the message to binary data (in protobuf wire format).
+ * @return {!Uint8Array}
+ */
+proto.License.prototype.serializeBinary = function() {
+  var writer = new jspb.BinaryWriter();
+  proto.License.serializeBinaryToWriter(this, writer);
+  return writer.getResultBuffer();
+};
+
+
+/**
+ * Serializes the given message to binary data (in protobuf wire
+ * format), writing to the given BinaryWriter.
+ * @param {!proto.License} message
+ * @param {!jspb.BinaryWriter} writer
+ * @suppress {unusedLocalVariables} f is only used for nested messages
+ */
+proto.License.serializeBinaryToWriter = function(message, writer) {
+  var f = undefined;
+  f = /** @type {number} */ (jspb.Message.getField(message, 1));
+  if (f != null) {
+    writer.writeInt32(
+      1,
+      f
+    );
+  }
+  f = /** @type {string} */ (jspb.Message.getField(message, 2));
+  if (f != null) {
+    writer.writeString(
+      2,
+      f
+    );
+  }
+  f = /** @type {string} */ (jspb.Message.getField(message, 3));
+  if (f != null) {
+    writer.writeString(
+      3,
+      f
+    );
+  }
+};
+
+
+/**
+ * optional int32 code = 1;
+ * @return {number}
+ */
+proto.License.prototype.getCode = function() {
+  return /** @type {number} */ (jspb.Message.getFieldWithDefault(this, 1, 0));
+};
+
+
+/**
+ * @param {number} value
+ * @return {!proto.License} returns this
+ */
+proto.License.prototype.setCode = function(value) {
+  return jspb.Message.setField(this, 1, value);
+};
+
+
+/**
+ * Clears the field making it undefined.
+ * @return {!proto.License} returns this
+ */
+proto.License.prototype.clearCode = function() {
+  return jspb.Message.setField(this, 1, undefined);
+};
+
+
+/**
+ * Returns whether this field is set.
+ * @return {boolean}
+ */
+proto.License.prototype.hasCode = function() {
+  return jspb.Message.getField(this, 1) != null;
+};
+
+
+/**
+ * optional string attribution = 2;
+ * @return {string}
+ */
+proto.License.prototype.getAttribution = function() {
+  return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 2, ""));
+};
+
+
+/**
+ * @param {string} value
+ * @return {!proto.License} returns this
+ */
+proto.License.prototype.setAttribution = function(value) {
+  return jspb.Message.setField(this, 2, value);
+};
+
+
+/**
+ * Clears the field making it undefined.
+ * @return {!proto.License} returns this
+ */
+proto.License.prototype.clearAttribution = function() {
+  return jspb.Message.setField(this, 2, undefined);
+};
+
+
+/**
+ * Returns whether this field is set.
+ * @return {boolean}
+ */
+proto.License.prototype.hasAttribution = function() {
+  return jspb.Message.getField(this, 2) != null;
+};
+
+
+/**
+ * optional string custom_text = 3;
+ * @return {string}
+ */
+proto.License.prototype.getCustomText = function() {
+  return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 3, ""));
+};
+
+
+/**
+ * @param {string} value
+ * @return {!proto.License} returns this
+ */
+proto.License.prototype.setCustomText = function(value) {
+  return jspb.Message.setField(this, 3, value);
+};
+
+
+/**
+ * Clears the field making it undefined.
+ * @return {!proto.License} returns this
+ */
+proto.License.prototype.clearCustomText = function() {
+  return jspb.Message.setField(this, 3, undefined);
+};
+
+
+/**
+ * Returns whether this field is set.
+ * @return {boolean}
+ */
+proto.License.prototype.hasCustomText = function() {
+  return jspb.Message.getField(this, 3) != null;
+};
+
+
+
+
+
+if (jspb.Message.GENERATE_TO_OBJECT) {
+/**
+ * Creates an object representation of this proto.
+ * Field names that are reserved in JavaScript and will be renamed to pb_name.
+ * Optional fields that are not set will be set to undefined.
+ * To access a reserved field use, foo.pb_<name>, eg, foo.pb_default.
+ * For the list of reserved names please see:
+ *     net/proto2/compiler/js/internal/generator.cc#kKeyword.
+ * @param {boolean=} opt_includeInstance Deprecated. whether to include the
+ *     JSPB instance for transitional soy proto support:
+ *     http://goto/soy-param-migration
+ * @return {!Object}
+ */
+proto.MediaType.prototype.toObject = function(opt_includeInstance) {
+  return proto.MediaType.toObject(opt_includeInstance, this);
+};
+
+
+/**
+ * Static version of the {@see toObject} method.
+ * @param {boolean|undefined} includeInstance Deprecated. Whether to include
+ *     the JSPB instance for transitional soy proto support:
+ *     http://goto/soy-param-migration
+ * @param {!proto.MediaType} msg The msg instance to transform.
+ * @return {!Object}
+ * @suppress {unusedLocalVariables} f is only used for nested messages
+ */
+proto.MediaType.toObject = function(includeInstance, msg) {
+  var f, obj = {
+    codecName: (f = jspb.Message.getField(msg, 1)) == null ? undefined : f,
+    container: (f = jspb.Message.getField(msg, 2)) == null ? undefined : f,
+    mimeMediaType: (f = jspb.Message.getField(msg, 3)) == null ? undefined : f
+  };
+
+  if (includeInstance) {
+    obj.$jspbMessageInstance = msg;
+  }
+  return obj;
+};
+}
+
+
+/**
+ * Deserializes binary data (in protobuf wire format).
+ * @param {jspb.ByteSource} bytes The bytes to deserialize.
+ * @return {!proto.MediaType}
+ */
+proto.MediaType.deserializeBinary = function(bytes) {
+  var reader = new jspb.BinaryReader(bytes);
+  var msg = new proto.MediaType;
+  return proto.MediaType.deserializeBinaryFromReader(msg, reader);
+};
+
+
+/**
+ * Deserializes binary data (in protobuf wire format) from the
+ * given reader into the given message object.
+ * @param {!proto.MediaType} msg The message object to deserialize into.
+ * @param {!jspb.BinaryReader} reader The BinaryReader to use.
+ * @return {!proto.MediaType}
+ */
+proto.MediaType.deserializeBinaryFromReader = function(msg, reader) {
+  while (reader.nextField()) {
+    if (reader.isEndGroup()) {
+      break;
+    }
+    var field = reader.getFieldNumber();
+    switch (field) {
+    case 1:
+      var value = /** @type {string} */ (reader.readString());
+      msg.setCodecName(value);
+      break;
+    case 2:
+      var value = /** @type {string} */ (reader.readString());
+      msg.setContainer(value);
+      break;
+    case 3:
+      var value = /** @type {string} */ (reader.readString());
+      msg.setMimeMediaType(value);
+      break;
+    default:
+      reader.skipField();
+      break;
+    }
+  }
+  return msg;
+};
+
+
+/**
+ * Serializes the message to binary data (in protobuf wire format).
+ * @return {!Uint8Array}
+ */
+proto.MediaType.prototype.serializeBinary = function() {
+  var writer = new jspb.BinaryWriter();
+  proto.MediaType.serializeBinaryToWriter(this, writer);
+  return writer.getResultBuffer();
+};
+
+
+/**
+ * Serializes the given message to binary data (in protobuf wire
+ * format), writing to the given BinaryWriter.
+ * @param {!proto.MediaType} message
+ * @param {!jspb.BinaryWriter} writer
+ * @suppress {unusedLocalVariables} f is only used for nested messages
+ */
+proto.MediaType.serializeBinaryToWriter = function(message, writer) {
+  var f = undefined;
+  f = /** @type {string} */ (jspb.Message.getField(message, 1));
+  if (f != null) {
+    writer.writeString(
+      1,
+      f
+    );
+  }
+  f = /** @type {string} */ (jspb.Message.getField(message, 2));
+  if (f != null) {
+    writer.writeString(
+      2,
+      f
+    );
+  }
+  f = /** @type {string} */ (jspb.Message.getField(message, 3));
+  if (f != null) {
+    writer.writeString(
+      3,
+      f
+    );
+  }
+};
+
+
+/**
+ * optional string codec_name = 1;
+ * @return {string}
+ */
+proto.MediaType.prototype.getCodecName = function() {
+  return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 1, ""));
+};
+
+
+/**
+ * @param {string} value
+ * @return {!proto.MediaType} returns this
+ */
+proto.MediaType.prototype.setCodecName = function(value) {
+  return jspb.Message.setField(this, 1, value);
+};
+
+
+/**
+ * Clears the field making it undefined.
+ * @return {!proto.MediaType} returns this
+ */
+proto.MediaType.prototype.clearCodecName = function() {
+  return jspb.Message.setField(this, 1, undefined);
+};
+
+
+/**
+ * Returns whether this field is set.
+ * @return {boolean}
+ */
+proto.MediaType.prototype.hasCodecName = function() {
+  return jspb.Message.getField(this, 1) != null;
+};
+
+
+/**
+ * optional string container = 2;
+ * @return {string}
+ */
+proto.MediaType.prototype.getContainer = function() {
+  return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 2, ""));
+};
+
+
+/**
+ * @param {string} value
+ * @return {!proto.MediaType} returns this
+ */
+proto.MediaType.prototype.setContainer = function(value) {
+  return jspb.Message.setField(this, 2, value);
+};
+
+
+/**
+ * Clears the field making it undefined.
+ * @return {!proto.MediaType} returns this
+ */
+proto.MediaType.prototype.clearContainer = function() {
+  return jspb.Message.setField(this, 2, undefined);
+};
+
+
+/**
+ * Returns whether this field is set.
+ * @return {boolean}
+ */
+proto.MediaType.prototype.hasContainer = function() {
+  return jspb.Message.getField(this, 2) != null;
+};
+
+
+/**
+ * optional string mime_media_type = 3;
+ * @return {string}
+ */
+proto.MediaType.prototype.getMimeMediaType = function() {
+  return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 3, ""));
+};
+
+
+/**
+ * @param {string} value
+ * @return {!proto.MediaType} returns this
+ */
+proto.MediaType.prototype.setMimeMediaType = function(value) {
+  return jspb.Message.setField(this, 3, value);
+};
+
+
+/**
+ * Clears the field making it undefined.
+ * @return {!proto.MediaType} returns this
+ */
+proto.MediaType.prototype.clearMimeMediaType = function() {
+  return jspb.Message.setField(this, 3, undefined);
+};
+
+
+/**
+ * Returns whether this field is set.
+ * @return {boolean}
+ */
+proto.MediaType.prototype.hasMimeMediaType = function() {
+  return jspb.Message.getField(this, 3) != null;
+};
+
+
+
+
+
+if (jspb.Message.GENERATE_TO_OBJECT) {
+/**
+ * Creates an object representation of this proto.
+ * Field names that are reserved in JavaScript and will be renamed to pb_name.
+ * Optional fields that are not set will be set to undefined.
+ * To access a reserved field use, foo.pb_<name>, eg, foo.pb_default.
+ * For the list of reserved names please see:
+ *     net/proto2/compiler/js/internal/generator.cc#kKeyword.
+ * @param {boolean=} opt_includeInstance Deprecated. whether to include the
+ *     JSPB instance for transitional soy proto support:
+ *     http://goto/soy-param-migration
+ * @return {!Object}
+ */
+proto.VideoMetadata.prototype.toObject = function(opt_includeInstance) {
+  return proto.VideoMetadata.toObject(opt_includeInstance, this);
+};
+
+
+/**
+ * Static version of the {@see toObject} method.
+ * @param {boolean|undefined} includeInstance Deprecated. Whether to include
+ *     the JSPB instance for transitional soy proto support:
+ *     http://goto/soy-param-migration
+ * @param {!proto.VideoMetadata} msg The msg instance to transform.
+ * @return {!Object}
+ * @suppress {unusedLocalVariables} f is only used for nested messages
+ */
+proto.VideoMetadata.toObject = function(includeInstance, msg) {
+  var f, obj = {
+    title: (f = jspb.Message.getField(msg, 1)) == null ? undefined : f,
+    description: (f = jspb.Message.getField(msg, 2)) == null ? undefined : f,
+    duration: (f = jspb.Message.getField(msg, 3)) == null ? undefined : f,
+    mediaPixelHeight: (f = jspb.Message.getField(msg, 4)) == null ? undefined : f,
+    mediaPixelWidth: (f = jspb.Message.getField(msg, 5)) == null ? undefined : f,
+    mediaType: (f = msg.getMediaType()) && proto.MediaType.toObject(includeInstance, f),
+    language: (f = jspb.Message.getField(msg, 7)) == null ? undefined : f,
+    license: (f = msg.getLicense()) && proto.License.toObject(includeInstance, f),
+    publishedBeforeJoystream: (f = msg.getPublishedBeforeJoystream()) && proto.PublishedBeforeJoystream.toObject(includeInstance, f),
+    hasMarketing: (f = jspb.Message.getBooleanField(msg, 10)) == null ? undefined : f,
+    isPublic: (f = jspb.Message.getBooleanField(msg, 11)) == null ? undefined : f,
+    isExplicit: (f = jspb.Message.getBooleanField(msg, 12)) == null ? undefined : f
+  };
+
+  if (includeInstance) {
+    obj.$jspbMessageInstance = msg;
+  }
+  return obj;
+};
+}
+
+
+/**
+ * Deserializes binary data (in protobuf wire format).
+ * @param {jspb.ByteSource} bytes The bytes to deserialize.
+ * @return {!proto.VideoMetadata}
+ */
+proto.VideoMetadata.deserializeBinary = function(bytes) {
+  var reader = new jspb.BinaryReader(bytes);
+  var msg = new proto.VideoMetadata;
+  return proto.VideoMetadata.deserializeBinaryFromReader(msg, reader);
+};
+
+
+/**
+ * Deserializes binary data (in protobuf wire format) from the
+ * given reader into the given message object.
+ * @param {!proto.VideoMetadata} msg The message object to deserialize into.
+ * @param {!jspb.BinaryReader} reader The BinaryReader to use.
+ * @return {!proto.VideoMetadata}
+ */
+proto.VideoMetadata.deserializeBinaryFromReader = function(msg, reader) {
+  while (reader.nextField()) {
+    if (reader.isEndGroup()) {
+      break;
+    }
+    var field = reader.getFieldNumber();
+    switch (field) {
+    case 1:
+      var value = /** @type {string} */ (reader.readString());
+      msg.setTitle(value);
+      break;
+    case 2:
+      var value = /** @type {string} */ (reader.readString());
+      msg.setDescription(value);
+      break;
+    case 3:
+      var value = /** @type {number} */ (reader.readInt32());
+      msg.setDuration(value);
+      break;
+    case 4:
+      var value = /** @type {number} */ (reader.readInt32());
+      msg.setMediaPixelHeight(value);
+      break;
+    case 5:
+      var value = /** @type {number} */ (reader.readInt32());
+      msg.setMediaPixelWidth(value);
+      break;
+    case 6:
+      var value = new proto.MediaType;
+      reader.readMessage(value,proto.MediaType.deserializeBinaryFromReader);
+      msg.setMediaType(value);
+      break;
+    case 7:
+      var value = /** @type {string} */ (reader.readString());
+      msg.setLanguage(value);
+      break;
+    case 8:
+      var value = new proto.License;
+      reader.readMessage(value,proto.License.deserializeBinaryFromReader);
+      msg.setLicense(value);
+      break;
+    case 9:
+      var value = new proto.PublishedBeforeJoystream;
+      reader.readMessage(value,proto.PublishedBeforeJoystream.deserializeBinaryFromReader);
+      msg.setPublishedBeforeJoystream(value);
+      break;
+    case 10:
+      var value = /** @type {boolean} */ (reader.readBool());
+      msg.setHasMarketing(value);
+      break;
+    case 11:
+      var value = /** @type {boolean} */ (reader.readBool());
+      msg.setIsPublic(value);
+      break;
+    case 12:
+      var value = /** @type {boolean} */ (reader.readBool());
+      msg.setIsExplicit(value);
+      break;
+    default:
+      reader.skipField();
+      break;
+    }
+  }
+  return msg;
+};
+
+
+/**
+ * Serializes the message to binary data (in protobuf wire format).
+ * @return {!Uint8Array}
+ */
+proto.VideoMetadata.prototype.serializeBinary = function() {
+  var writer = new jspb.BinaryWriter();
+  proto.VideoMetadata.serializeBinaryToWriter(this, writer);
+  return writer.getResultBuffer();
+};
+
+
+/**
+ * Serializes the given message to binary data (in protobuf wire
+ * format), writing to the given BinaryWriter.
+ * @param {!proto.VideoMetadata} message
+ * @param {!jspb.BinaryWriter} writer
+ * @suppress {unusedLocalVariables} f is only used for nested messages
+ */
+proto.VideoMetadata.serializeBinaryToWriter = function(message, writer) {
+  var f = undefined;
+  f = /** @type {string} */ (jspb.Message.getField(message, 1));
+  if (f != null) {
+    writer.writeString(
+      1,
+      f
+    );
+  }
+  f = /** @type {string} */ (jspb.Message.getField(message, 2));
+  if (f != null) {
+    writer.writeString(
+      2,
+      f
+    );
+  }
+  f = /** @type {number} */ (jspb.Message.getField(message, 3));
+  if (f != null) {
+    writer.writeInt32(
+      3,
+      f
+    );
+  }
+  f = /** @type {number} */ (jspb.Message.getField(message, 4));
+  if (f != null) {
+    writer.writeInt32(
+      4,
+      f
+    );
+  }
+  f = /** @type {number} */ (jspb.Message.getField(message, 5));
+  if (f != null) {
+    writer.writeInt32(
+      5,
+      f
+    );
+  }
+  f = message.getMediaType();
+  if (f != null) {
+    writer.writeMessage(
+      6,
+      f,
+      proto.MediaType.serializeBinaryToWriter
+    );
+  }
+  f = /** @type {string} */ (jspb.Message.getField(message, 7));
+  if (f != null) {
+    writer.writeString(
+      7,
+      f
+    );
+  }
+  f = message.getLicense();
+  if (f != null) {
+    writer.writeMessage(
+      8,
+      f,
+      proto.License.serializeBinaryToWriter
+    );
+  }
+  f = message.getPublishedBeforeJoystream();
+  if (f != null) {
+    writer.writeMessage(
+      9,
+      f,
+      proto.PublishedBeforeJoystream.serializeBinaryToWriter
+    );
+  }
+  f = /** @type {boolean} */ (jspb.Message.getField(message, 10));
+  if (f != null) {
+    writer.writeBool(
+      10,
+      f
+    );
+  }
+  f = /** @type {boolean} */ (jspb.Message.getField(message, 11));
+  if (f != null) {
+    writer.writeBool(
+      11,
+      f
+    );
+  }
+  f = /** @type {boolean} */ (jspb.Message.getField(message, 12));
+  if (f != null) {
+    writer.writeBool(
+      12,
+      f
+    );
+  }
+};
+
+
+/**
+ * optional string title = 1;
+ * @return {string}
+ */
+proto.VideoMetadata.prototype.getTitle = function() {
+  return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 1, ""));
+};
+
+
+/**
+ * @param {string} value
+ * @return {!proto.VideoMetadata} returns this
+ */
+proto.VideoMetadata.prototype.setTitle = function(value) {
+  return jspb.Message.setField(this, 1, value);
+};
+
+
+/**
+ * Clears the field making it undefined.
+ * @return {!proto.VideoMetadata} returns this
+ */
+proto.VideoMetadata.prototype.clearTitle = function() {
+  return jspb.Message.setField(this, 1, undefined);
+};
+
+
+/**
+ * Returns whether this field is set.
+ * @return {boolean}
+ */
+proto.VideoMetadata.prototype.hasTitle = function() {
+  return jspb.Message.getField(this, 1) != null;
+};
+
+
+/**
+ * optional string description = 2;
+ * @return {string}
+ */
+proto.VideoMetadata.prototype.getDescription = function() {
+  return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 2, ""));
+};
+
+
+/**
+ * @param {string} value
+ * @return {!proto.VideoMetadata} returns this
+ */
+proto.VideoMetadata.prototype.setDescription = function(value) {
+  return jspb.Message.setField(this, 2, value);
+};
+
+
+/**
+ * Clears the field making it undefined.
+ * @return {!proto.VideoMetadata} returns this
+ */
+proto.VideoMetadata.prototype.clearDescription = function() {
+  return jspb.Message.setField(this, 2, undefined);
+};
+
+
+/**
+ * Returns whether this field is set.
+ * @return {boolean}
+ */
+proto.VideoMetadata.prototype.hasDescription = function() {
+  return jspb.Message.getField(this, 2) != null;
+};
+
+
+/**
+ * optional int32 duration = 3;
+ * @return {number}
+ */
+proto.VideoMetadata.prototype.getDuration = function() {
+  return /** @type {number} */ (jspb.Message.getFieldWithDefault(this, 3, 0));
+};
+
+
+/**
+ * @param {number} value
+ * @return {!proto.VideoMetadata} returns this
+ */
+proto.VideoMetadata.prototype.setDuration = function(value) {
+  return jspb.Message.setField(this, 3, value);
+};
+
+
+/**
+ * Clears the field making it undefined.
+ * @return {!proto.VideoMetadata} returns this
+ */
+proto.VideoMetadata.prototype.clearDuration = function() {
+  return jspb.Message.setField(this, 3, undefined);
+};
+
+
+/**
+ * Returns whether this field is set.
+ * @return {boolean}
+ */
+proto.VideoMetadata.prototype.hasDuration = function() {
+  return jspb.Message.getField(this, 3) != null;
+};
+
+
+/**
+ * optional int32 media_pixel_height = 4;
+ * @return {number}
+ */
+proto.VideoMetadata.prototype.getMediaPixelHeight = function() {
+  return /** @type {number} */ (jspb.Message.getFieldWithDefault(this, 4, 0));
+};
+
+
+/**
+ * @param {number} value
+ * @return {!proto.VideoMetadata} returns this
+ */
+proto.VideoMetadata.prototype.setMediaPixelHeight = function(value) {
+  return jspb.Message.setField(this, 4, value);
+};
+
+
+/**
+ * Clears the field making it undefined.
+ * @return {!proto.VideoMetadata} returns this
+ */
+proto.VideoMetadata.prototype.clearMediaPixelHeight = function() {
+  return jspb.Message.setField(this, 4, undefined);
+};
+
+
+/**
+ * Returns whether this field is set.
+ * @return {boolean}
+ */
+proto.VideoMetadata.prototype.hasMediaPixelHeight = function() {
+  return jspb.Message.getField(this, 4) != null;
+};
+
+
+/**
+ * optional int32 media_pixel_width = 5;
+ * @return {number}
+ */
+proto.VideoMetadata.prototype.getMediaPixelWidth = function() {
+  return /** @type {number} */ (jspb.Message.getFieldWithDefault(this, 5, 0));
+};
+
+
+/**
+ * @param {number} value
+ * @return {!proto.VideoMetadata} returns this
+ */
+proto.VideoMetadata.prototype.setMediaPixelWidth = function(value) {
+  return jspb.Message.setField(this, 5, value);
+};
+
+
+/**
+ * Clears the field making it undefined.
+ * @return {!proto.VideoMetadata} returns this
+ */
+proto.VideoMetadata.prototype.clearMediaPixelWidth = function() {
+  return jspb.Message.setField(this, 5, undefined);
+};
+
+
+/**
+ * Returns whether this field is set.
+ * @return {boolean}
+ */
+proto.VideoMetadata.prototype.hasMediaPixelWidth = function() {
+  return jspb.Message.getField(this, 5) != null;
+};
+
+
+/**
+ * optional MediaType media_type = 6;
+ * @return {?proto.MediaType}
+ */
+proto.VideoMetadata.prototype.getMediaType = function() {
+  return /** @type{?proto.MediaType} */ (
+    jspb.Message.getWrapperField(this, proto.MediaType, 6));
+};
+
+
+/**
+ * @param {?proto.MediaType|undefined} value
+ * @return {!proto.VideoMetadata} returns this
+*/
+proto.VideoMetadata.prototype.setMediaType = function(value) {
+  return jspb.Message.setWrapperField(this, 6, value);
+};
+
+
+/**
+ * Clears the message field making it undefined.
+ * @return {!proto.VideoMetadata} returns this
+ */
+proto.VideoMetadata.prototype.clearMediaType = function() {
+  return this.setMediaType(undefined);
+};
+
+
+/**
+ * Returns whether this field is set.
+ * @return {boolean}
+ */
+proto.VideoMetadata.prototype.hasMediaType = function() {
+  return jspb.Message.getField(this, 6) != null;
+};
+
+
+/**
+ * optional string language = 7;
+ * @return {string}
+ */
+proto.VideoMetadata.prototype.getLanguage = function() {
+  return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 7, ""));
+};
+
+
+/**
+ * @param {string} value
+ * @return {!proto.VideoMetadata} returns this
+ */
+proto.VideoMetadata.prototype.setLanguage = function(value) {
+  return jspb.Message.setField(this, 7, value);
+};
+
+
+/**
+ * Clears the field making it undefined.
+ * @return {!proto.VideoMetadata} returns this
+ */
+proto.VideoMetadata.prototype.clearLanguage = function() {
+  return jspb.Message.setField(this, 7, undefined);
+};
+
+
+/**
+ * Returns whether this field is set.
+ * @return {boolean}
+ */
+proto.VideoMetadata.prototype.hasLanguage = function() {
+  return jspb.Message.getField(this, 7) != null;
+};
+
+
+/**
+ * optional License license = 8;
+ * @return {?proto.License}
+ */
+proto.VideoMetadata.prototype.getLicense = function() {
+  return /** @type{?proto.License} */ (
+    jspb.Message.getWrapperField(this, proto.License, 8));
+};
+
+
+/**
+ * @param {?proto.License|undefined} value
+ * @return {!proto.VideoMetadata} returns this
+*/
+proto.VideoMetadata.prototype.setLicense = function(value) {
+  return jspb.Message.setWrapperField(this, 8, value);
+};
+
+
+/**
+ * Clears the message field making it undefined.
+ * @return {!proto.VideoMetadata} returns this
+ */
+proto.VideoMetadata.prototype.clearLicense = function() {
+  return this.setLicense(undefined);
+};
+
+
+/**
+ * Returns whether this field is set.
+ * @return {boolean}
+ */
+proto.VideoMetadata.prototype.hasLicense = function() {
+  return jspb.Message.getField(this, 8) != null;
+};
+
+
+/**
+ * optional PublishedBeforeJoystream published_before_joystream = 9;
+ * @return {?proto.PublishedBeforeJoystream}
+ */
+proto.VideoMetadata.prototype.getPublishedBeforeJoystream = function() {
+  return /** @type{?proto.PublishedBeforeJoystream} */ (
+    jspb.Message.getWrapperField(this, proto.PublishedBeforeJoystream, 9));
+};
+
+
+/**
+ * @param {?proto.PublishedBeforeJoystream|undefined} value
+ * @return {!proto.VideoMetadata} returns this
+*/
+proto.VideoMetadata.prototype.setPublishedBeforeJoystream = function(value) {
+  return jspb.Message.setWrapperField(this, 9, value);
+};
+
+
+/**
+ * Clears the message field making it undefined.
+ * @return {!proto.VideoMetadata} returns this
+ */
+proto.VideoMetadata.prototype.clearPublishedBeforeJoystream = function() {
+  return this.setPublishedBeforeJoystream(undefined);
+};
+
+
+/**
+ * Returns whether this field is set.
+ * @return {boolean}
+ */
+proto.VideoMetadata.prototype.hasPublishedBeforeJoystream = function() {
+  return jspb.Message.getField(this, 9) != null;
+};
+
+
+/**
+ * optional bool has_marketing = 10;
+ * @return {boolean}
+ */
+proto.VideoMetadata.prototype.getHasMarketing = function() {
+  return /** @type {boolean} */ (jspb.Message.getBooleanFieldWithDefault(this, 10, false));
+};
+
+
+/**
+ * @param {boolean} value
+ * @return {!proto.VideoMetadata} returns this
+ */
+proto.VideoMetadata.prototype.setHasMarketing = function(value) {
+  return jspb.Message.setField(this, 10, value);
+};
+
+
+/**
+ * Clears the field making it undefined.
+ * @return {!proto.VideoMetadata} returns this
+ */
+proto.VideoMetadata.prototype.clearHasMarketing = function() {
+  return jspb.Message.setField(this, 10, undefined);
+};
+
+
+/**
+ * Returns whether this field is set.
+ * @return {boolean}
+ */
+proto.VideoMetadata.prototype.hasHasMarketing = function() {
+  return jspb.Message.getField(this, 10) != null;
+};
+
+
+/**
+ * optional bool is_public = 11;
+ * @return {boolean}
+ */
+proto.VideoMetadata.prototype.getIsPublic = function() {
+  return /** @type {boolean} */ (jspb.Message.getBooleanFieldWithDefault(this, 11, false));
+};
+
+
+/**
+ * @param {boolean} value
+ * @return {!proto.VideoMetadata} returns this
+ */
+proto.VideoMetadata.prototype.setIsPublic = function(value) {
+  return jspb.Message.setField(this, 11, value);
+};
+
+
+/**
+ * Clears the field making it undefined.
+ * @return {!proto.VideoMetadata} returns this
+ */
+proto.VideoMetadata.prototype.clearIsPublic = function() {
+  return jspb.Message.setField(this, 11, undefined);
+};
+
+
+/**
+ * Returns whether this field is set.
+ * @return {boolean}
+ */
+proto.VideoMetadata.prototype.hasIsPublic = function() {
+  return jspb.Message.getField(this, 11) != null;
+};
+
+
+/**
+ * optional bool is_explicit = 12;
+ * @return {boolean}
+ */
+proto.VideoMetadata.prototype.getIsExplicit = function() {
+  return /** @type {boolean} */ (jspb.Message.getBooleanFieldWithDefault(this, 12, false));
+};
+
+
+/**
+ * @param {boolean} value
+ * @return {!proto.VideoMetadata} returns this
+ */
+proto.VideoMetadata.prototype.setIsExplicit = function(value) {
+  return jspb.Message.setField(this, 12, value);
+};
+
+
+/**
+ * Clears the field making it undefined.
+ * @return {!proto.VideoMetadata} returns this
+ */
+proto.VideoMetadata.prototype.clearIsExplicit = function() {
+  return jspb.Message.setField(this, 12, undefined);
+};
+
+
+/**
+ * Returns whether this field is set.
+ * @return {boolean}
+ */
+proto.VideoMetadata.prototype.hasIsExplicit = function() {
+  return jspb.Message.getField(this, 12) != null;
+};
+
+
+goog.object.extend(exports, proto);

+ 18 - 21
content-metadata/doc/index.md

@@ -31,10 +31,10 @@
 
 | Field | Type | Label | Description |
 | ----- | ---- | ----- | ----------- |
-| title | [string](#string) | optional |  |
-| description | [string](#string) | optional |  |
-| is_public | [bool](#bool) | optional |  |
-| language | [int32](#int32) | optional |  |
+| title | [string](#string) | optional | Channel Title |
+| description | [string](#string) | optional | Channel Description |
+| is_public | [bool](#bool) | optional | Wether to display channel to the public |
+| language | [string](#string) | optional | ISO_639-1 Language [Code](https://en.wikipedia.org/wiki/List_of_ISO_639-1_codes) |
 
 
 
@@ -65,7 +65,7 @@ Joystream Specific License type
 
 | Field | Type | Label | Description |
 | ----- | ---- | ----- | ----------- |
-| code | [int32](#int32) | optional | License code defined by Joystream |
+| code | [int32](#int32) | optional | License code defined by Joystream. [reference](../src/KnownLicenses.json) |
 | attribution | [string](#string) | optional | Text for licenses that require an attribution |
 | custom_text | [string](#string) | optional | Text for custom license type |
 
@@ -77,17 +77,14 @@ Joystream Specific License type
 <a name=".MediaType"></a>
 
 ### MediaType
-Rich format description of video media type
-
-enum AVCodecID from FFmpeg: libavcodec/codec_id.h
-optional int32 codec_id = 1;
+Codec, Container, MIME media-type information
 
 
 | Field | Type | Label | Description |
 | ----- | ---- | ----- | ----------- |
 | codec_name | [string](#string) | optional | string name field from FFmpeg libavcodec/codec_desc.c |
-| container | [string](#string) | optional | Video container format (eg. &#39;MP4&#39;, &#39;WebM&#39;, &#39;Ogg&#39; ...) https://developer.mozilla.org/en-US/docs/Web/Media/Formats/Video_codecs |
-| mime_media_type | [string](#string) | optional | MIME Media Type https://www.iana.org/assignments/media-types/media-types.xhtml#video eg. &#39;video/mp4&#39; |
+| container | [string](#string) | optional | Video container format, eg. &#39;MP4&#39;, &#39;WebM&#39;, &#39;Ogg&#39; https://developer.mozilla.org/en-US/docs/Web/Media/Formats/Video_codecs |
+| mime_media_type | [string](#string) | optional | MIME Media Type, eg. &#39;video/mp4&#39; https://www.iana.org/assignments/media-types/media-types.xhtml#video |
 
 
 
@@ -118,18 +115,18 @@ optional int32 codec_id = 1;
 
 | Field | Type | Label | Description |
 | ----- | ---- | ----- | ----------- |
-| title | [string](#string) | optional |  |
-| description | [string](#string) | optional |  |
-| duration | [int32](#int32) | optional | Duration in seconds of the video |
+| title | [string](#string) | optional | Title Text |
+| description | [string](#string) | optional | Video Description |
+| duration | [int32](#int32) | optional | Lengths of video in seconds |
 | media_pixel_height | [int32](#int32) | optional | Resolution of the video |
-| media_pixel_width | [int32](#int32) | optional |  |
-| media_type | [MediaType](#MediaType) | optional | Rich media type information about the media format |
-| language | [string](#string) | optional | ISO_639-1 code: https://en.wikipedia.org/wiki/List_of_ISO_639-1_codes useful: npm package https://www.npmjs.com/package/iso-639-1 |
+| media_pixel_width | [int32](#int32) | optional | Resolution of the video |
+| media_type | [MediaType](#MediaType) | optional | Encoding and Container format used |
+| language | [string](#string) | optional | ISO_639-1 Language [Code](https://en.wikipedia.org/wiki/List_of_ISO_639-1_codes) |
 | license | [License](#License) | optional | License type for the media |
-| published_before_joystream | [PublishedBeforeJoystream](#PublishedBeforeJoystream) | optional |  |
-| has_marketing | [bool](#bool) | optional | Set to true if video has marketing/adverts in the stream |
-| is_public | [bool](#bool) | optional | Set to true if it should be visiable to public |
-| is_explicit | [bool](#bool) | optional | Set to true if video has explicit language or scenes Should this be a curator managed property instead? |
+| published_before_joystream | [PublishedBeforeJoystream](#PublishedBeforeJoystream) | optional | Date of publication of it was published before joystream |
+| has_marketing | [bool](#bool) | optional | Does video have marketing or advertising in the stream |
+| is_public | [bool](#bool) | optional | Should video be publicy visible yet |
+| is_explicit | [bool](#bool) | optional | Does Video have explicit language or scenes |
 
 
 

+ 8 - 1
content-metadata/proto/Channel.proto

@@ -1,8 +1,15 @@
 syntax = "proto2";
 
 message ChannelMetadata {
+    // Channel Title
     optional string title = 1;
+
+    // Channel Description
     optional string description = 2;
+
+    // Wether to display channel to the public
     optional bool is_public = 3;
-    optional int32 language = 4;
+
+    // ISO_639-1 Language [Code](https://en.wikipedia.org/wiki/List_of_ISO_639-1_codes)
+    optional string language = 4;
 }

+ 0 - 44
content-metadata/proto/Channel_pb.d.ts

@@ -1,44 +0,0 @@
-// package:
-// file: proto/Channel.proto
-
-import * as jspb from 'google-protobuf'
-
-export class ChannelMetadata extends jspb.Message {
-  hasTitle(): boolean
-  clearTitle(): void
-  getTitle(): string | undefined
-  setTitle(value: string): void
-
-  hasDescription(): boolean
-  clearDescription(): void
-  getDescription(): string | undefined
-  setDescription(value: string): void
-
-  hasIsPublic(): boolean
-  clearIsPublic(): void
-  getIsPublic(): boolean | undefined
-  setIsPublic(value: boolean): void
-
-  hasLanguage(): boolean
-  clearLanguage(): void
-  getLanguage(): number | undefined
-  setLanguage(value: number): void
-
-  serializeBinary(): Uint8Array
-  toObject(includeInstance?: boolean): ChannelMetadata.AsObject
-  static toObject(includeInstance: boolean, msg: ChannelMetadata): ChannelMetadata.AsObject
-  static extensions: { [key: number]: jspb.ExtensionFieldInfo<jspb.Message> }
-  static extensionsBinary: { [key: number]: jspb.ExtensionFieldBinaryInfo<jspb.Message> }
-  static serializeBinaryToWriter(message: ChannelMetadata, writer: jspb.BinaryWriter): void
-  static deserializeBinary(bytes: Uint8Array): ChannelMetadata
-  static deserializeBinaryFromReader(message: ChannelMetadata, reader: jspb.BinaryReader): ChannelMetadata
-}
-
-export namespace ChannelMetadata {
-  export type AsObject = {
-    title?: string
-    description?: string
-    isPublic?: boolean
-    language?: number
-  }
-}

+ 0 - 296
content-metadata/proto/Channel_pb.js

@@ -1,296 +0,0 @@
-// source: proto/Channel.proto
-/**
- * @fileoverview
- * @enhanceable
- * @suppress {messageConventions} JS Compiler reports an error if a variable or
- *     field starts with 'MSG_' and isn't a translatable message.
- * @public
- */
-// GENERATED CODE -- DO NOT EDIT!
-/* eslint-disable */
-// @ts-nocheck
-
-var jspb = require('google-protobuf')
-var goog = jspb
-var global = Function('return this')()
-
-goog.exportSymbol('proto.ChannelMetadata', null, global)
-/**
- * Generated by JsPbCodeGenerator.
- * @param {Array=} opt_data Optional initial data array, typically from a
- * server response, or constructed directly in Javascript. The array is used
- * in place and becomes part of the constructed object. It is not cloned.
- * If no data is provided, the constructed object will be empty, but still
- * valid.
- * @extends {jspb.Message}
- * @constructor
- */
-proto.ChannelMetadata = function (opt_data) {
-  jspb.Message.initialize(this, opt_data, 0, -1, null, null)
-}
-goog.inherits(proto.ChannelMetadata, jspb.Message)
-if (goog.DEBUG && !COMPILED) {
-  /**
-   * @public
-   * @override
-   */
-  proto.ChannelMetadata.displayName = 'proto.ChannelMetadata'
-}
-
-if (jspb.Message.GENERATE_TO_OBJECT) {
-  /**
-   * Creates an object representation of this proto.
-   * Field names that are reserved in JavaScript and will be renamed to pb_name.
-   * Optional fields that are not set will be set to undefined.
-   * To access a reserved field use, foo.pb_<name>, eg, foo.pb_default.
-   * For the list of reserved names please see:
-   *     net/proto2/compiler/js/internal/generator.cc#kKeyword.
-   * @param {boolean=} opt_includeInstance Deprecated. whether to include the
-   *     JSPB instance for transitional soy proto support:
-   *     http://goto/soy-param-migration
-   * @return {!Object}
-   */
-  proto.ChannelMetadata.prototype.toObject = function (opt_includeInstance) {
-    return proto.ChannelMetadata.toObject(opt_includeInstance, this)
-  }
-
-  /**
-   * Static version of the {@see toObject} method.
-   * @param {boolean|undefined} includeInstance Deprecated. Whether to include
-   *     the JSPB instance for transitional soy proto support:
-   *     http://goto/soy-param-migration
-   * @param {!proto.ChannelMetadata} msg The msg instance to transform.
-   * @return {!Object}
-   * @suppress {unusedLocalVariables} f is only used for nested messages
-   */
-  proto.ChannelMetadata.toObject = function (includeInstance, msg) {
-    var f,
-      obj = {
-        title: (f = jspb.Message.getField(msg, 1)) == null ? undefined : f,
-        description: (f = jspb.Message.getField(msg, 2)) == null ? undefined : f,
-        isPublic: (f = jspb.Message.getBooleanField(msg, 3)) == null ? undefined : f,
-        language: (f = jspb.Message.getField(msg, 4)) == null ? undefined : f,
-      }
-
-    if (includeInstance) {
-      obj.$jspbMessageInstance = msg
-    }
-    return obj
-  }
-}
-
-/**
- * Deserializes binary data (in protobuf wire format).
- * @param {jspb.ByteSource} bytes The bytes to deserialize.
- * @return {!proto.ChannelMetadata}
- */
-proto.ChannelMetadata.deserializeBinary = function (bytes) {
-  var reader = new jspb.BinaryReader(bytes)
-  var msg = new proto.ChannelMetadata()
-  return proto.ChannelMetadata.deserializeBinaryFromReader(msg, reader)
-}
-
-/**
- * Deserializes binary data (in protobuf wire format) from the
- * given reader into the given message object.
- * @param {!proto.ChannelMetadata} msg The message object to deserialize into.
- * @param {!jspb.BinaryReader} reader The BinaryReader to use.
- * @return {!proto.ChannelMetadata}
- */
-proto.ChannelMetadata.deserializeBinaryFromReader = function (msg, reader) {
-  while (reader.nextField()) {
-    if (reader.isEndGroup()) {
-      break
-    }
-    var field = reader.getFieldNumber()
-    switch (field) {
-      case 1:
-        var value = /** @type {string} */ (reader.readString())
-        msg.setTitle(value)
-        break
-      case 2:
-        var value = /** @type {string} */ (reader.readString())
-        msg.setDescription(value)
-        break
-      case 3:
-        var value = /** @type {boolean} */ (reader.readBool())
-        msg.setIsPublic(value)
-        break
-      case 4:
-        var value = /** @type {number} */ (reader.readInt32())
-        msg.setLanguage(value)
-        break
-      default:
-        reader.skipField()
-        break
-    }
-  }
-  return msg
-}
-
-/**
- * Serializes the message to binary data (in protobuf wire format).
- * @return {!Uint8Array}
- */
-proto.ChannelMetadata.prototype.serializeBinary = function () {
-  var writer = new jspb.BinaryWriter()
-  proto.ChannelMetadata.serializeBinaryToWriter(this, writer)
-  return writer.getResultBuffer()
-}
-
-/**
- * Serializes the given message to binary data (in protobuf wire
- * format), writing to the given BinaryWriter.
- * @param {!proto.ChannelMetadata} message
- * @param {!jspb.BinaryWriter} writer
- * @suppress {unusedLocalVariables} f is only used for nested messages
- */
-proto.ChannelMetadata.serializeBinaryToWriter = function (message, writer) {
-  var f = undefined
-  f = /** @type {string} */ (jspb.Message.getField(message, 1))
-  if (f != null) {
-    writer.writeString(1, f)
-  }
-  f = /** @type {string} */ (jspb.Message.getField(message, 2))
-  if (f != null) {
-    writer.writeString(2, f)
-  }
-  f = /** @type {boolean} */ (jspb.Message.getField(message, 3))
-  if (f != null) {
-    writer.writeBool(3, f)
-  }
-  f = /** @type {number} */ (jspb.Message.getField(message, 4))
-  if (f != null) {
-    writer.writeInt32(4, f)
-  }
-}
-
-/**
- * optional string title = 1;
- * @return {string}
- */
-proto.ChannelMetadata.prototype.getTitle = function () {
-  return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 1, ''))
-}
-
-/**
- * @param {string} value
- * @return {!proto.ChannelMetadata} returns this
- */
-proto.ChannelMetadata.prototype.setTitle = function (value) {
-  return jspb.Message.setField(this, 1, value)
-}
-
-/**
- * Clears the field making it undefined.
- * @return {!proto.ChannelMetadata} returns this
- */
-proto.ChannelMetadata.prototype.clearTitle = function () {
-  return jspb.Message.setField(this, 1, undefined)
-}
-
-/**
- * Returns whether this field is set.
- * @return {boolean}
- */
-proto.ChannelMetadata.prototype.hasTitle = function () {
-  return jspb.Message.getField(this, 1) != null
-}
-
-/**
- * optional string description = 2;
- * @return {string}
- */
-proto.ChannelMetadata.prototype.getDescription = function () {
-  return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 2, ''))
-}
-
-/**
- * @param {string} value
- * @return {!proto.ChannelMetadata} returns this
- */
-proto.ChannelMetadata.prototype.setDescription = function (value) {
-  return jspb.Message.setField(this, 2, value)
-}
-
-/**
- * Clears the field making it undefined.
- * @return {!proto.ChannelMetadata} returns this
- */
-proto.ChannelMetadata.prototype.clearDescription = function () {
-  return jspb.Message.setField(this, 2, undefined)
-}
-
-/**
- * Returns whether this field is set.
- * @return {boolean}
- */
-proto.ChannelMetadata.prototype.hasDescription = function () {
-  return jspb.Message.getField(this, 2) != null
-}
-
-/**
- * optional bool is_public = 3;
- * @return {boolean}
- */
-proto.ChannelMetadata.prototype.getIsPublic = function () {
-  return /** @type {boolean} */ (jspb.Message.getBooleanFieldWithDefault(this, 3, false))
-}
-
-/**
- * @param {boolean} value
- * @return {!proto.ChannelMetadata} returns this
- */
-proto.ChannelMetadata.prototype.setIsPublic = function (value) {
-  return jspb.Message.setField(this, 3, value)
-}
-
-/**
- * Clears the field making it undefined.
- * @return {!proto.ChannelMetadata} returns this
- */
-proto.ChannelMetadata.prototype.clearIsPublic = function () {
-  return jspb.Message.setField(this, 3, undefined)
-}
-
-/**
- * Returns whether this field is set.
- * @return {boolean}
- */
-proto.ChannelMetadata.prototype.hasIsPublic = function () {
-  return jspb.Message.getField(this, 3) != null
-}
-
-/**
- * optional int32 language = 4;
- * @return {number}
- */
-proto.ChannelMetadata.prototype.getLanguage = function () {
-  return /** @type {number} */ (jspb.Message.getFieldWithDefault(this, 4, 0))
-}
-
-/**
- * @param {number} value
- * @return {!proto.ChannelMetadata} returns this
- */
-proto.ChannelMetadata.prototype.setLanguage = function (value) {
-  return jspb.Message.setField(this, 4, value)
-}
-
-/**
- * Clears the field making it undefined.
- * @return {!proto.ChannelMetadata} returns this
- */
-proto.ChannelMetadata.prototype.clearLanguage = function () {
-  return jspb.Message.setField(this, 4, undefined)
-}
-
-/**
- * Returns whether this field is set.
- * @return {boolean}
- */
-proto.ChannelMetadata.prototype.hasLanguage = function () {
-  return jspb.Message.getField(this, 4) != null
-}
-
-goog.object.extend(exports, proto)

+ 15 - 21
content-metadata/proto/Video.proto

@@ -1,8 +1,3 @@
-// required/optional feilds are deprecated in proto v3
-// https://www.ben-morris.com/handling-protocol-buffers-backwards-compatibility-between-versions-2-and-3-using-c/
-// For our usecase we wish to re-use same message to create and update 
-// subset of fields. For this reason we need the explicit information
-// about wether a field has been set or not and this is only possible with proto v2.
 syntax = "proto2";
 
 message PublishedBeforeJoystream {
@@ -12,7 +7,7 @@ message PublishedBeforeJoystream {
 
 // Joystream Specific License type
 message License {
-    // License code defined by Joystream
+    // License code defined by Joystream. [reference](../src/KnownLicenses.json)
     optional int32 code = 1;
     // Text for licenses that require an attribution
     optional string attribution = 2;
@@ -20,55 +15,54 @@ message License {
     optional string custom_text = 3;
 }
 
-// Rich format description of video media type
+// Codec, Container, MIME media-type information
 message MediaType {
-    // enum AVCodecID from FFmpeg: libavcodec/codec_id.h
-    // optional int32 codec_id = 1;
-
     // string name field from FFmpeg libavcodec/codec_desc.c
     optional string codec_name = 1;
 
-    // Video container format (eg. 'MP4', 'WebM', 'Ogg' ...)
+    // Video container format, eg. 'MP4', 'WebM', 'Ogg'
     // https://developer.mozilla.org/en-US/docs/Web/Media/Formats/Video_codecs
     optional string container = 2;
 
-    // MIME Media Type
+    // MIME Media Type, eg. 'video/mp4'
     // https://www.iana.org/assignments/media-types/media-types.xhtml#video
-    // eg. 'video/mp4'
     optional string mime_media_type = 3;
 }
 
 message VideoMetadata {
+    // Title Text
     optional string title = 1;
 
+    // Video Description
     optional string description = 2;
 
-    // Duration in seconds of the video
+    // Lengths of video in seconds
     optional int32 duration = 3;
 
     // Resolution of the video
     optional int32 media_pixel_height = 4;
+    
+    // Resolution of the video
     optional int32 media_pixel_width = 5;
 
-    // Rich media type information about the media format
+    // Encoding and Container format used
     optional MediaType media_type = 6;
 
-    // ISO_639-1 code: https://en.wikipedia.org/wiki/List_of_ISO_639-1_codes
-    // useful: npm package https://www.npmjs.com/package/iso-639-1
+    // ISO_639-1 Language [Code](https://en.wikipedia.org/wiki/List_of_ISO_639-1_codes)
     optional string language = 7;
 
     // License type for the media
     optional License license = 8;
 
+    // Date of publication of it was published before joystream
     optional PublishedBeforeJoystream published_before_joystream = 9;
 
-    // Set to true if video has marketing/adverts in the stream
+    // Does video have marketing or advertising in the stream
     optional bool has_marketing = 10;
 
-    // Set to true if it should be visiable to public
+    // Should video be publicy visible yet
     optional bool is_public = 11;
 
-    // Set to true if video has explicit language or scenes
-    // Should this be a curator managed property instead?
+    // Does Video have explicit language or scenes
     optional bool is_explicit = 12;
 }

+ 0 - 191
content-metadata/proto/Video_pb.d.ts

@@ -1,191 +0,0 @@
-// package:
-// file: proto/Video.proto
-
-import * as jspb from 'google-protobuf'
-
-export class PublishedBeforeJoystream extends jspb.Message {
-  hasIsPublished(): boolean
-  clearIsPublished(): void
-  getIsPublished(): boolean | undefined
-  setIsPublished(value: boolean): void
-
-  hasTimestamp(): boolean
-  clearTimestamp(): void
-  getTimestamp(): number | undefined
-  setTimestamp(value: number): void
-
-  serializeBinary(): Uint8Array
-  toObject(includeInstance?: boolean): PublishedBeforeJoystream.AsObject
-  static toObject(includeInstance: boolean, msg: PublishedBeforeJoystream): PublishedBeforeJoystream.AsObject
-  static extensions: { [key: number]: jspb.ExtensionFieldInfo<jspb.Message> }
-  static extensionsBinary: { [key: number]: jspb.ExtensionFieldBinaryInfo<jspb.Message> }
-  static serializeBinaryToWriter(message: PublishedBeforeJoystream, writer: jspb.BinaryWriter): void
-  static deserializeBinary(bytes: Uint8Array): PublishedBeforeJoystream
-  static deserializeBinaryFromReader(
-    message: PublishedBeforeJoystream,
-    reader: jspb.BinaryReader
-  ): PublishedBeforeJoystream
-}
-
-export namespace PublishedBeforeJoystream {
-  export type AsObject = {
-    isPublished?: boolean
-    timestamp?: number
-  }
-}
-
-export class License extends jspb.Message {
-  hasCode(): boolean
-  clearCode(): void
-  getCode(): number | undefined
-  setCode(value: number): void
-
-  hasAttribution(): boolean
-  clearAttribution(): void
-  getAttribution(): string | undefined
-  setAttribution(value: string): void
-
-  hasCustomText(): boolean
-  clearCustomText(): void
-  getCustomText(): string | undefined
-  setCustomText(value: string): void
-
-  serializeBinary(): Uint8Array
-  toObject(includeInstance?: boolean): License.AsObject
-  static toObject(includeInstance: boolean, msg: License): License.AsObject
-  static extensions: { [key: number]: jspb.ExtensionFieldInfo<jspb.Message> }
-  static extensionsBinary: { [key: number]: jspb.ExtensionFieldBinaryInfo<jspb.Message> }
-  static serializeBinaryToWriter(message: License, writer: jspb.BinaryWriter): void
-  static deserializeBinary(bytes: Uint8Array): License
-  static deserializeBinaryFromReader(message: License, reader: jspb.BinaryReader): License
-}
-
-export namespace License {
-  export type AsObject = {
-    code?: number
-    attribution?: string
-    customText?: string
-  }
-}
-
-export class MediaType extends jspb.Message {
-  hasCodecName(): boolean
-  clearCodecName(): void
-  getCodecName(): string | undefined
-  setCodecName(value: string): void
-
-  hasContainer(): boolean
-  clearContainer(): void
-  getContainer(): string | undefined
-  setContainer(value: string): void
-
-  hasMimeMediaType(): boolean
-  clearMimeMediaType(): void
-  getMimeMediaType(): string | undefined
-  setMimeMediaType(value: string): void
-
-  serializeBinary(): Uint8Array
-  toObject(includeInstance?: boolean): MediaType.AsObject
-  static toObject(includeInstance: boolean, msg: MediaType): MediaType.AsObject
-  static extensions: { [key: number]: jspb.ExtensionFieldInfo<jspb.Message> }
-  static extensionsBinary: { [key: number]: jspb.ExtensionFieldBinaryInfo<jspb.Message> }
-  static serializeBinaryToWriter(message: MediaType, writer: jspb.BinaryWriter): void
-  static deserializeBinary(bytes: Uint8Array): MediaType
-  static deserializeBinaryFromReader(message: MediaType, reader: jspb.BinaryReader): MediaType
-}
-
-export namespace MediaType {
-  export type AsObject = {
-    codecName?: string
-    container?: string
-    mimeMediaType?: string
-  }
-}
-
-export class VideoMetadata extends jspb.Message {
-  hasTitle(): boolean
-  clearTitle(): void
-  getTitle(): string | undefined
-  setTitle(value: string): void
-
-  hasDescription(): boolean
-  clearDescription(): void
-  getDescription(): string | undefined
-  setDescription(value: string): void
-
-  hasDuration(): boolean
-  clearDuration(): void
-  getDuration(): number | undefined
-  setDuration(value: number): void
-
-  hasMediaPixelHeight(): boolean
-  clearMediaPixelHeight(): void
-  getMediaPixelHeight(): number | undefined
-  setMediaPixelHeight(value: number): void
-
-  hasMediaPixelWidth(): boolean
-  clearMediaPixelWidth(): void
-  getMediaPixelWidth(): number | undefined
-  setMediaPixelWidth(value: number): void
-
-  hasMediaType(): boolean
-  clearMediaType(): void
-  getMediaType(): MediaType | undefined
-  setMediaType(value?: MediaType): void
-
-  hasLanguage(): boolean
-  clearLanguage(): void
-  getLanguage(): string | undefined
-  setLanguage(value: string): void
-
-  hasLicense(): boolean
-  clearLicense(): void
-  getLicense(): License | undefined
-  setLicense(value?: License): void
-
-  hasPublishedBeforeJoystream(): boolean
-  clearPublishedBeforeJoystream(): void
-  getPublishedBeforeJoystream(): PublishedBeforeJoystream | undefined
-  setPublishedBeforeJoystream(value?: PublishedBeforeJoystream): void
-
-  hasHasMarketing(): boolean
-  clearHasMarketing(): void
-  getHasMarketing(): boolean | undefined
-  setHasMarketing(value: boolean): void
-
-  hasIsPublic(): boolean
-  clearIsPublic(): void
-  getIsPublic(): boolean | undefined
-  setIsPublic(value: boolean): void
-
-  hasIsExplicit(): boolean
-  clearIsExplicit(): void
-  getIsExplicit(): boolean | undefined
-  setIsExplicit(value: boolean): void
-
-  serializeBinary(): Uint8Array
-  toObject(includeInstance?: boolean): VideoMetadata.AsObject
-  static toObject(includeInstance: boolean, msg: VideoMetadata): VideoMetadata.AsObject
-  static extensions: { [key: number]: jspb.ExtensionFieldInfo<jspb.Message> }
-  static extensionsBinary: { [key: number]: jspb.ExtensionFieldBinaryInfo<jspb.Message> }
-  static serializeBinaryToWriter(message: VideoMetadata, writer: jspb.BinaryWriter): void
-  static deserializeBinary(bytes: Uint8Array): VideoMetadata
-  static deserializeBinaryFromReader(message: VideoMetadata, reader: jspb.BinaryReader): VideoMetadata
-}
-
-export namespace VideoMetadata {
-  export type AsObject = {
-    title?: string
-    description?: string
-    duration?: number
-    mediaPixelHeight?: number
-    mediaPixelWidth?: number
-    mediaType?: MediaType.AsObject
-    language?: string
-    license?: License.AsObject
-    publishedBeforeJoystream?: PublishedBeforeJoystream.AsObject
-    hasMarketing?: boolean
-    isPublic?: boolean
-    isExplicit?: boolean
-  }
-}

+ 0 - 1302
content-metadata/proto/Video_pb.js

@@ -1,1302 +0,0 @@
-// source: proto/Video.proto
-/**
- * @fileoverview
- * @enhanceable
- * @suppress {messageConventions} JS Compiler reports an error if a variable or
- *     field starts with 'MSG_' and isn't a translatable message.
- * @public
- */
-// GENERATED CODE -- DO NOT EDIT!
-/* eslint-disable */
-// @ts-nocheck
-
-var jspb = require('google-protobuf')
-var goog = jspb
-var global = Function('return this')()
-
-goog.exportSymbol('proto.License', null, global)
-goog.exportSymbol('proto.MediaType', null, global)
-goog.exportSymbol('proto.PublishedBeforeJoystream', null, global)
-goog.exportSymbol('proto.VideoMetadata', null, global)
-/**
- * Generated by JsPbCodeGenerator.
- * @param {Array=} opt_data Optional initial data array, typically from a
- * server response, or constructed directly in Javascript. The array is used
- * in place and becomes part of the constructed object. It is not cloned.
- * If no data is provided, the constructed object will be empty, but still
- * valid.
- * @extends {jspb.Message}
- * @constructor
- */
-proto.PublishedBeforeJoystream = function (opt_data) {
-  jspb.Message.initialize(this, opt_data, 0, -1, null, null)
-}
-goog.inherits(proto.PublishedBeforeJoystream, jspb.Message)
-if (goog.DEBUG && !COMPILED) {
-  /**
-   * @public
-   * @override
-   */
-  proto.PublishedBeforeJoystream.displayName = 'proto.PublishedBeforeJoystream'
-}
-/**
- * Generated by JsPbCodeGenerator.
- * @param {Array=} opt_data Optional initial data array, typically from a
- * server response, or constructed directly in Javascript. The array is used
- * in place and becomes part of the constructed object. It is not cloned.
- * If no data is provided, the constructed object will be empty, but still
- * valid.
- * @extends {jspb.Message}
- * @constructor
- */
-proto.License = function (opt_data) {
-  jspb.Message.initialize(this, opt_data, 0, -1, null, null)
-}
-goog.inherits(proto.License, jspb.Message)
-if (goog.DEBUG && !COMPILED) {
-  /**
-   * @public
-   * @override
-   */
-  proto.License.displayName = 'proto.License'
-}
-/**
- * Generated by JsPbCodeGenerator.
- * @param {Array=} opt_data Optional initial data array, typically from a
- * server response, or constructed directly in Javascript. The array is used
- * in place and becomes part of the constructed object. It is not cloned.
- * If no data is provided, the constructed object will be empty, but still
- * valid.
- * @extends {jspb.Message}
- * @constructor
- */
-proto.MediaType = function (opt_data) {
-  jspb.Message.initialize(this, opt_data, 0, -1, null, null)
-}
-goog.inherits(proto.MediaType, jspb.Message)
-if (goog.DEBUG && !COMPILED) {
-  /**
-   * @public
-   * @override
-   */
-  proto.MediaType.displayName = 'proto.MediaType'
-}
-/**
- * Generated by JsPbCodeGenerator.
- * @param {Array=} opt_data Optional initial data array, typically from a
- * server response, or constructed directly in Javascript. The array is used
- * in place and becomes part of the constructed object. It is not cloned.
- * If no data is provided, the constructed object will be empty, but still
- * valid.
- * @extends {jspb.Message}
- * @constructor
- */
-proto.VideoMetadata = function (opt_data) {
-  jspb.Message.initialize(this, opt_data, 0, -1, null, null)
-}
-goog.inherits(proto.VideoMetadata, jspb.Message)
-if (goog.DEBUG && !COMPILED) {
-  /**
-   * @public
-   * @override
-   */
-  proto.VideoMetadata.displayName = 'proto.VideoMetadata'
-}
-
-if (jspb.Message.GENERATE_TO_OBJECT) {
-  /**
-   * Creates an object representation of this proto.
-   * Field names that are reserved in JavaScript and will be renamed to pb_name.
-   * Optional fields that are not set will be set to undefined.
-   * To access a reserved field use, foo.pb_<name>, eg, foo.pb_default.
-   * For the list of reserved names please see:
-   *     net/proto2/compiler/js/internal/generator.cc#kKeyword.
-   * @param {boolean=} opt_includeInstance Deprecated. whether to include the
-   *     JSPB instance for transitional soy proto support:
-   *     http://goto/soy-param-migration
-   * @return {!Object}
-   */
-  proto.PublishedBeforeJoystream.prototype.toObject = function (opt_includeInstance) {
-    return proto.PublishedBeforeJoystream.toObject(opt_includeInstance, this)
-  }
-
-  /**
-   * Static version of the {@see toObject} method.
-   * @param {boolean|undefined} includeInstance Deprecated. Whether to include
-   *     the JSPB instance for transitional soy proto support:
-   *     http://goto/soy-param-migration
-   * @param {!proto.PublishedBeforeJoystream} msg The msg instance to transform.
-   * @return {!Object}
-   * @suppress {unusedLocalVariables} f is only used for nested messages
-   */
-  proto.PublishedBeforeJoystream.toObject = function (includeInstance, msg) {
-    var f,
-      obj = {
-        isPublished: (f = jspb.Message.getBooleanField(msg, 1)) == null ? undefined : f,
-        timestamp: (f = jspb.Message.getField(msg, 2)) == null ? undefined : f,
-      }
-
-    if (includeInstance) {
-      obj.$jspbMessageInstance = msg
-    }
-    return obj
-  }
-}
-
-/**
- * Deserializes binary data (in protobuf wire format).
- * @param {jspb.ByteSource} bytes The bytes to deserialize.
- * @return {!proto.PublishedBeforeJoystream}
- */
-proto.PublishedBeforeJoystream.deserializeBinary = function (bytes) {
-  var reader = new jspb.BinaryReader(bytes)
-  var msg = new proto.PublishedBeforeJoystream()
-  return proto.PublishedBeforeJoystream.deserializeBinaryFromReader(msg, reader)
-}
-
-/**
- * Deserializes binary data (in protobuf wire format) from the
- * given reader into the given message object.
- * @param {!proto.PublishedBeforeJoystream} msg The message object to deserialize into.
- * @param {!jspb.BinaryReader} reader The BinaryReader to use.
- * @return {!proto.PublishedBeforeJoystream}
- */
-proto.PublishedBeforeJoystream.deserializeBinaryFromReader = function (msg, reader) {
-  while (reader.nextField()) {
-    if (reader.isEndGroup()) {
-      break
-    }
-    var field = reader.getFieldNumber()
-    switch (field) {
-      case 1:
-        var value = /** @type {boolean} */ (reader.readBool())
-        msg.setIsPublished(value)
-        break
-      case 2:
-        var value = /** @type {number} */ (reader.readUint32())
-        msg.setTimestamp(value)
-        break
-      default:
-        reader.skipField()
-        break
-    }
-  }
-  return msg
-}
-
-/**
- * Serializes the message to binary data (in protobuf wire format).
- * @return {!Uint8Array}
- */
-proto.PublishedBeforeJoystream.prototype.serializeBinary = function () {
-  var writer = new jspb.BinaryWriter()
-  proto.PublishedBeforeJoystream.serializeBinaryToWriter(this, writer)
-  return writer.getResultBuffer()
-}
-
-/**
- * Serializes the given message to binary data (in protobuf wire
- * format), writing to the given BinaryWriter.
- * @param {!proto.PublishedBeforeJoystream} message
- * @param {!jspb.BinaryWriter} writer
- * @suppress {unusedLocalVariables} f is only used for nested messages
- */
-proto.PublishedBeforeJoystream.serializeBinaryToWriter = function (message, writer) {
-  var f = undefined
-  f = /** @type {boolean} */ (jspb.Message.getField(message, 1))
-  if (f != null) {
-    writer.writeBool(1, f)
-  }
-  f = /** @type {number} */ (jspb.Message.getField(message, 2))
-  if (f != null) {
-    writer.writeUint32(2, f)
-  }
-}
-
-/**
- * optional bool is_published = 1;
- * @return {boolean}
- */
-proto.PublishedBeforeJoystream.prototype.getIsPublished = function () {
-  return /** @type {boolean} */ (jspb.Message.getBooleanFieldWithDefault(this, 1, false))
-}
-
-/**
- * @param {boolean} value
- * @return {!proto.PublishedBeforeJoystream} returns this
- */
-proto.PublishedBeforeJoystream.prototype.setIsPublished = function (value) {
-  return jspb.Message.setField(this, 1, value)
-}
-
-/**
- * Clears the field making it undefined.
- * @return {!proto.PublishedBeforeJoystream} returns this
- */
-proto.PublishedBeforeJoystream.prototype.clearIsPublished = function () {
-  return jspb.Message.setField(this, 1, undefined)
-}
-
-/**
- * Returns whether this field is set.
- * @return {boolean}
- */
-proto.PublishedBeforeJoystream.prototype.hasIsPublished = function () {
-  return jspb.Message.getField(this, 1) != null
-}
-
-/**
- * optional uint32 timestamp = 2;
- * @return {number}
- */
-proto.PublishedBeforeJoystream.prototype.getTimestamp = function () {
-  return /** @type {number} */ (jspb.Message.getFieldWithDefault(this, 2, 0))
-}
-
-/**
- * @param {number} value
- * @return {!proto.PublishedBeforeJoystream} returns this
- */
-proto.PublishedBeforeJoystream.prototype.setTimestamp = function (value) {
-  return jspb.Message.setField(this, 2, value)
-}
-
-/**
- * Clears the field making it undefined.
- * @return {!proto.PublishedBeforeJoystream} returns this
- */
-proto.PublishedBeforeJoystream.prototype.clearTimestamp = function () {
-  return jspb.Message.setField(this, 2, undefined)
-}
-
-/**
- * Returns whether this field is set.
- * @return {boolean}
- */
-proto.PublishedBeforeJoystream.prototype.hasTimestamp = function () {
-  return jspb.Message.getField(this, 2) != null
-}
-
-if (jspb.Message.GENERATE_TO_OBJECT) {
-  /**
-   * Creates an object representation of this proto.
-   * Field names that are reserved in JavaScript and will be renamed to pb_name.
-   * Optional fields that are not set will be set to undefined.
-   * To access a reserved field use, foo.pb_<name>, eg, foo.pb_default.
-   * For the list of reserved names please see:
-   *     net/proto2/compiler/js/internal/generator.cc#kKeyword.
-   * @param {boolean=} opt_includeInstance Deprecated. whether to include the
-   *     JSPB instance for transitional soy proto support:
-   *     http://goto/soy-param-migration
-   * @return {!Object}
-   */
-  proto.License.prototype.toObject = function (opt_includeInstance) {
-    return proto.License.toObject(opt_includeInstance, this)
-  }
-
-  /**
-   * Static version of the {@see toObject} method.
-   * @param {boolean|undefined} includeInstance Deprecated. Whether to include
-   *     the JSPB instance for transitional soy proto support:
-   *     http://goto/soy-param-migration
-   * @param {!proto.License} msg The msg instance to transform.
-   * @return {!Object}
-   * @suppress {unusedLocalVariables} f is only used for nested messages
-   */
-  proto.License.toObject = function (includeInstance, msg) {
-    var f,
-      obj = {
-        code: (f = jspb.Message.getField(msg, 1)) == null ? undefined : f,
-        attribution: (f = jspb.Message.getField(msg, 2)) == null ? undefined : f,
-        customText: (f = jspb.Message.getField(msg, 3)) == null ? undefined : f,
-      }
-
-    if (includeInstance) {
-      obj.$jspbMessageInstance = msg
-    }
-    return obj
-  }
-}
-
-/**
- * Deserializes binary data (in protobuf wire format).
- * @param {jspb.ByteSource} bytes The bytes to deserialize.
- * @return {!proto.License}
- */
-proto.License.deserializeBinary = function (bytes) {
-  var reader = new jspb.BinaryReader(bytes)
-  var msg = new proto.License()
-  return proto.License.deserializeBinaryFromReader(msg, reader)
-}
-
-/**
- * Deserializes binary data (in protobuf wire format) from the
- * given reader into the given message object.
- * @param {!proto.License} msg The message object to deserialize into.
- * @param {!jspb.BinaryReader} reader The BinaryReader to use.
- * @return {!proto.License}
- */
-proto.License.deserializeBinaryFromReader = function (msg, reader) {
-  while (reader.nextField()) {
-    if (reader.isEndGroup()) {
-      break
-    }
-    var field = reader.getFieldNumber()
-    switch (field) {
-      case 1:
-        var value = /** @type {number} */ (reader.readInt32())
-        msg.setCode(value)
-        break
-      case 2:
-        var value = /** @type {string} */ (reader.readString())
-        msg.setAttribution(value)
-        break
-      case 3:
-        var value = /** @type {string} */ (reader.readString())
-        msg.setCustomText(value)
-        break
-      default:
-        reader.skipField()
-        break
-    }
-  }
-  return msg
-}
-
-/**
- * Serializes the message to binary data (in protobuf wire format).
- * @return {!Uint8Array}
- */
-proto.License.prototype.serializeBinary = function () {
-  var writer = new jspb.BinaryWriter()
-  proto.License.serializeBinaryToWriter(this, writer)
-  return writer.getResultBuffer()
-}
-
-/**
- * Serializes the given message to binary data (in protobuf wire
- * format), writing to the given BinaryWriter.
- * @param {!proto.License} message
- * @param {!jspb.BinaryWriter} writer
- * @suppress {unusedLocalVariables} f is only used for nested messages
- */
-proto.License.serializeBinaryToWriter = function (message, writer) {
-  var f = undefined
-  f = /** @type {number} */ (jspb.Message.getField(message, 1))
-  if (f != null) {
-    writer.writeInt32(1, f)
-  }
-  f = /** @type {string} */ (jspb.Message.getField(message, 2))
-  if (f != null) {
-    writer.writeString(2, f)
-  }
-  f = /** @type {string} */ (jspb.Message.getField(message, 3))
-  if (f != null) {
-    writer.writeString(3, f)
-  }
-}
-
-/**
- * optional int32 code = 1;
- * @return {number}
- */
-proto.License.prototype.getCode = function () {
-  return /** @type {number} */ (jspb.Message.getFieldWithDefault(this, 1, 0))
-}
-
-/**
- * @param {number} value
- * @return {!proto.License} returns this
- */
-proto.License.prototype.setCode = function (value) {
-  return jspb.Message.setField(this, 1, value)
-}
-
-/**
- * Clears the field making it undefined.
- * @return {!proto.License} returns this
- */
-proto.License.prototype.clearCode = function () {
-  return jspb.Message.setField(this, 1, undefined)
-}
-
-/**
- * Returns whether this field is set.
- * @return {boolean}
- */
-proto.License.prototype.hasCode = function () {
-  return jspb.Message.getField(this, 1) != null
-}
-
-/**
- * optional string attribution = 2;
- * @return {string}
- */
-proto.License.prototype.getAttribution = function () {
-  return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 2, ''))
-}
-
-/**
- * @param {string} value
- * @return {!proto.License} returns this
- */
-proto.License.prototype.setAttribution = function (value) {
-  return jspb.Message.setField(this, 2, value)
-}
-
-/**
- * Clears the field making it undefined.
- * @return {!proto.License} returns this
- */
-proto.License.prototype.clearAttribution = function () {
-  return jspb.Message.setField(this, 2, undefined)
-}
-
-/**
- * Returns whether this field is set.
- * @return {boolean}
- */
-proto.License.prototype.hasAttribution = function () {
-  return jspb.Message.getField(this, 2) != null
-}
-
-/**
- * optional string custom_text = 3;
- * @return {string}
- */
-proto.License.prototype.getCustomText = function () {
-  return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 3, ''))
-}
-
-/**
- * @param {string} value
- * @return {!proto.License} returns this
- */
-proto.License.prototype.setCustomText = function (value) {
-  return jspb.Message.setField(this, 3, value)
-}
-
-/**
- * Clears the field making it undefined.
- * @return {!proto.License} returns this
- */
-proto.License.prototype.clearCustomText = function () {
-  return jspb.Message.setField(this, 3, undefined)
-}
-
-/**
- * Returns whether this field is set.
- * @return {boolean}
- */
-proto.License.prototype.hasCustomText = function () {
-  return jspb.Message.getField(this, 3) != null
-}
-
-if (jspb.Message.GENERATE_TO_OBJECT) {
-  /**
-   * Creates an object representation of this proto.
-   * Field names that are reserved in JavaScript and will be renamed to pb_name.
-   * Optional fields that are not set will be set to undefined.
-   * To access a reserved field use, foo.pb_<name>, eg, foo.pb_default.
-   * For the list of reserved names please see:
-   *     net/proto2/compiler/js/internal/generator.cc#kKeyword.
-   * @param {boolean=} opt_includeInstance Deprecated. whether to include the
-   *     JSPB instance for transitional soy proto support:
-   *     http://goto/soy-param-migration
-   * @return {!Object}
-   */
-  proto.MediaType.prototype.toObject = function (opt_includeInstance) {
-    return proto.MediaType.toObject(opt_includeInstance, this)
-  }
-
-  /**
-   * Static version of the {@see toObject} method.
-   * @param {boolean|undefined} includeInstance Deprecated. Whether to include
-   *     the JSPB instance for transitional soy proto support:
-   *     http://goto/soy-param-migration
-   * @param {!proto.MediaType} msg The msg instance to transform.
-   * @return {!Object}
-   * @suppress {unusedLocalVariables} f is only used for nested messages
-   */
-  proto.MediaType.toObject = function (includeInstance, msg) {
-    var f,
-      obj = {
-        codecName: (f = jspb.Message.getField(msg, 1)) == null ? undefined : f,
-        container: (f = jspb.Message.getField(msg, 2)) == null ? undefined : f,
-        mimeMediaType: (f = jspb.Message.getField(msg, 3)) == null ? undefined : f,
-      }
-
-    if (includeInstance) {
-      obj.$jspbMessageInstance = msg
-    }
-    return obj
-  }
-}
-
-/**
- * Deserializes binary data (in protobuf wire format).
- * @param {jspb.ByteSource} bytes The bytes to deserialize.
- * @return {!proto.MediaType}
- */
-proto.MediaType.deserializeBinary = function (bytes) {
-  var reader = new jspb.BinaryReader(bytes)
-  var msg = new proto.MediaType()
-  return proto.MediaType.deserializeBinaryFromReader(msg, reader)
-}
-
-/**
- * Deserializes binary data (in protobuf wire format) from the
- * given reader into the given message object.
- * @param {!proto.MediaType} msg The message object to deserialize into.
- * @param {!jspb.BinaryReader} reader The BinaryReader to use.
- * @return {!proto.MediaType}
- */
-proto.MediaType.deserializeBinaryFromReader = function (msg, reader) {
-  while (reader.nextField()) {
-    if (reader.isEndGroup()) {
-      break
-    }
-    var field = reader.getFieldNumber()
-    switch (field) {
-      case 1:
-        var value = /** @type {string} */ (reader.readString())
-        msg.setCodecName(value)
-        break
-      case 2:
-        var value = /** @type {string} */ (reader.readString())
-        msg.setContainer(value)
-        break
-      case 3:
-        var value = /** @type {string} */ (reader.readString())
-        msg.setMimeMediaType(value)
-        break
-      default:
-        reader.skipField()
-        break
-    }
-  }
-  return msg
-}
-
-/**
- * Serializes the message to binary data (in protobuf wire format).
- * @return {!Uint8Array}
- */
-proto.MediaType.prototype.serializeBinary = function () {
-  var writer = new jspb.BinaryWriter()
-  proto.MediaType.serializeBinaryToWriter(this, writer)
-  return writer.getResultBuffer()
-}
-
-/**
- * Serializes the given message to binary data (in protobuf wire
- * format), writing to the given BinaryWriter.
- * @param {!proto.MediaType} message
- * @param {!jspb.BinaryWriter} writer
- * @suppress {unusedLocalVariables} f is only used for nested messages
- */
-proto.MediaType.serializeBinaryToWriter = function (message, writer) {
-  var f = undefined
-  f = /** @type {string} */ (jspb.Message.getField(message, 1))
-  if (f != null) {
-    writer.writeString(1, f)
-  }
-  f = /** @type {string} */ (jspb.Message.getField(message, 2))
-  if (f != null) {
-    writer.writeString(2, f)
-  }
-  f = /** @type {string} */ (jspb.Message.getField(message, 3))
-  if (f != null) {
-    writer.writeString(3, f)
-  }
-}
-
-/**
- * optional string codec_name = 1;
- * @return {string}
- */
-proto.MediaType.prototype.getCodecName = function () {
-  return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 1, ''))
-}
-
-/**
- * @param {string} value
- * @return {!proto.MediaType} returns this
- */
-proto.MediaType.prototype.setCodecName = function (value) {
-  return jspb.Message.setField(this, 1, value)
-}
-
-/**
- * Clears the field making it undefined.
- * @return {!proto.MediaType} returns this
- */
-proto.MediaType.prototype.clearCodecName = function () {
-  return jspb.Message.setField(this, 1, undefined)
-}
-
-/**
- * Returns whether this field is set.
- * @return {boolean}
- */
-proto.MediaType.prototype.hasCodecName = function () {
-  return jspb.Message.getField(this, 1) != null
-}
-
-/**
- * optional string container = 2;
- * @return {string}
- */
-proto.MediaType.prototype.getContainer = function () {
-  return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 2, ''))
-}
-
-/**
- * @param {string} value
- * @return {!proto.MediaType} returns this
- */
-proto.MediaType.prototype.setContainer = function (value) {
-  return jspb.Message.setField(this, 2, value)
-}
-
-/**
- * Clears the field making it undefined.
- * @return {!proto.MediaType} returns this
- */
-proto.MediaType.prototype.clearContainer = function () {
-  return jspb.Message.setField(this, 2, undefined)
-}
-
-/**
- * Returns whether this field is set.
- * @return {boolean}
- */
-proto.MediaType.prototype.hasContainer = function () {
-  return jspb.Message.getField(this, 2) != null
-}
-
-/**
- * optional string mime_media_type = 3;
- * @return {string}
- */
-proto.MediaType.prototype.getMimeMediaType = function () {
-  return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 3, ''))
-}
-
-/**
- * @param {string} value
- * @return {!proto.MediaType} returns this
- */
-proto.MediaType.prototype.setMimeMediaType = function (value) {
-  return jspb.Message.setField(this, 3, value)
-}
-
-/**
- * Clears the field making it undefined.
- * @return {!proto.MediaType} returns this
- */
-proto.MediaType.prototype.clearMimeMediaType = function () {
-  return jspb.Message.setField(this, 3, undefined)
-}
-
-/**
- * Returns whether this field is set.
- * @return {boolean}
- */
-proto.MediaType.prototype.hasMimeMediaType = function () {
-  return jspb.Message.getField(this, 3) != null
-}
-
-if (jspb.Message.GENERATE_TO_OBJECT) {
-  /**
-   * Creates an object representation of this proto.
-   * Field names that are reserved in JavaScript and will be renamed to pb_name.
-   * Optional fields that are not set will be set to undefined.
-   * To access a reserved field use, foo.pb_<name>, eg, foo.pb_default.
-   * For the list of reserved names please see:
-   *     net/proto2/compiler/js/internal/generator.cc#kKeyword.
-   * @param {boolean=} opt_includeInstance Deprecated. whether to include the
-   *     JSPB instance for transitional soy proto support:
-   *     http://goto/soy-param-migration
-   * @return {!Object}
-   */
-  proto.VideoMetadata.prototype.toObject = function (opt_includeInstance) {
-    return proto.VideoMetadata.toObject(opt_includeInstance, this)
-  }
-
-  /**
-   * Static version of the {@see toObject} method.
-   * @param {boolean|undefined} includeInstance Deprecated. Whether to include
-   *     the JSPB instance for transitional soy proto support:
-   *     http://goto/soy-param-migration
-   * @param {!proto.VideoMetadata} msg The msg instance to transform.
-   * @return {!Object}
-   * @suppress {unusedLocalVariables} f is only used for nested messages
-   */
-  proto.VideoMetadata.toObject = function (includeInstance, msg) {
-    var f,
-      obj = {
-        title: (f = jspb.Message.getField(msg, 1)) == null ? undefined : f,
-        description: (f = jspb.Message.getField(msg, 2)) == null ? undefined : f,
-        duration: (f = jspb.Message.getField(msg, 3)) == null ? undefined : f,
-        mediaPixelHeight: (f = jspb.Message.getField(msg, 4)) == null ? undefined : f,
-        mediaPixelWidth: (f = jspb.Message.getField(msg, 5)) == null ? undefined : f,
-        mediaType: (f = msg.getMediaType()) && proto.MediaType.toObject(includeInstance, f),
-        language: (f = jspb.Message.getField(msg, 7)) == null ? undefined : f,
-        license: (f = msg.getLicense()) && proto.License.toObject(includeInstance, f),
-        publishedBeforeJoystream:
-          (f = msg.getPublishedBeforeJoystream()) && proto.PublishedBeforeJoystream.toObject(includeInstance, f),
-        hasMarketing: (f = jspb.Message.getBooleanField(msg, 10)) == null ? undefined : f,
-        isPublic: (f = jspb.Message.getBooleanField(msg, 11)) == null ? undefined : f,
-        isExplicit: (f = jspb.Message.getBooleanField(msg, 12)) == null ? undefined : f,
-      }
-
-    if (includeInstance) {
-      obj.$jspbMessageInstance = msg
-    }
-    return obj
-  }
-}
-
-/**
- * Deserializes binary data (in protobuf wire format).
- * @param {jspb.ByteSource} bytes The bytes to deserialize.
- * @return {!proto.VideoMetadata}
- */
-proto.VideoMetadata.deserializeBinary = function (bytes) {
-  var reader = new jspb.BinaryReader(bytes)
-  var msg = new proto.VideoMetadata()
-  return proto.VideoMetadata.deserializeBinaryFromReader(msg, reader)
-}
-
-/**
- * Deserializes binary data (in protobuf wire format) from the
- * given reader into the given message object.
- * @param {!proto.VideoMetadata} msg The message object to deserialize into.
- * @param {!jspb.BinaryReader} reader The BinaryReader to use.
- * @return {!proto.VideoMetadata}
- */
-proto.VideoMetadata.deserializeBinaryFromReader = function (msg, reader) {
-  while (reader.nextField()) {
-    if (reader.isEndGroup()) {
-      break
-    }
-    var field = reader.getFieldNumber()
-    switch (field) {
-      case 1:
-        var value = /** @type {string} */ (reader.readString())
-        msg.setTitle(value)
-        break
-      case 2:
-        var value = /** @type {string} */ (reader.readString())
-        msg.setDescription(value)
-        break
-      case 3:
-        var value = /** @type {number} */ (reader.readInt32())
-        msg.setDuration(value)
-        break
-      case 4:
-        var value = /** @type {number} */ (reader.readInt32())
-        msg.setMediaPixelHeight(value)
-        break
-      case 5:
-        var value = /** @type {number} */ (reader.readInt32())
-        msg.setMediaPixelWidth(value)
-        break
-      case 6:
-        var value = new proto.MediaType()
-        reader.readMessage(value, proto.MediaType.deserializeBinaryFromReader)
-        msg.setMediaType(value)
-        break
-      case 7:
-        var value = /** @type {string} */ (reader.readString())
-        msg.setLanguage(value)
-        break
-      case 8:
-        var value = new proto.License()
-        reader.readMessage(value, proto.License.deserializeBinaryFromReader)
-        msg.setLicense(value)
-        break
-      case 9:
-        var value = new proto.PublishedBeforeJoystream()
-        reader.readMessage(value, proto.PublishedBeforeJoystream.deserializeBinaryFromReader)
-        msg.setPublishedBeforeJoystream(value)
-        break
-      case 10:
-        var value = /** @type {boolean} */ (reader.readBool())
-        msg.setHasMarketing(value)
-        break
-      case 11:
-        var value = /** @type {boolean} */ (reader.readBool())
-        msg.setIsPublic(value)
-        break
-      case 12:
-        var value = /** @type {boolean} */ (reader.readBool())
-        msg.setIsExplicit(value)
-        break
-      default:
-        reader.skipField()
-        break
-    }
-  }
-  return msg
-}
-
-/**
- * Serializes the message to binary data (in protobuf wire format).
- * @return {!Uint8Array}
- */
-proto.VideoMetadata.prototype.serializeBinary = function () {
-  var writer = new jspb.BinaryWriter()
-  proto.VideoMetadata.serializeBinaryToWriter(this, writer)
-  return writer.getResultBuffer()
-}
-
-/**
- * Serializes the given message to binary data (in protobuf wire
- * format), writing to the given BinaryWriter.
- * @param {!proto.VideoMetadata} message
- * @param {!jspb.BinaryWriter} writer
- * @suppress {unusedLocalVariables} f is only used for nested messages
- */
-proto.VideoMetadata.serializeBinaryToWriter = function (message, writer) {
-  var f = undefined
-  f = /** @type {string} */ (jspb.Message.getField(message, 1))
-  if (f != null) {
-    writer.writeString(1, f)
-  }
-  f = /** @type {string} */ (jspb.Message.getField(message, 2))
-  if (f != null) {
-    writer.writeString(2, f)
-  }
-  f = /** @type {number} */ (jspb.Message.getField(message, 3))
-  if (f != null) {
-    writer.writeInt32(3, f)
-  }
-  f = /** @type {number} */ (jspb.Message.getField(message, 4))
-  if (f != null) {
-    writer.writeInt32(4, f)
-  }
-  f = /** @type {number} */ (jspb.Message.getField(message, 5))
-  if (f != null) {
-    writer.writeInt32(5, f)
-  }
-  f = message.getMediaType()
-  if (f != null) {
-    writer.writeMessage(6, f, proto.MediaType.serializeBinaryToWriter)
-  }
-  f = /** @type {string} */ (jspb.Message.getField(message, 7))
-  if (f != null) {
-    writer.writeString(7, f)
-  }
-  f = message.getLicense()
-  if (f != null) {
-    writer.writeMessage(8, f, proto.License.serializeBinaryToWriter)
-  }
-  f = message.getPublishedBeforeJoystream()
-  if (f != null) {
-    writer.writeMessage(9, f, proto.PublishedBeforeJoystream.serializeBinaryToWriter)
-  }
-  f = /** @type {boolean} */ (jspb.Message.getField(message, 10))
-  if (f != null) {
-    writer.writeBool(10, f)
-  }
-  f = /** @type {boolean} */ (jspb.Message.getField(message, 11))
-  if (f != null) {
-    writer.writeBool(11, f)
-  }
-  f = /** @type {boolean} */ (jspb.Message.getField(message, 12))
-  if (f != null) {
-    writer.writeBool(12, f)
-  }
-}
-
-/**
- * optional string title = 1;
- * @return {string}
- */
-proto.VideoMetadata.prototype.getTitle = function () {
-  return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 1, ''))
-}
-
-/**
- * @param {string} value
- * @return {!proto.VideoMetadata} returns this
- */
-proto.VideoMetadata.prototype.setTitle = function (value) {
-  return jspb.Message.setField(this, 1, value)
-}
-
-/**
- * Clears the field making it undefined.
- * @return {!proto.VideoMetadata} returns this
- */
-proto.VideoMetadata.prototype.clearTitle = function () {
-  return jspb.Message.setField(this, 1, undefined)
-}
-
-/**
- * Returns whether this field is set.
- * @return {boolean}
- */
-proto.VideoMetadata.prototype.hasTitle = function () {
-  return jspb.Message.getField(this, 1) != null
-}
-
-/**
- * optional string description = 2;
- * @return {string}
- */
-proto.VideoMetadata.prototype.getDescription = function () {
-  return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 2, ''))
-}
-
-/**
- * @param {string} value
- * @return {!proto.VideoMetadata} returns this
- */
-proto.VideoMetadata.prototype.setDescription = function (value) {
-  return jspb.Message.setField(this, 2, value)
-}
-
-/**
- * Clears the field making it undefined.
- * @return {!proto.VideoMetadata} returns this
- */
-proto.VideoMetadata.prototype.clearDescription = function () {
-  return jspb.Message.setField(this, 2, undefined)
-}
-
-/**
- * Returns whether this field is set.
- * @return {boolean}
- */
-proto.VideoMetadata.prototype.hasDescription = function () {
-  return jspb.Message.getField(this, 2) != null
-}
-
-/**
- * optional int32 duration = 3;
- * @return {number}
- */
-proto.VideoMetadata.prototype.getDuration = function () {
-  return /** @type {number} */ (jspb.Message.getFieldWithDefault(this, 3, 0))
-}
-
-/**
- * @param {number} value
- * @return {!proto.VideoMetadata} returns this
- */
-proto.VideoMetadata.prototype.setDuration = function (value) {
-  return jspb.Message.setField(this, 3, value)
-}
-
-/**
- * Clears the field making it undefined.
- * @return {!proto.VideoMetadata} returns this
- */
-proto.VideoMetadata.prototype.clearDuration = function () {
-  return jspb.Message.setField(this, 3, undefined)
-}
-
-/**
- * Returns whether this field is set.
- * @return {boolean}
- */
-proto.VideoMetadata.prototype.hasDuration = function () {
-  return jspb.Message.getField(this, 3) != null
-}
-
-/**
- * optional int32 media_pixel_height = 4;
- * @return {number}
- */
-proto.VideoMetadata.prototype.getMediaPixelHeight = function () {
-  return /** @type {number} */ (jspb.Message.getFieldWithDefault(this, 4, 0))
-}
-
-/**
- * @param {number} value
- * @return {!proto.VideoMetadata} returns this
- */
-proto.VideoMetadata.prototype.setMediaPixelHeight = function (value) {
-  return jspb.Message.setField(this, 4, value)
-}
-
-/**
- * Clears the field making it undefined.
- * @return {!proto.VideoMetadata} returns this
- */
-proto.VideoMetadata.prototype.clearMediaPixelHeight = function () {
-  return jspb.Message.setField(this, 4, undefined)
-}
-
-/**
- * Returns whether this field is set.
- * @return {boolean}
- */
-proto.VideoMetadata.prototype.hasMediaPixelHeight = function () {
-  return jspb.Message.getField(this, 4) != null
-}
-
-/**
- * optional int32 media_pixel_width = 5;
- * @return {number}
- */
-proto.VideoMetadata.prototype.getMediaPixelWidth = function () {
-  return /** @type {number} */ (jspb.Message.getFieldWithDefault(this, 5, 0))
-}
-
-/**
- * @param {number} value
- * @return {!proto.VideoMetadata} returns this
- */
-proto.VideoMetadata.prototype.setMediaPixelWidth = function (value) {
-  return jspb.Message.setField(this, 5, value)
-}
-
-/**
- * Clears the field making it undefined.
- * @return {!proto.VideoMetadata} returns this
- */
-proto.VideoMetadata.prototype.clearMediaPixelWidth = function () {
-  return jspb.Message.setField(this, 5, undefined)
-}
-
-/**
- * Returns whether this field is set.
- * @return {boolean}
- */
-proto.VideoMetadata.prototype.hasMediaPixelWidth = function () {
-  return jspb.Message.getField(this, 5) != null
-}
-
-/**
- * optional MediaType media_type = 6;
- * @return {?proto.MediaType}
- */
-proto.VideoMetadata.prototype.getMediaType = function () {
-  return /** @type{?proto.MediaType} */ (jspb.Message.getWrapperField(this, proto.MediaType, 6))
-}
-
-/**
- * @param {?proto.MediaType|undefined} value
- * @return {!proto.VideoMetadata} returns this
- */
-proto.VideoMetadata.prototype.setMediaType = function (value) {
-  return jspb.Message.setWrapperField(this, 6, value)
-}
-
-/**
- * Clears the message field making it undefined.
- * @return {!proto.VideoMetadata} returns this
- */
-proto.VideoMetadata.prototype.clearMediaType = function () {
-  return this.setMediaType(undefined)
-}
-
-/**
- * Returns whether this field is set.
- * @return {boolean}
- */
-proto.VideoMetadata.prototype.hasMediaType = function () {
-  return jspb.Message.getField(this, 6) != null
-}
-
-/**
- * optional string language = 7;
- * @return {string}
- */
-proto.VideoMetadata.prototype.getLanguage = function () {
-  return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 7, ''))
-}
-
-/**
- * @param {string} value
- * @return {!proto.VideoMetadata} returns this
- */
-proto.VideoMetadata.prototype.setLanguage = function (value) {
-  return jspb.Message.setField(this, 7, value)
-}
-
-/**
- * Clears the field making it undefined.
- * @return {!proto.VideoMetadata} returns this
- */
-proto.VideoMetadata.prototype.clearLanguage = function () {
-  return jspb.Message.setField(this, 7, undefined)
-}
-
-/**
- * Returns whether this field is set.
- * @return {boolean}
- */
-proto.VideoMetadata.prototype.hasLanguage = function () {
-  return jspb.Message.getField(this, 7) != null
-}
-
-/**
- * optional License license = 8;
- * @return {?proto.License}
- */
-proto.VideoMetadata.prototype.getLicense = function () {
-  return /** @type{?proto.License} */ (jspb.Message.getWrapperField(this, proto.License, 8))
-}
-
-/**
- * @param {?proto.License|undefined} value
- * @return {!proto.VideoMetadata} returns this
- */
-proto.VideoMetadata.prototype.setLicense = function (value) {
-  return jspb.Message.setWrapperField(this, 8, value)
-}
-
-/**
- * Clears the message field making it undefined.
- * @return {!proto.VideoMetadata} returns this
- */
-proto.VideoMetadata.prototype.clearLicense = function () {
-  return this.setLicense(undefined)
-}
-
-/**
- * Returns whether this field is set.
- * @return {boolean}
- */
-proto.VideoMetadata.prototype.hasLicense = function () {
-  return jspb.Message.getField(this, 8) != null
-}
-
-/**
- * optional PublishedBeforeJoystream published_before_joystream = 9;
- * @return {?proto.PublishedBeforeJoystream}
- */
-proto.VideoMetadata.prototype.getPublishedBeforeJoystream = function () {
-  return /** @type{?proto.PublishedBeforeJoystream} */ (jspb.Message.getWrapperField(
-    this,
-    proto.PublishedBeforeJoystream,
-    9
-  ))
-}
-
-/**
- * @param {?proto.PublishedBeforeJoystream|undefined} value
- * @return {!proto.VideoMetadata} returns this
- */
-proto.VideoMetadata.prototype.setPublishedBeforeJoystream = function (value) {
-  return jspb.Message.setWrapperField(this, 9, value)
-}
-
-/**
- * Clears the message field making it undefined.
- * @return {!proto.VideoMetadata} returns this
- */
-proto.VideoMetadata.prototype.clearPublishedBeforeJoystream = function () {
-  return this.setPublishedBeforeJoystream(undefined)
-}
-
-/**
- * Returns whether this field is set.
- * @return {boolean}
- */
-proto.VideoMetadata.prototype.hasPublishedBeforeJoystream = function () {
-  return jspb.Message.getField(this, 9) != null
-}
-
-/**
- * optional bool has_marketing = 10;
- * @return {boolean}
- */
-proto.VideoMetadata.prototype.getHasMarketing = function () {
-  return /** @type {boolean} */ (jspb.Message.getBooleanFieldWithDefault(this, 10, false))
-}
-
-/**
- * @param {boolean} value
- * @return {!proto.VideoMetadata} returns this
- */
-proto.VideoMetadata.prototype.setHasMarketing = function (value) {
-  return jspb.Message.setField(this, 10, value)
-}
-
-/**
- * Clears the field making it undefined.
- * @return {!proto.VideoMetadata} returns this
- */
-proto.VideoMetadata.prototype.clearHasMarketing = function () {
-  return jspb.Message.setField(this, 10, undefined)
-}
-
-/**
- * Returns whether this field is set.
- * @return {boolean}
- */
-proto.VideoMetadata.prototype.hasHasMarketing = function () {
-  return jspb.Message.getField(this, 10) != null
-}
-
-/**
- * optional bool is_public = 11;
- * @return {boolean}
- */
-proto.VideoMetadata.prototype.getIsPublic = function () {
-  return /** @type {boolean} */ (jspb.Message.getBooleanFieldWithDefault(this, 11, false))
-}
-
-/**
- * @param {boolean} value
- * @return {!proto.VideoMetadata} returns this
- */
-proto.VideoMetadata.prototype.setIsPublic = function (value) {
-  return jspb.Message.setField(this, 11, value)
-}
-
-/**
- * Clears the field making it undefined.
- * @return {!proto.VideoMetadata} returns this
- */
-proto.VideoMetadata.prototype.clearIsPublic = function () {
-  return jspb.Message.setField(this, 11, undefined)
-}
-
-/**
- * Returns whether this field is set.
- * @return {boolean}
- */
-proto.VideoMetadata.prototype.hasIsPublic = function () {
-  return jspb.Message.getField(this, 11) != null
-}
-
-/**
- * optional bool is_explicit = 12;
- * @return {boolean}
- */
-proto.VideoMetadata.prototype.getIsExplicit = function () {
-  return /** @type {boolean} */ (jspb.Message.getBooleanFieldWithDefault(this, 12, false))
-}
-
-/**
- * @param {boolean} value
- * @return {!proto.VideoMetadata} returns this
- */
-proto.VideoMetadata.prototype.setIsExplicit = function (value) {
-  return jspb.Message.setField(this, 12, value)
-}
-
-/**
- * Clears the field making it undefined.
- * @return {!proto.VideoMetadata} returns this
- */
-proto.VideoMetadata.prototype.clearIsExplicit = function () {
-  return jspb.Message.setField(this, 12, undefined)
-}
-
-/**
- * Returns whether this field is set.
- * @return {boolean}
- */
-proto.VideoMetadata.prototype.hasIsExplicit = function () {
-  return jspb.Message.getField(this, 12) != null
-}
-
-goog.object.extend(exports, proto)

+ 2 - 2
content-metadata/src/index.ts

@@ -3,5 +3,5 @@ import licences from './licenses'
 export { licences }
 
 // protobuf message constructors
-export * from '../proto/Video_pb'
-export * from '../proto/Channel_pb'
+export * from '../compiled/proto/Video_pb'
+export * from '../compiled/proto/Channel_pb'

+ 4 - 5
content-metadata/src/licenses.ts

@@ -1,7 +1,8 @@
 import LICENSES from './KnownLicenses.json'
-import { License } from '../proto/Video_pb'
+import { License } from '../compiled/proto/Video_pb'
 
 export type LicenseCode = number
+export const CUSTOM_LICENSE_CODE: LicenseCode = 1000
 
 type KnownLicense = {
   code: LicenseCode
@@ -18,8 +19,6 @@ LICENSES.forEach((license: KnownLicense) => {
   KnownLicenses.set(license.code, license)
 })
 
-export const CUSTOM_LICENSE_CODE: LicenseCode = 1000
-
 export function getLicenseCodeByName(name: string): LicenseCode | undefined {
   for (const [code, license] of KnownLicenses) {
     if (license.name === name) return code
@@ -51,7 +50,7 @@ export function createKnownLicenseFromCode(code: LicenseCode, attribution?: stri
   return license
 }
 
-export function createCustomLicense(customText: string): License {
+export function createCustomKnownLicense(customText: string): License {
   const license = new License()
 
   license.setCode(CUSTOM_LICENSE_CODE)
@@ -62,7 +61,7 @@ export function createCustomLicense(customText: string): License {
 export default {
   CUSTOM_LICENSE_CODE,
   KnownLicenses,
-  createCustomLicense,
+  createCustomKnownLicense,
   createKnownLicenseFromCode,
   getLicenseCodeByName,
 }

+ 17 - 10
content-metadata/test/license-codes.ts

@@ -1,21 +1,23 @@
-import { KnownLicenses, CUSTOM_LICENSE_CODE, getLicenseCodeByName, createKnownLicenseFromCode } from '../src/licenses'
+import {
+  KnownLicenses,
+  CUSTOM_LICENSE_CODE,
+  getLicenseCodeByName,
+  createKnownLicenseFromCode,
+  createCustomKnownLicense,
+} from '../src/licenses'
 import { VideoMetadata } from '../src/index'
 import { assert } from 'chai'
 
 describe('Known License Codes', () => {
-  it('Should not have license code default value 0', () => {
+  it('Excludes default value 0', () => {
     assert(!KnownLicenses.has(0))
   })
 
-  it('Correct Nunber of Known Licenses', () => {
-    assert.equal(KnownLicenses.size, 9)
-  })
-
-  it('Custom License defined', () => {
+  it('Pre-defined Joystream license codes', () => {
+    // Make sure we have correct known custom licence
     assert(KnownLicenses.has(CUSTOM_LICENSE_CODE))
-  })
+    assert.equal(KnownLicenses.get(CUSTOM_LICENSE_CODE)!.name, 'CUSTOM')
 
-  it('Pre-defined Joystream license codes', () => {
     assert(KnownLicenses.has(1001))
     assert(KnownLicenses.has(1002))
     assert(KnownLicenses.has(1003))
@@ -26,7 +28,12 @@ describe('Known License Codes', () => {
     assert(KnownLicenses.has(1008))
   })
 
-  it('Can create known licence by name', () => {
+  it('createCustomKnownLicense(): uses correct code', () => {
+    const license = createCustomKnownLicense('custom text')
+    assert.equal(license.getCode(), CUSTOM_LICENSE_CODE)
+  })
+
+  it('createKnownLicenseFromCode(): Licence can be created by name', () => {
     const licenseCode = getLicenseCodeByName('CC_BY') as number
     const license = createKnownLicenseFromCode(licenseCode as number, 'Attribution: Joystream')
     const videoMeta = new VideoMetadata()

+ 81 - 19
content-metadata/test/video.ts

@@ -1,8 +1,8 @@
-import { VideoMetadata, PublishedBeforeJoystream } from '../proto/Video_pb'
+import { VideoMetadata, PublishedBeforeJoystream, MediaType, License } from '../src'
 import { assert, expect } from 'chai'
 
 describe('Video Metadata', () => {
-  it('Create Video Metadata', () => {
+  it('Message', () => {
     const meta = new VideoMetadata()
 
     const title = 'Video Title'
@@ -12,35 +12,97 @@ describe('Video Metadata', () => {
     meta.setTitle(title)
     meta.setDescription(description)
     meta.setDuration(duration)
+    meta.setMediaPixelHeight(1)
+    meta.setMediaPixelWidth(2)
+    meta.setMediaType(new MediaType())
+    meta.setLanguage('en')
+    meta.setLicense(new License())
+    meta.setPublishedBeforeJoystream(new PublishedBeforeJoystream())
+    meta.setHasMarketing(true)
+    meta.setIsPublic(true)
+    meta.setIsExplicit(false)
+
+    assert.deepEqual(meta.toObject(), {
+      title,
+      description,
+      duration,
+      mediaPixelHeight: 1,
+      mediaPixelWidth: 2,
+      mediaType: {
+        codecName: undefined,
+        container: undefined,
+        mimeMediaType: undefined,
+      },
+      language: 'en',
+      license: {
+        code: undefined,
+        attribution: undefined,
+        customText: undefined,
+      },
+      publishedBeforeJoystream: { isPublished: undefined, timestamp: undefined },
+      hasMarketing: true,
+      isPublic: true,
+      isExplicit: false,
+    })
+
+    // sanity check - encoding / decoding works
+    assert.deepEqual(VideoMetadata.deserializeBinary(meta.serializeBinary()), meta)
+  })
+
+  it('Message: PublishedBeforeJoystream', () => {
+    const meta = new VideoMetadata()
 
-    // Test optional field
     expect(meta.hasPublishedBeforeJoystream()).equals(false, 'PublishedBeforeJoystream field should NOT be set')
 
-    // Set published before joystream field
     const published = new PublishedBeforeJoystream()
     const isPublished = true
     const timestamp = 10000
     published.setIsPublished(isPublished)
     published.setTimestamp(timestamp)
+
     meta.setPublishedBeforeJoystream(published)
-    // Field show now be set
+
+    // Field should now be set
     expect(meta.hasPublishedBeforeJoystream()).equals(true, 'PublishedBeforeJoystream field should be set')
 
-    assert.deepEqual(VideoMetadata.deserializeBinary(meta.serializeBinary()), meta)
+    assert.deepEqual(published.toObject(), {
+      isPublished,
+      timestamp,
+    })
+  })
 
-    assert.deepEqual(meta.toObject(), {
-      title,
-      description,
-      duration,
-      mediaPixelHeight: undefined,
-      mediaPixelWidth: undefined,
-      mediaType: undefined,
-      language: undefined,
-      license: undefined,
-      publishedBeforeJoystream: { isPublished, timestamp },
-      hasMarketing: undefined,
-      isPublic: undefined,
-      isExplicit: undefined,
+  it('Message: Licence', () => {
+    const license = new License()
+
+    const code = 1000
+    const attribution = 'Attribution Text'
+    const customText = 'Custom License Details'
+    license.setCode(code)
+    license.setAttribution(attribution)
+    license.setCustomText(customText)
+
+    assert.deepEqual(license.toObject(), {
+      code,
+      attribution,
+      customText,
+    })
+  })
+
+  it('Message: MediaType', () => {
+    const mediaType = new MediaType()
+
+    const codecName = 'mpeg4'
+    const container = 'avi'
+    const mimeMediaType = 'videp/mp4'
+
+    mediaType.setCodecName(codecName)
+    mediaType.setContainer(container)
+    mediaType.setMimeMediaType(mimeMediaType)
+
+    assert.deepEqual(mediaType.toObject(), {
+      codecName,
+      container,
+      mimeMediaType,
     })
   })
 })