var Maki = require('maki');
var config = require('./config');
var decentral = new Maki( config );

var mongoose = require('mongoose');
var Schema = mongoose.Schema;
var ObjectId = Schema.Types.ObjectId;

var Credit = decentral.define('Credit', {
  internal: true,
  attributes: {
    _person: { type: ObjectId , ref: 'Person', required: true },
    role: { type: String , enum: ['host', 'producer', 'guest'] }
  }
});

var Show = decentral.define('Show', {
  attributes: {
    title:    { type: String , max: 35 , required: true , name: true },
    recorded: { type: Date },
    released: { type: Date , default: Date.now },
    description: { type: String },
    credits:  [ Credit.Schema ]
  },
  icon: 'sound'
});

var Person = decentral.define('Person', {
  attributes: {
    name: {
      given: { type: String },
      family: { type: String }
    },
    gpg: {
      fingerprint: { type: String }
    },
    profiles: {}
  },
  virtuals: {
    'name.full': function() {
      return [ this.name.given , this.name.family ].join(' ');
    }
  },
  icon: 'user'
});

decentral.start();

@@ -462,24 +462,294 @@
 tributes: %7B%0A
+    name:    %7B type: String , max: 35 , required: true , name: true %7D,%0A    created: %7B type: Date , default: Date.now %7D,%0A    description: %7B type: String %7D,%0A    hosts:  %5B Credit.Schema %5D%0A  %7D,%0A  icon: 'sound'%0A%7D);%0A%0Avar Recording = decentral.define('Show', %7B%0A  attributes: %7B%0A
     title:  

Add support for multiple shows, many recordings per.