26 lines
706 B
Python
26 lines
706 B
Python
|
import pathlib
|
||
|
import argparse
|
||
|
|
||
|
from media import Media
|
||
|
|
||
|
def find_all_files(directory: pathlib.Path):
|
||
|
ps = []
|
||
|
for p in directory.rglob('*'):
|
||
|
if "eaDir" not in str(p):
|
||
|
ps.append((p))
|
||
|
return ps
|
||
|
|
||
|
if __name__ == "__main__":
|
||
|
parser = argparse.ArgumentParser(description='convert hardlink to symlink in download folder')
|
||
|
|
||
|
parser.add_argument('Library',
|
||
|
metavar='--library',
|
||
|
type=str,
|
||
|
help='the path to library')
|
||
|
|
||
|
args = parser.parse_args()
|
||
|
path_library = args.Library
|
||
|
paths = find_all_files(pathlib.Path(path_library))
|
||
|
|
||
|
for x in paths:
|
||
|
Media(x).convert_symlink_to_hdlink()
|