mirror of
https://github.com/meeb/tubesync.git
synced 2025-06-25 14:36:34 +00:00
Update directory_and_stem
in utils.py
This commit is contained in:
parent
2222a146b6
commit
360b39ebcf
@ -13,11 +13,10 @@ from pathlib import Path
|
|||||||
from urllib.parse import urlunsplit, urlencode, urlparse
|
from urllib.parse import urlunsplit, urlencode, urlparse
|
||||||
from .errors import DatabaseConnectionError
|
from .errors import DatabaseConnectionError
|
||||||
|
|
||||||
|
def directory_and_stem(arg_path, /, all_suffixes=False):
|
||||||
def directory_and_stem(arg_path, /):
|
|
||||||
filepath = Path(arg_path)
|
filepath = Path(arg_path)
|
||||||
stem = Path(filepath.stem)
|
stem = Path(filepath.stem)
|
||||||
while stem.suffixes and '' != stem.suffix:
|
while all_suffixes and stem.suffixes and '' != stem.suffix:
|
||||||
stem = Path(stem.stem)
|
stem = Path(stem.stem)
|
||||||
return (filepath.parent, str(stem),)
|
return (filepath.parent, str(stem),)
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user