Skip to content

Commit

Permalink
Added the ability to create a folder hierarchy
Browse files Browse the repository at this point in the history
  • Loading branch information
ISkIN committed Feb 19, 2023
1 parent 3c1be30 commit 7d9d80e
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions qobuz_dl/downloader.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
from typing import Tuple

import requests
from pathvalidate import sanitize_filename
from pathvalidate import sanitize_filename, sanitize_filepath
from tqdm import tqdm

import qobuz_dl.metadata as metadata
Expand Down Expand Up @@ -97,7 +97,7 @@ def download_release(self):
folder_format, track_format = _clean_format_str(
self.folder_format, self.track_format, file_format
)
sanitized_title = sanitize_filename(folder_format.format(**album_attr))
sanitized_title = sanitize_filepath(folder_format.format(**album_attr))
dirn = os.path.join(self.path, sanitized_title)
os.makedirs(dirn, exist_ok=True)

Expand Down Expand Up @@ -156,7 +156,7 @@ def download_track(self):
track_attr = self._get_track_attr(
meta, track_title, bit_depth, sampling_rate
)
sanitized_title = sanitize_filename(folder_format.format(**track_attr))
sanitized_title = sanitize_filepath(folder_format.format(**track_attr))

dirn = os.path.join(self.path, sanitized_title)
os.makedirs(dirn, exist_ok=True)
Expand Down

0 comments on commit 7d9d80e

Please sign in to comment.