Skip to content

Commit b48f3d3

Browse files
authored
refactor: キーフレームのtimedeltaをkey_frame_timeからkey_frameに改名 (#128)
1 parent 7d00bf6 commit b48f3d3

File tree

4 files changed

+10
-10
lines changed

4 files changed

+10
-10
lines changed

aoirint_matvtool/command/key_frames.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -20,11 +20,11 @@ async def execute_key_frames_cli(
2020
ffprobe_path=ffprobe_path,
2121
)
2222

23-
key_frame_times = await key_frame_parser.parse_key_frame_times(
23+
key_frames = await key_frame_parser.parse_key_frames(
2424
input_path=input_path,
2525
)
26-
for time in key_frame_times:
27-
print(f"{time.total_seconds():.06f}")
26+
for key_frame in key_frames:
27+
print(f"{key_frame.total_seconds():.06f}")
2828

2929

3030
async def handle_key_frames_cli(args: Namespace) -> None:

aoirint_matvtool/utility/key_frame_time_fitter.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ async def fit_time(
2121
指定した時間に最も近く、指定した時間より前にあるキーフレームの時間を返す
2222
"""
2323

24-
key_frames = await self._key_frame_parser.parse_key_frame_times(
24+
key_frames = await self._key_frame_parser.parse_key_frames(
2525
input_path=video_path,
2626
)
2727

aoirint_matvtool/video_utility/key_frame_parser.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ def __init__(
1717
self._fps_parser = fps_parser
1818
self._ffprobe_path = ffprobe_path
1919

20-
async def parse_key_frame_times(
20+
async def parse_key_frames(
2121
self,
2222
input_path: Path,
2323
) -> list[timedelta]:
@@ -53,7 +53,7 @@ async def parse_key_frame_times(
5353

5454
stdout_lines = stdout.strip().splitlines()
5555

56-
key_frame_times: list[timedelta] = []
56+
key_frames: list[timedelta] = []
5757
for line in stdout_lines:
5858
line = line.strip()
5959
if not line:
@@ -80,7 +80,7 @@ async def parse_key_frame_times(
8080

8181
seconds = float(seconds_string)
8282

83-
time = timedelta(seconds=seconds)
84-
key_frame_times.append(time)
83+
key_frame = timedelta(seconds=seconds)
84+
key_frames.append(key_frame)
8585

86-
return key_frame_times
86+
return key_frames

tests/test_key_frame_parser.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ async def test_key_frame_parser(
1212
) -> None:
1313
input_file = fixture_dir / "sample1.mkv"
1414

15-
key_frames = await key_frame_parser.parse_key_frame_times(
15+
key_frames = await key_frame_parser.parse_key_frames(
1616
input_path=input_file,
1717
)
1818
assert len(key_frames) == 4

0 commit comments

Comments
 (0)