Compare commits
No commits in common. "e7fce4cf26d228a1aa53ff93c3a4bcbe172d7314" and "1d6d53e282f71a3f6eb920d60a218c2bafe7d431" have entirely different histories.
e7fce4cf26
...
1d6d53e282
7 changed files with 23 additions and 60 deletions
|
|
@ -1,22 +0,0 @@
|
|||
# -*- coding: utf-8 -*-
|
||||
# Generated by Django 1.11.13 on 2018-08-04 15:54
|
||||
from __future__ import unicode_literals
|
||||
|
||||
import django.core.serializers.json
|
||||
from django.db import migrations, models
|
||||
import oxdjango.fields
|
||||
|
||||
|
||||
class Migration(migrations.Migration):
|
||||
|
||||
dependencies = [
|
||||
('archive', '0004_jsonfield'),
|
||||
]
|
||||
|
||||
operations = [
|
||||
migrations.AddField(
|
||||
model_name='stream',
|
||||
name='flags',
|
||||
field=oxdjango.fields.JSONField(default=dict, editable=False, encoder=django.core.serializers.json.DjangoJSONEncoder),
|
||||
),
|
||||
]
|
||||
|
|
@ -521,7 +521,7 @@ class File(models.Model):
|
|||
n += 1
|
||||
profile = '%sp.%s' % (resolution, config['formats'][0])
|
||||
target = os.path.join(tmp, language + '_' + profile)
|
||||
ok, error = extract.stream(media, target, profile, info, audio_track=i+1, flags=self.flags)
|
||||
ok, error = extract.stream(media, target, profile, info, audio_track=i+1)
|
||||
if ok:
|
||||
tinfo = ox.avinfo(target)
|
||||
del tinfo['path']
|
||||
|
|
@ -691,7 +691,6 @@ class Stream(models.Model):
|
|||
available = models.BooleanField(default=False)
|
||||
oshash = models.CharField(max_length=16, null=True, db_index=True)
|
||||
info = JSONField(default=dict, editable=False)
|
||||
flags = JSONField(default=dict, editable=False)
|
||||
duration = models.FloatField(default=0)
|
||||
aspect_ratio = models.FloatField(default=0)
|
||||
|
||||
|
|
@ -751,7 +750,7 @@ class Stream(models.Model):
|
|||
self.media.name = self.path(self.name())
|
||||
target = self.media.path
|
||||
info = ox.avinfo(media)
|
||||
ok, error = extract.stream(media, target, self.name(), info, flags=self.flags)
|
||||
ok, error = extract.stream(media, target, self.name(), info)
|
||||
# file could have been moved while encoding
|
||||
# get current version from db and update
|
||||
_self = Stream.objects.get(id=self.id)
|
||||
|
|
|
|||
|
|
@ -1032,16 +1032,9 @@ class Item(models.Model):
|
|||
elif sort_type == 'date':
|
||||
value = self.get(source)
|
||||
if isinstance(value, string_types):
|
||||
value_ = None
|
||||
for fmt in ('%Y-%m-%d', '%Y-%m', '%Y'):
|
||||
try:
|
||||
value_ = datetime_safe.datetime.strptime(value, fmt)
|
||||
except ValueError:
|
||||
pass
|
||||
else:
|
||||
continue
|
||||
if value_ is not None:
|
||||
set_value(s, name, value_)
|
||||
value = datetime_safe.datetime.strptime(value, '%Y-%m-%d')
|
||||
set_value(s, name, value)
|
||||
|
||||
s.save()
|
||||
|
||||
def update_facet(self, key):
|
||||
|
|
|
|||
|
|
@ -412,8 +412,11 @@ pandora.ui.documentInfoView = function(data) {
|
|||
|
||||
function formatValue(key, value) {
|
||||
var ret;
|
||||
if (key == 'date' && (!value || value.split('-').length < 4)) {
|
||||
ret = pandora.formatDate(value);
|
||||
if (key == 'date') {
|
||||
ret = value ? Ox.formatDate(value,
|
||||
['', '%Y', '%B %Y', '%B %e, %Y'][value.split('-').length],
|
||||
true
|
||||
) : '';
|
||||
} else if (nameKeys.indexOf(key) > -1) {
|
||||
ret = formatLink(value.split(', '), key);
|
||||
} else if (listKeys.indexOf(key) > -1) {
|
||||
|
|
|
|||
|
|
@ -26,7 +26,6 @@ pandora.ui.editor = function(data) {
|
|||
enableSetPosterFrame: !pandora.site.media.importFrames && data.editable,
|
||||
enableSubtitles: ui.videoSubtitles,
|
||||
find: ui.itemFind,
|
||||
findLayer: pandora.user.ui._findState.key,
|
||||
getFrameURL: function(position) {
|
||||
return pandora.getMediaURL('/' + ui.item + '/' + ui.videoResolution + 'p' + position + '.jpg?' + data.modified);
|
||||
},
|
||||
|
|
|
|||
|
|
@ -594,7 +594,19 @@ pandora.ui.infoView = function(data) {
|
|||
function formatValue(key, value) {
|
||||
var ret;
|
||||
if (key == 'date' && (!value || value.split('-').length < 4)) {
|
||||
ret = pandora.formatDate(value);
|
||||
if (!value) {
|
||||
ret = ''
|
||||
} else if (Ox.contains(value, ':') && value.split('-').length == 3) {
|
||||
ret = Ox.formatDate(value,
|
||||
['', '', '%B %e, %Y %H:%M', '%B %e, %Y %H:%M:%S'][value.split(':').length],
|
||||
false
|
||||
);
|
||||
} else {
|
||||
ret = Ox.formatDate(value,
|
||||
['', '%Y', '%B %Y', '%B %e, %Y'][value.split('-').length],
|
||||
true
|
||||
);
|
||||
}
|
||||
} else if (listKeys.indexOf(key) > -1) {
|
||||
ret = value.split(', ');
|
||||
} else {
|
||||
|
|
|
|||
|
|
@ -1115,27 +1115,6 @@ pandora.formatDocumentKey = function(key, data, size) {
|
|||
return value;
|
||||
}
|
||||
|
||||
pandora.formatDate = function(value) {
|
||||
var ret;
|
||||
if (!value) {
|
||||
ret = ''
|
||||
} else if (Ox.contains(value, ':') && value.split('-').length == 3) {
|
||||
ret = Ox.formatDate(value,
|
||||
['', '', '%B %e, %Y %H:%M', '%B %e, %Y %H:%M:%S'][value.split(':').length],
|
||||
false
|
||||
);
|
||||
} else {
|
||||
ret = Ox.formatDate(value,
|
||||
['', '%Y', '%B %Y', '%B %e, %Y'][value.split('-').length],
|
||||
true
|
||||
);
|
||||
}
|
||||
if (ret.trim() == 'NaN') {
|
||||
ret = value;
|
||||
}
|
||||
return ret;
|
||||
}
|
||||
|
||||
pandora.getAllItemsTitle = function(section) {
|
||||
section = section || pandora.user.ui.section;
|
||||
return {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue