diff --git a/pandora/annotation/management/commands/import_srt.py b/pandora/annotation/management/commands/import_srt.py index 881aa186..ef309f81 100644 --- a/pandora/annotation/management/commands/import_srt.py +++ b/pandora/annotation/management/commands/import_srt.py @@ -27,6 +27,7 @@ class Command(BaseCommand): parser.add_argument('username', help='username') parser.add_argument('item', help='item') parser.add_argument('layer', help='layer') + parser.add_argument('language', help='language', default="") parser.add_argument('filename', help='filename.srt') def handle(self, *args, **options): @@ -34,6 +35,7 @@ class Command(BaseCommand): public_id = options['item'] layer_id = options['layer'] filename = options['filename'] + language = options.get("language") user = User.objects.get(username=username) item = Item.objects.get(public_id=public_id) @@ -47,6 +49,9 @@ class Command(BaseCommand): for i in range(len(annotations)-1): if annotations[i]['out'] == annotations[i+1]['in']: annotations[i]['out'] = annotations[i]['out'] - 0.001 + if language: + for annotation in annotations: + annotation["value"] = '%s' % (language, annotation["value"]) tasks.add_annotations.delay({ 'item': item.public_id, 'layer': layer_id, diff --git a/pandora/item/models.py b/pandora/item/models.py index f6d992c0..be7f3303 100644 --- a/pandora/item/models.py +++ b/pandora/item/models.py @@ -1559,6 +1559,8 @@ class Item(models.Model): return icon def add_empty_clips(self): + if not settings.EMPTY_CLIPS: + return subtitles = utils.get_by_key(settings.CONFIG['layers'], 'isSubtitles', True) if not subtitles: return diff --git a/pandora/settings.py b/pandora/settings.py index f47379e5..7268c31c 100644 --- a/pandora/settings.py +++ b/pandora/settings.py @@ -289,6 +289,8 @@ SECURE_PROXY_SSL_HEADER = ('HTTP_X_FORWARDED_PROTO', 'https') DATA_UPLOAD_MAX_MEMORY_SIZE = 32 * 1024 * 1024 +EMPTY_CLIPS = True + #you can ignore things below this line #========================================================================= LOCAL_APPS = []