Skip to content

Commit

Permalink
Merge pull request #40 from EmberLightVFX/enhancement/catch_empty_str…
Browse files Browse the repository at this point in the history
…_when_calc_end_frame

Catch empty strings in calculate_end_frame()
  • Loading branch information
martastain authored Apr 2, 2024
2 parents 39d85de + d660141 commit 7560b02
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions server/kitsu/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,15 +16,15 @@ def calculate_end_frame(
entity_dict: dict[str, int], folder: FolderEntity
) -> int | None:
# Calculate the end-frame
if entity_dict.get("nb_frames") and not entity_dict["data"].get("frame_out"):
frame_start = entity_dict["data"].get("frame_in")
if entity_dict.get("nb_frames") and entity_dict["data"].get("frame_out", "") != "":
frame_start = entity_dict["data"].get("frame_in", "")
# If kitsu doesn't have a frame in, get it from the folder in Ayon
if frame_start is None:
if frame_start == "":
for key, value in folder.attrib:
if key == "frameStart":
frame_start = value
break
if frame_start is not None:
if frame_start != "":
return frame_start + entity_dict["nb_frames"]


Expand Down

0 comments on commit 7560b02

Please sign in to comment.