Is gloss source logic removal - metadata handling update
This commit is contained in:
@@ -383,7 +383,6 @@ class LLMPredictionHandler(BasePredictionHandler):
|
||||
item_type_override=file_type, # Initial override based on LLM
|
||||
target_asset_name_override=group_name,
|
||||
output_format_override=None,
|
||||
is_gloss_source=False,
|
||||
resolution_override=None,
|
||||
channel_merge_instructions={}
|
||||
)
|
||||
|
||||
@@ -53,9 +53,9 @@ def classify_files(file_list: List[str], config: Configuration) -> Dict[str, Lis
|
||||
Example:
|
||||
{
|
||||
'AssetName1': [
|
||||
{'file_path': '/path/to/AssetName1_DISP16.png', 'item_type': 'DISP', 'asset_name': 'AssetName1', 'is_gloss_source': False},
|
||||
{'file_path': '/path/to/AssetName1_DISP.png', 'item_type': 'EXTRA', 'asset_name': 'AssetName1', 'is_gloss_source': False},
|
||||
{'file_path': '/path/to/AssetName1_Color.png', 'item_type': 'COL', 'asset_name': 'AssetName1', 'is_gloss_source': False}
|
||||
{'file_path': '/path/to/AssetName1_DISP16.png', 'item_type': 'DISP', 'asset_name': 'AssetName1'},
|
||||
{'file_path': '/path/to/AssetName1_DISP.png', 'item_type': 'EXTRA', 'asset_name': 'AssetName1'},
|
||||
{'file_path': '/path/to/AssetName1_Color.png', 'item_type': 'COL', 'asset_name': 'AssetName1'}
|
||||
],
|
||||
# ... other assets
|
||||
}
|
||||
@@ -133,7 +133,6 @@ def classify_files(file_list: List[str], config: Configuration) -> Dict[str, Lis
|
||||
if match:
|
||||
log.debug(f"PASS 1: File '{filename}' matched PRIORITIZED bit depth variant for type '{target_type}'.")
|
||||
matched_item_type = target_type
|
||||
is_gloss_flag = False
|
||||
|
||||
if (asset_name, matched_item_type) in primary_assignments:
|
||||
log.warning(f"PASS 1: Primary assignment ({asset_name}, {matched_item_type}) already exists. File '{filename}' will be handled in Pass 2.")
|
||||
@@ -145,8 +144,7 @@ def classify_files(file_list: List[str], config: Configuration) -> Dict[str, Lis
|
||||
temp_grouped_files[asset_name].append({
|
||||
'file_path': file_path_str,
|
||||
'item_type': matched_item_type,
|
||||
'asset_name': asset_name,
|
||||
'is_gloss_source': is_gloss_flag
|
||||
'asset_name': asset_name
|
||||
})
|
||||
processed_in_pass1.add(file_path_str)
|
||||
processed = True
|
||||
@@ -183,12 +181,11 @@ def classify_files(file_list: List[str], config: Configuration) -> Dict[str, Lis
|
||||
for compiled_regex, original_keyword, rule_index in patterns_list:
|
||||
match = compiled_regex.search(filename)
|
||||
if match:
|
||||
is_gloss_flag = False
|
||||
try:
|
||||
map_type_mapping_list = config.map_type_mapping
|
||||
matched_rule_details = map_type_mapping_list[rule_index]
|
||||
is_gloss_flag = matched_rule_details.get('is_gloss_source', False)
|
||||
log.debug(f" PASS 2: Match found! Rule Index: {rule_index}, Keyword: '{original_keyword}', Target: '{target_type}', Gloss: {is_gloss_flag}")
|
||||
# map_type_mapping_list = config.map_type_mapping # Old gloss logic source
|
||||
# matched_rule_details = map_type_mapping_list[rule_index] # Old gloss logic source
|
||||
# is_gloss_flag = matched_rule_details.get('is_gloss_source', False) # Old gloss logic
|
||||
log.debug(f" PASS 2: Match found! Rule Index: {rule_index}, Keyword: '{original_keyword}', Target: '{target_type}'") # Removed Gloss from log
|
||||
except Exception as e:
|
||||
log.exception(f" PASS 2: Error accessing rule details for index {rule_index}: {e}")
|
||||
|
||||
@@ -196,7 +193,7 @@ def classify_files(file_list: List[str], config: Configuration) -> Dict[str, Lis
|
||||
if (asset_name, target_type) in primary_assignments:
|
||||
log.debug(f"PASS 2: File '{filename}' matched '{original_keyword}' for type '{target_type}', but primary already assigned via Pass 1. Classifying as EXTRA.")
|
||||
matched_item_type = "EXTRA"
|
||||
is_gloss_flag = False
|
||||
# is_gloss_flag = False # Old gloss logic
|
||||
else:
|
||||
log.debug(f"PASS 2: File '{filename}' matched '{original_keyword}' for item_type '{target_type}'.")
|
||||
matched_item_type = target_type
|
||||
@@ -204,8 +201,7 @@ def classify_files(file_list: List[str], config: Configuration) -> Dict[str, Lis
|
||||
temp_grouped_files[asset_name].append({
|
||||
'file_path': file_path_str,
|
||||
'item_type': matched_item_type,
|
||||
'asset_name': asset_name,
|
||||
'is_gloss_source': is_gloss_flag
|
||||
'asset_name': asset_name
|
||||
})
|
||||
is_map = True
|
||||
break
|
||||
@@ -218,8 +214,7 @@ def classify_files(file_list: List[str], config: Configuration) -> Dict[str, Lis
|
||||
temp_grouped_files[asset_name].append({
|
||||
'file_path': file_path_str,
|
||||
'item_type': "FILE_IGNORE",
|
||||
'asset_name': asset_name,
|
||||
'is_gloss_source': False
|
||||
'asset_name': asset_name
|
||||
})
|
||||
|
||||
log.debug("--- Finished Pass 2 ---")
|
||||
@@ -264,8 +259,7 @@ def classify_files(file_list: List[str], config: Configuration) -> Dict[str, Lis
|
||||
temp_grouped_files[final_primary_asset_name].append({
|
||||
'file_path': file_path_str,
|
||||
'item_type': "EXTRA",
|
||||
'asset_name': final_primary_asset_name,
|
||||
'is_gloss_source': False
|
||||
'asset_name': final_primary_asset_name
|
||||
})
|
||||
else:
|
||||
log.debug(f"Skipping duplicate association of extra file: {filename}")
|
||||
@@ -477,7 +471,7 @@ class RuleBasedPredictionHandler(BasePredictionHandler):
|
||||
final_item_type = "FILE_IGNORE"
|
||||
|
||||
|
||||
is_gloss_source_value = file_info.get('is_gloss_source', False)
|
||||
# is_gloss_source_value = file_info.get('is_gloss_source', False) # Removed
|
||||
|
||||
file_rule = FileRule(
|
||||
file_path=file_info['file_path'],
|
||||
@@ -485,7 +479,7 @@ class RuleBasedPredictionHandler(BasePredictionHandler):
|
||||
item_type_override=final_item_type,
|
||||
target_asset_name_override=target_asset_name_override,
|
||||
output_format_override=None,
|
||||
is_gloss_source=is_gloss_source_value if isinstance(is_gloss_source_value, bool) else False,
|
||||
# is_gloss_source=is_gloss_source_value if isinstance(is_gloss_source_value, bool) else False, # Removed
|
||||
resolution_override=None,
|
||||
channel_merge_instructions={},
|
||||
)
|
||||
|
||||
Reference in New Issue
Block a user