Include 'map type' in filename
Map types are 'col', 'spec', 'bump' etc.
This commit is contained in:
parent
dc4677ed04
commit
394a4f4764
@ -402,6 +402,7 @@ async def download_file_by_uuid(file_uuid,
|
|||||||
target_directory: str,
|
target_directory: str,
|
||||||
metadata_directory: str,
|
metadata_directory: str,
|
||||||
*,
|
*,
|
||||||
|
map_type: str=None,
|
||||||
file_loading: callable,
|
file_loading: callable,
|
||||||
file_loaded: callable,
|
file_loaded: callable,
|
||||||
future: asyncio.Future):
|
future: asyncio.Future):
|
||||||
@ -422,7 +423,8 @@ async def download_file_by_uuid(file_uuid,
|
|||||||
metadata_file = os.path.join(metadata_directory, 'files', '%s.json' % file_uuid)
|
metadata_file = os.path.join(metadata_directory, 'files', '%s.json' % file_uuid)
|
||||||
save_as_json(file_desc, metadata_file)
|
save_as_json(file_desc, metadata_file)
|
||||||
|
|
||||||
file_path = os.path.join(target_directory, sanitize_filename(file_desc['filename']))
|
file_path = os.path.join(target_directory,
|
||||||
|
sanitize_filename('%s-%s' % (map_type, file_desc['filename'])))
|
||||||
file_url = file_desc['link']
|
file_url = file_desc['link']
|
||||||
# log.debug('Texture %r:\n%s', file_uuid, pprint.pformat(file_desc.to_dict()))
|
# log.debug('Texture %r:\n%s', file_uuid, pprint.pformat(file_desc.to_dict()))
|
||||||
loop.call_soon_threadsafe(file_loading, file_path, file_desc)
|
loop.call_soon_threadsafe(file_loading, file_path, file_desc)
|
||||||
@ -450,6 +452,7 @@ async def download_texture(texture_node,
|
|||||||
downloaders = (download_file_by_uuid(file_info['file'],
|
downloaders = (download_file_by_uuid(file_info['file'],
|
||||||
target_directory,
|
target_directory,
|
||||||
metadata_directory,
|
metadata_directory,
|
||||||
|
map_type=file_info['map_type'],
|
||||||
file_loading=texture_loading,
|
file_loading=texture_loading,
|
||||||
file_loaded=texture_loaded,
|
file_loaded=texture_loaded,
|
||||||
future=future)
|
future=future)
|
||||||
|
Reference in New Issue
Block a user