mirror of
https://gist.github.com/6ba37e4d4084e858f917e271550ce5f6.git
synced 2024-09-20 00:34:20 +03:00
Small fixes
This commit is contained in:
parent
3f213c6b93
commit
b3020670b7
@ -97,4 +97,5 @@ class Metadata:
|
|||||||
tags.artists.split(" ")[0] or "",
|
tags.artists.split(" ")[0] or "",
|
||||||
datetime.now().strftime('%Y%m%d_%H%M%S')
|
datetime.now().strftime('%Y%m%d_%H%M%S')
|
||||||
)
|
)
|
||||||
|
filename = "".join(x for x in filename if x.isalnum() or x in " ._-()")
|
||||||
return re.sub(r'\s+', ' ', filename).strip()
|
return re.sub(r'\s+', ' ', filename).strip()
|
||||||
|
@ -51,15 +51,16 @@ class PicSorter:
|
|||||||
|
|
||||||
def process(self, inputs: list[str]) -> None:
|
def process(self, inputs: list[str]) -> None:
|
||||||
for input in inputs:
|
for input in inputs:
|
||||||
|
if input.startswith("http"):
|
||||||
|
print("Processing url", input)
|
||||||
|
self.__process_url(input)
|
||||||
|
else:
|
||||||
p = Path(input)
|
p = Path(input)
|
||||||
if p.is_dir():
|
if p.is_dir():
|
||||||
self.__process_folder(p)
|
self.__process_folder(p)
|
||||||
elif p.is_file():
|
elif p.is_file():
|
||||||
print("Processing file", input)
|
print("Processing file", input)
|
||||||
self.__process_file(input)
|
self.__process_file(input)
|
||||||
else:
|
|
||||||
print("Processing url", input)
|
|
||||||
self.__process_url(input)
|
|
||||||
|
|
||||||
def __process_folder(self, dir_input: Path) -> None:
|
def __process_folder(self, dir_input: Path) -> None:
|
||||||
files = {p for p in dir_input.iterdir()
|
files = {p for p in dir_input.iterdir()
|
||||||
|
Loading…
Reference in New Issue
Block a user