Skip to content

Commit

Permalink
Merge pull request #6 from bbtufty/package-name
Browse files Browse the repository at this point in the history
Sanitize JDownloader package name
  • Loading branch information
bbtufty authored Oct 19, 2024
2 parents 898b4ea + d9ac573 commit 5bec5a7
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 1 deletion.
5 changes: 5 additions & 0 deletions CHANGES.rst
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
0.2 (Unreleased)
================

- Ensure package name is valid for JDownloader [#6]

0.1 (2024-10-19)
================

Expand Down
6 changes: 5 additions & 1 deletion nxbrew_dl/nxbrew_dl/nxbrew.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
import os
import time
import shutil
from pathvalidate import sanitize_filename

import myjdapi

Expand Down Expand Up @@ -278,10 +279,13 @@ def download_game(
self.logger.info(f"Downloading {dl_key}: {dl_info['full_name']}")
out_dir = os.path.join(self.user_config["download_dir"], dl_dir)

# Sanitize the package name so we're safe here
package_name = sanitize_filename(name)

self.run_jdownloader(
dl_dict=dl_info,
out_dir=out_dir,
package_name=name,
package_name=package_name,
)

# Update and save out cache
Expand Down
1 change: 1 addition & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ dependencies = [
"discordwebhook>=1.0.3",
"lxml>=0.5.3",
"myjdapi>=1.1.7",
"pathvalidate>=3.2.1",
"PySide6>=6.7.3",
"requests>=2.32.3",
"PyYAML>=6.0.2",
Expand Down

0 comments on commit 5bec5a7

Please sign in to comment.