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,
|
"find": true,
|
||||||
"sort": true
|
"sort": true
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
"id": "topic",
|
||||||
|
"title": "Topic",
|
||||||
|
"type": ["string"],
|
||||||
|
"autocomplete": true,
|
||||||
|
"columnWidth": 120,
|
||||||
|
"filter": true,
|
||||||
|
"find": true,
|
||||||
|
"sort": true
|
||||||
|
},
|
||||||
{
|
{
|
||||||
"id": "color",
|
"id": "color",
|
||||||
"title": "Color",
|
"title": "Color",
|
||||||
|
|
12
data.py
12
data.py
|
@ -28,6 +28,7 @@ def update_item(d, add_only=False):
|
||||||
'description': 'summary',
|
'description': 'summary',
|
||||||
'id': 'archive',
|
'id': 'archive',
|
||||||
'mp4': 'stream',
|
'mp4': 'stream',
|
||||||
|
'subject': 'topic',
|
||||||
}.get(k,k):d[k] for k in d}
|
}.get(k,k):d[k] for k in d}
|
||||||
for k in ('type', 'flv', 'video'):
|
for k in ('type', 'flv', 'video'):
|
||||||
if k in info:
|
if k in info:
|
||||||
|
@ -68,12 +69,16 @@ def update_item(d, add_only=False):
|
||||||
info['color'] = [{
|
info['color'] = [{
|
||||||
'color': 'Color',
|
'color': 'Color',
|
||||||
'c': 'Color',
|
'c': 'Color',
|
||||||
|
'b': 'B&W',
|
||||||
|
'w': 'B&W',
|
||||||
'sepia': 'Sepia',
|
'sepia': 'Sepia',
|
||||||
'tinted': 'Tinted',
|
'tinted': 'Tinted',
|
||||||
|
'tinted B&W': 'B&W (tinted)',
|
||||||
'black and white': 'B&W',
|
'black and white': 'B&W',
|
||||||
|
'black & white': 'B&W',
|
||||||
'bw': 'B&W',
|
'bw': 'B&W',
|
||||||
'b&w': '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'])
|
i, created = get_item(info['archive'])
|
||||||
if add_only and not created:
|
if add_only and not created:
|
||||||
|
@ -91,11 +96,10 @@ def update_items(add_only=False):
|
||||||
for d in data:
|
for d in data:
|
||||||
update_item(d, add_only)
|
update_item(d, add_only)
|
||||||
|
|
||||||
def update_item_stream(i):
|
def update_item_stream(i, force=False):
|
||||||
if update_stream(i):
|
if update_stream(i) or force:
|
||||||
for s in i.streams():
|
for s in i.streams():
|
||||||
s.make_timeline()
|
s.make_timeline()
|
||||||
i.level = 0
|
|
||||||
i.save()
|
i.save()
|
||||||
i.update_timeline()
|
i.update_timeline()
|
||||||
i.make_poster(True)
|
i.make_poster(True)
|
||||||
|
|
|
@ -24,7 +24,8 @@ for e in internetarchive.search.Search('collection:prelinger'):
|
||||||
'title', 'description', 'year',
|
'title', 'description', 'year',
|
||||||
'publisher', 'addeddate', 'sound',
|
'publisher', 'addeddate', 'sound',
|
||||||
'creator', 'color', 'credits', 'publisher',
|
'creator', 'color', 'credits', 'publisher',
|
||||||
'sponsor', 'uploader', 'licenseurl',
|
'sponsor', 'uploader', 'licenseurl', 'subject',
|
||||||
|
'language'
|
||||||
#needed?
|
#needed?
|
||||||
'date',
|
'date',
|
||||||
):
|
):
|
||||||
|
|
Loading…
Reference in a new issue