2022-04-01 16:45:08 +02:00

112 lines
2.9 KiB
Plaintext

'''
Rework packaging flow:
1. queue pickup
2. origin-specific handling
Create initial package
3. create id dir in processing
Add workbase to package
3. transcoding and thumb generation
Put new files in processing
Update package with new relative names
4. stash originals
Move original files to processing subdir
5. platform notification
Temporarily remove base, workbase, orig_id
6. finalize processing
Remove base, workbase, orig_id, notification_id
Save package to disk
Move processing dir to processed
Delete queue file
Delete base files
'''
Updating:
Possible actions:
- replace thumb
- regenerate thumb
- add subs
- remove subs
- remove a stream
- replace a stream
- replace a poster
- regenerate a poster
# package.json - published package:
{
'id': assigned_id
'origin': cattura_etc,
'creation': 0,
'title': "",
'presenters': [],
'courses': [],
'duration': 0,
'thumb': '',
'tags': [],
'subs': 'subtitle_filename.vtt',
'sources': [
{
'name': 'main',
'video': {
resolution: source['video'], # resolution should be the vertical
... # resolution as a string, eg '720' etc
},
'poster': source.get('poster', ''),
'playAudio': source['playAudio']
},
...
]
}
# working state dict:
{
'id': assigned_id, # Unique job id
'orig_id': id_to_replace, # id of original if updating
# only exists for update
# remove before publishing
'notification_id': some_id, # only exists for manual
# remove before publishing
'base': uploaded_path, # remove before publishing
'workbase': work_path, # remove before publishing
'origin': cattura_etc,
'creation': 0,
'title': "",
'presenters': [],
'courses': [],
'duration': 0,
'thumb': '',
'tags': [],
'subs': 'subtitle_filename.vtt',
'sources': [
{
'name': 'main',
'video': {
resolution: source['video'], # resolution should be the vertical
... # resolution as a string, eg '720' etc
},
'poster': source.get('poster', ''),
'playAudio': source['playAudio']
},
...
],
'slides': [ # remove before publishing
{
'url': '', # a valid http(s) URL
'duration': 0 # an integer number of milliseconds
},
...
]
}