Skip to content

Commit

Permalink
feat(media manager): 媒体整理文件管理中对特殊目录优化
Browse files Browse the repository at this point in the history
  • Loading branch information
hsuyelin authored Sep 2, 2023
2 parents cc399db + e232d78 commit 932b6d5
Show file tree
Hide file tree
Showing 12 changed files with 286 additions and 303 deletions.
217 changes: 0 additions & 217 deletions config/config.yaml

This file was deleted.

21 changes: 20 additions & 1 deletion web/action.py
Original file line number Diff line number Diff line change
Expand Up @@ -4076,6 +4076,25 @@ def __get_sub_path(data):
for f in os.listdir("C:/")]
else:
dirs = [os.path.join("/", f) for f in os.listdir("/")]
elif d == "[SYNC-FOLDERS]":
sync_dirs = []
for id, conf in Sync().get_sync_path_conf().items():
sync_dirs.append(conf["from"])
sync_dirs.append(conf["to"])
dirs = list(set(sync_dirs))
elif d == "[DOWNLOAD-FOLDERS]":
dirs = [path.rstrip('/') for path in Downloader().get_download_visit_dirs()]
elif d == "[MEDIA-FOLDERS]":
media_dirs = []
movie_path = Config().get_config('media').get('movie_path')
tv_path = Config().get_config('media').get('tv_path')
anime_path = Config().get_config('media').get('anime_path')
unknown_path = Config().get_config('media').get('unknown_path')
if movie_path is not None: media_dirs.extend([path.rstrip('/') for path in movie_path])
if tv_path is not None: media_dirs.extend([path.rstrip('/') for path in tv_path])
if anime_path is not None: media_dirs.extend([path.rstrip('/') for path in anime_path])
if unknown_path is not None: media_dirs.extend([path.rstrip('/') for path in unknown_path])
dirs = list(set(media_dirs))
else:
d = os.path.normpath(unquote(d))
if not os.path.isdir(d):
Expand Down Expand Up @@ -4133,7 +4152,7 @@ def __get_hardlinks(data):
def parse_hardlinks(hardlinks):
paths = []
for link in hardlinks:
paths.append(SystemUtils.shorten_path(link["file"], 'left', 2))
paths.append([SystemUtils.shorten_path(link["file"], 'left', 2), link["file"], link["filepath"]])
return paths

r = {}
Expand Down
Loading

0 comments on commit 932b6d5

Please sign in to comment.