mirror of
https://github.com/ynput/ayon-core.git
synced 2026-01-01 08:24:53 +01:00
moved map_subsets_by_family under BuildWorkfile class
This commit is contained in:
parent
b407291401
commit
83c4696591
2 changed files with 15 additions and 16 deletions
|
|
@ -36,7 +36,6 @@ from .lib_old import (
|
||||||
get_last_version_from_path,
|
get_last_version_from_path,
|
||||||
get_subsets,
|
get_subsets,
|
||||||
get_linked_assets,
|
get_linked_assets,
|
||||||
map_subsets_by_family,
|
|
||||||
BuildWorkfile,
|
BuildWorkfile,
|
||||||
ffprobe_streams,
|
ffprobe_streams,
|
||||||
source_hash,
|
source_hash,
|
||||||
|
|
|
||||||
|
|
@ -608,20 +608,6 @@ def get_linked_assets(asset_entity):
|
||||||
return inputs
|
return inputs
|
||||||
|
|
||||||
|
|
||||||
def map_subsets_by_family(subsets):
|
|
||||||
subsets_by_family = collections.defaultdict(list)
|
|
||||||
for subset in subsets:
|
|
||||||
family = subset["data"].get("family")
|
|
||||||
if not family:
|
|
||||||
families = subset["data"].get("families")
|
|
||||||
if not families:
|
|
||||||
continue
|
|
||||||
family = families[0]
|
|
||||||
|
|
||||||
subsets_by_family[family].append(subset)
|
|
||||||
return subsets_by_family
|
|
||||||
|
|
||||||
|
|
||||||
class BuildWorkfile:
|
class BuildWorkfile:
|
||||||
"""Wrapper for build workfile process.
|
"""Wrapper for build workfile process.
|
||||||
|
|
||||||
|
|
@ -629,6 +615,20 @@ class BuildWorkfile:
|
||||||
are host related, since each host has it's loaders.
|
are host related, since each host has it's loaders.
|
||||||
"""
|
"""
|
||||||
|
|
||||||
|
@staticmethod
|
||||||
|
def map_subsets_by_family(subsets):
|
||||||
|
subsets_by_family = collections.defaultdict(list)
|
||||||
|
for subset in subsets:
|
||||||
|
family = subset["data"].get("family")
|
||||||
|
if not family:
|
||||||
|
families = subset["data"].get("families")
|
||||||
|
if not families:
|
||||||
|
continue
|
||||||
|
family = families[0]
|
||||||
|
|
||||||
|
subsets_by_family[family].append(subset)
|
||||||
|
return subsets_by_family
|
||||||
|
|
||||||
def process(self):
|
def process(self):
|
||||||
"""Main method of this wrapper.
|
"""Main method of this wrapper.
|
||||||
|
|
||||||
|
|
@ -901,7 +901,7 @@ class BuildWorkfile:
|
||||||
:rtype: dict
|
:rtype: dict
|
||||||
"""
|
"""
|
||||||
# Prepare subsets
|
# Prepare subsets
|
||||||
subsets_by_family = map_subsets_by_family(subsets)
|
subsets_by_family = self.map_subsets_by_family(subsets)
|
||||||
|
|
||||||
profiles_per_subset_id = {}
|
profiles_per_subset_id = {}
|
||||||
for family, subsets in subsets_by_family.items():
|
for family, subsets in subsets_by_family.items():
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue