Skip to content

Commit

Permalink
Fixed filepaths to copy after moving org dir
Browse files Browse the repository at this point in the history
beveradb committed Jan 17, 2025
1 parent dfdbd92 commit 595fbbc
Showing 3 changed files with 17 additions and 14 deletions.
13 changes: 8 additions & 5 deletions karaoke_prep/karaoke_finalise/karaoke_finalise.py
Original file line number Diff line number Diff line change
@@ -776,11 +776,11 @@ def move_files_to_brand_code_folder(self, brand_code, artist, title, output_file
self.new_brand_code_dir = f"{brand_code} - {artist} - {title}"
self.new_brand_code_dir_path = os.path.join(self.organised_dir, self.new_brand_code_dir)

self.prompt_user_confirmation_or_raise_exception(
f"Move files to new brand-prefixed directory {self.new_brand_code_dir_path} and delete current dir?",
"Refusing to move files without user confirmation of move.",
allow_empty=True,
)
# self.prompt_user_confirmation_or_raise_exception(
# f"Move files to new brand-prefixed directory {self.new_brand_code_dir_path} and delete current dir?",
# "Refusing to move files without user confirmation of move.",
# allow_empty=True,
# )

orig_dir = os.getcwd()
os.chdir(os.path.dirname(orig_dir))
@@ -923,6 +923,9 @@ def execute_optional_features(self, artist, title, base_name, input_files, outpu
else:
self.brand_code = self.get_next_brand_code()
self.move_files_to_brand_code_folder(self.brand_code, artist, title, output_files)
# Update output file paths after moving
for key in output_files:
output_files[key] = os.path.join(self.new_brand_code_dir_path, os.path.basename(output_files[key]))

if self.public_share_copy_enabled:
self.copy_final_files_to_public_share_dirs(self.brand_code, base_name, output_files)
16 changes: 8 additions & 8 deletions karaoke_prep/utils/finalise_cli.py
Original file line number Diff line number Diff line change
@@ -223,14 +223,6 @@ def main():
logger.info(f"")
logger.info(f"Sharing:")

if track["youtube_url"]:
logger.info(f" YouTube URL: {track['youtube_url']}")
try:
pyperclip.copy(track["youtube_url"])
logger.info(f" (YouTube URL copied to clipboard)")
except Exception as e:
logger.warning(f" Failed to copy YouTube URL to clipboard: {str(e)}")

if track["brand_code_dir_sharing_link"]:
logger.info(f" Folder Link: {track['brand_code_dir_sharing_link']}")
try:
@@ -240,6 +232,14 @@ def main():
except Exception as e:
logger.warning(f" Failed to copy folder link to clipboard: {str(e)}")

if track["youtube_url"]:
logger.info(f" YouTube URL: {track['youtube_url']}")
try:
pyperclip.copy(track["youtube_url"])
logger.info(f" (YouTube URL copied to clipboard)")
except Exception as e:
logger.warning(f" Failed to copy YouTube URL to clipboard: {str(e)}")


if __name__ == "__main__":
main()
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.36.0"
version = "0.36.1"
description = "Prepare for karaoke video creation, by downloading audio and lyrics for a specified song or playlist from youtube and separating audio stems. After syncing, finalise the video with a title screen!"
authors = ["Andrew Beveridge <andrew@beveridge.uk>"]
license = "MIT"

0 comments on commit 595fbbc

Please sign in to comment.