Skip to content

Commit

Permalink
Fixed title screen rendering bug
Browse files Browse the repository at this point in the history
  • Loading branch information
beveradb committed Dec 20, 2023
1 parent 341a346 commit 0c77999
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 6 deletions.
15 changes: 10 additions & 5 deletions karaoke_prep/karaoke_prep.py
Original file line number Diff line number Diff line change
Expand Up @@ -171,7 +171,7 @@ def write_lyrics_from_genius(self, artist, title, filename):
f.write(lyrics)

self.logger.info("Lyrics for %s by %s fetched successfully", title, artist)
return lyrics.split('\n')
return lyrics.split("\n")
else:
self.logger.warning("Could not find lyrics for %s by %s", title, artist)

Expand Down Expand Up @@ -204,7 +204,9 @@ def find_best_split_point(self, line):

for index in comma_indices:
if abs(mid_point - index) < 20: # Roughly the length of two average words
self.logger.debug(f"Found comma at index {index} which is within 20 characters of mid_point {mid_point}, accepting as split point")
self.logger.debug(
f"Found comma at index {index} which is within 20 characters of mid_point {mid_point}, accepting as split point"
)
return index + 1 # Include the comma in the first line

# Check for 'and'
Expand Down Expand Up @@ -368,8 +370,10 @@ def create_intro_video(self, artist, title, format, output_image_filepath, outpu
"30",
"-i",
output_image_filepath,
"-f lavfi",
"-i anullsrc",
"-f",
"lavfi",
"-i",
"anullsrc",
"-c:v",
"libx264",
"-r",
Expand All @@ -380,7 +384,8 @@ def create_intro_video(self, artist, title, format, output_image_filepath, outpu
"yuv420p",
"-vf",
f"scale={resolution[0]}:{resolution[1]}",
"-c:a aac",
"-c:a",
"aac",
"-shortest",
output_video_filepath,
]
Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[tool.poetry]
name = "karaoke-prep"
version = "0.6.0"
version = "0.6.1"
description = "Prepare for karaoke video creation, by downloading audio and lyrics for a specified song or youtube playlist and separatung audio stems."
authors = ["Andrew Beveridge <andrew@beveridge.uk>"]
license = "MIT"
Expand Down

0 comments on commit 0c77999

Please sign in to comment.