cleanup
This commit is contained in:
parent
70c74225d4
commit
de6b146973
3 changed files with 20 additions and 5 deletions
10
config.jsonc
10
config.jsonc
|
@ -287,6 +287,16 @@ examples (config.SITENAME.jsonc) that are part of this pan.do/ra distribution.
|
|||
"find": true,
|
||||
"sort": true
|
||||
},
|
||||
{
|
||||
"id": "topic",
|
||||
"title": "Topic",
|
||||
"type": ["string"],
|
||||
"autocomplete": true,
|
||||
"columnWidth": 120,
|
||||
"filter": true,
|
||||
"find": true,
|
||||
"sort": true
|
||||
},
|
||||
{
|
||||
"id": "color",
|
||||
"title": "Color",
|
||||
|
|
12
data.py
12
data.py
|
@ -28,6 +28,7 @@ def update_item(d, add_only=False):
|
|||
'description': 'summary',
|
||||
'id': 'archive',
|
||||
'mp4': 'stream',
|
||||
'subject': 'topic',
|
||||
}.get(k,k):d[k] for k in d}
|
||||
for k in ('type', 'flv', 'video'):
|
||||
if k in info:
|
||||
|
@ -68,12 +69,16 @@ def update_item(d, add_only=False):
|
|||
info['color'] = [{
|
||||
'color': 'Color',
|
||||
'c': 'Color',
|
||||
'b': 'B&W',
|
||||
'w': 'B&W',
|
||||
'sepia': 'Sepia',
|
||||
'tinted': 'Tinted',
|
||||
'tinted B&W': 'B&W (tinted)',
|
||||
'black and white': 'B&W',
|
||||
'black & white': 'B&W',
|
||||
'bw': 'B&W',
|
||||
'b&w': 'B&W',
|
||||
}.get(c.lower(), c) for c in info['color'].replace('b/w', 'b&w').split('/')]
|
||||
}.get(c.lower(), c) for c in info['color'].replace('b/w', 'b&w').replace('B/W', 'B&W').split('/')]
|
||||
|
||||
i, created = get_item(info['archive'])
|
||||
if add_only and not created:
|
||||
|
@ -91,11 +96,10 @@ def update_items(add_only=False):
|
|||
for d in data:
|
||||
update_item(d, add_only)
|
||||
|
||||
def update_item_stream(i):
|
||||
if update_stream(i):
|
||||
def update_item_stream(i, force=False):
|
||||
if update_stream(i) or force:
|
||||
for s in i.streams():
|
||||
s.make_timeline()
|
||||
i.level = 0
|
||||
i.save()
|
||||
i.update_timeline()
|
||||
i.make_poster(True)
|
||||
|
|
|
@ -24,7 +24,8 @@ for e in internetarchive.search.Search('collection:prelinger'):
|
|||
'title', 'description', 'year',
|
||||
'publisher', 'addeddate', 'sound',
|
||||
'creator', 'color', 'credits', 'publisher',
|
||||
'sponsor', 'uploader', 'licenseurl',
|
||||
'sponsor', 'uploader', 'licenseurl', 'subject',
|
||||
'language'
|
||||
#needed?
|
||||
'date',
|
||||
):
|
||||
|
|
Loading…
Reference in a new issue