# -*- coding: utf-8 -*-
# Generated by Django 1.9.2 on 2016-02-19 15:37
from __future__ import unicode_literals

import archive.models
from django.conf import settings
from django.db import migrations, models
import django.db.models.deletion
import oxdjango.fields


class Migration(migrations.Migration):

    initial = True

    dependencies = [
        migrations.swappable_dependency(settings.AUTH_USER_MODEL),
    ]

    operations = [
        migrations.CreateModel(
            name='File',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('created', models.DateTimeField(auto_now_add=True)),
                ('modified', models.DateTimeField(auto_now=True)),
                ('oshash', models.CharField(max_length=16, unique=True)),
                ('path', models.CharField(default=b'', max_length=2048)),
                ('sort_path', models.CharField(default=b'', max_length=2048)),
                ('type', models.CharField(default=b'', max_length=255)),
                ('extension', models.CharField(default=b'', max_length=255, null=True)),
                ('language', models.CharField(default=b'', max_length=255, null=True)),
                ('part', models.CharField(default=b'', max_length=255, null=True)),
                ('part_title', models.CharField(default=b'', max_length=255, null=True)),
                ('version', models.CharField(default=b'', max_length=255, null=True)),
                ('size', models.BigIntegerField(default=0)),
                ('duration', models.FloatField(null=True)),
                ('info', oxdjango.fields.DictField(default={})),
                ('video_codec', models.CharField(max_length=255)),
                ('pixel_format', models.CharField(max_length=255)),
                ('display_aspect_ratio', models.CharField(max_length=255)),
                ('width', models.IntegerField(default=0)),
                ('height', models.IntegerField(default=0)),
                ('framerate', models.CharField(max_length=255)),
                ('audio_codec', models.CharField(max_length=255)),
                ('channels', models.IntegerField(default=0)),
                ('samplerate', models.IntegerField(default=0)),
                ('bits_per_pixel', models.FloatField(default=-1)),
                ('pixels', models.BigIntegerField(default=0)),
                ('available', models.BooleanField(default=False)),
                ('selected', models.BooleanField(default=False)),
                ('uploading', models.BooleanField(default=False)),
                ('queued', models.BooleanField(default=False)),
                ('encoding', models.BooleanField(default=False)),
                ('wanted', models.BooleanField(default=False)),
                ('failed', models.BooleanField(default=False)),
                ('is_audio', models.BooleanField(default=False)),
                ('is_video', models.BooleanField(default=False)),
                ('is_subtitle', models.BooleanField(default=False)),
                ('data', models.FileField(blank=True, null=True, upload_to=archive.models.data_path)),
            ],
        ),
        migrations.CreateModel(
            name='Frame',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('created', models.DateTimeField(auto_now_add=True)),
                ('modified', models.DateTimeField(auto_now=True)),
                ('position', models.FloatField()),
                ('frame', models.ImageField(default=None, null=True, upload_to=archive.models.frame_path)),
                ('width', models.IntegerField(default=0)),
                ('height', models.IntegerField(default=0)),
                ('file', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='frames', to='archive.File')),
            ],
        ),
        migrations.CreateModel(
            name='Instance',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('created', models.DateTimeField(auto_now_add=True)),
                ('modified', models.DateTimeField(auto_now=True)),
                ('atime', models.IntegerField(default=archive.models.inttime, editable=False)),
                ('ctime', models.IntegerField(default=archive.models.inttime, editable=False)),
                ('mtime', models.IntegerField(default=archive.models.inttime, editable=False)),
                ('path', models.CharField(max_length=2048)),
                ('ignore', models.BooleanField(default=False)),
                ('file', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='instances', to='archive.File')),
            ],
        ),
        migrations.CreateModel(
            name='Stream',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('resolution', models.IntegerField(default=96)),
                ('format', models.CharField(default=b'webm', max_length=255)),
                ('media', models.FileField(blank=True, default=None, upload_to=archive.models.stream_path)),
                ('available', models.BooleanField(default=False)),
                ('oshash', models.CharField(db_index=True, max_length=16, null=True)),
                ('info', oxdjango.fields.DictField(default={})),
                ('duration', models.FloatField(default=0)),
                ('aspect_ratio', models.FloatField(default=0)),
                ('cuts', oxdjango.fields.TupleField(default=[])),
                ('color', oxdjango.fields.TupleField(default=[])),
                ('volume', models.FloatField(default=0)),
                ('error', models.TextField(blank=True, default=b'')),
                ('file', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='streams', to='archive.File')),
                ('source', models.ForeignKey(default=None, null=True, on_delete=django.db.models.deletion.CASCADE, related_name='derivatives', to='archive.Stream')),
            ],
        ),
        migrations.CreateModel(
            name='Volume',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('created', models.DateTimeField(auto_now_add=True)),
                ('modified', models.DateTimeField(auto_now=True)),
                ('name', models.CharField(max_length=1024)),
                ('user', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='volumes', to=settings.AUTH_USER_MODEL)),
            ],
        ),
        migrations.AddField(
            model_name='instance',
            name='volume',
            field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='files', to='archive.Volume'),
        ),
    ]
