finished Skin UGC
This commit is contained in:
@@ -42,6 +42,7 @@ from .zips import (
|
||||
read_pack_meta,
|
||||
read_pack_mcmeta,
|
||||
read_plugins_manifest,
|
||||
read_skins_manifest,
|
||||
)
|
||||
|
||||
|
||||
@@ -333,6 +334,7 @@ def project_detail(request, slug):
|
||||
logical_manifest = None
|
||||
mods_manifest = None
|
||||
plugins_manifest = None
|
||||
skins_manifest = None
|
||||
anim_stats = None
|
||||
latest = versions.first()
|
||||
if project.category == 'guide' and latest is not None:
|
||||
@@ -343,6 +345,7 @@ def project_detail(request, slug):
|
||||
logical_manifest = latest.logical_manifest or None
|
||||
mods_manifest = latest.mods_manifest or None
|
||||
plugins_manifest = latest.plugins_manifest or None
|
||||
skins_manifest = latest.skins_manifest or None
|
||||
if animation_manifest:
|
||||
anims = animation_manifest.get('animations') or []
|
||||
entity_count = sum(1 for a in anims if a.get('type') == 'Entity x Player')
|
||||
@@ -376,6 +379,7 @@ def project_detail(request, slug):
|
||||
'logical_manifest': logical_manifest,
|
||||
'mods_manifest': mods_manifest,
|
||||
'plugins_manifest': plugins_manifest,
|
||||
'skins_manifest': skins_manifest,
|
||||
'autoload_plugins_json': autoload_plugins_json,
|
||||
'anim_stats': anim_stats,
|
||||
}
|
||||
@@ -652,6 +656,7 @@ def _reparse_version(version):
|
||||
version.models_manifest = read_models_manifest(path, version.project.category) or {}
|
||||
version.logical_manifest = read_logical_manifest(path) or {}
|
||||
version.plugins_manifest = read_plugins_manifest(path) or {} if version.project.category == 'model' else {}
|
||||
version.skins_manifest = read_skins_manifest(path) or {} if version.project.category == 'skin' else {}
|
||||
manifest = parse_mods_manifest(path, release.file.original_filename)
|
||||
version.mods_manifest = manifest if manifest.get('files') else {}
|
||||
fmt, desc = read_pack_mcmeta(path)
|
||||
@@ -674,6 +679,7 @@ def _finalize_version(project, version_name, changelog, temp_uploads, actor):
|
||||
pack_description = ''
|
||||
mods_manifest = {}
|
||||
plugins_manifest = None
|
||||
skins_manifest = None
|
||||
animation_id = ''
|
||||
animation_manifest = None
|
||||
models_manifest = None
|
||||
@@ -718,6 +724,8 @@ def _finalize_version(project, version_name, changelog, temp_uploads, actor):
|
||||
mods_manifest = manifest
|
||||
if plugins_manifest is None and project.category == 'model':
|
||||
plugins_manifest = read_plugins_manifest(path)
|
||||
if skins_manifest is None and project.category == 'skin':
|
||||
skins_manifest = read_skins_manifest(path)
|
||||
|
||||
update_fields = []
|
||||
if pack_format is not None:
|
||||
@@ -730,6 +738,9 @@ def _finalize_version(project, version_name, changelog, temp_uploads, actor):
|
||||
if plugins_manifest is not None:
|
||||
version.plugins_manifest = plugins_manifest
|
||||
update_fields.append('plugins_manifest')
|
||||
if skins_manifest is not None:
|
||||
version.skins_manifest = skins_manifest
|
||||
update_fields.append('skins_manifest')
|
||||
if animation_id:
|
||||
version.animation_id = animation_id
|
||||
update_fields.append('animation_id')
|
||||
|
||||
Reference in New Issue
Block a user