- old_cwd = Path.cwd()
- chdir(PATH_DOWNLOADS)
- for path in [p for p in Path('.').iterdir() if p.is_file()]:
- yt_id = self._id_from_filename(path)
- if path not in known_paths:
- print(f'SYNC: new file {path}, saving to YT ID "{yt_id}".')
- file = VideoFile(digest=None,
- rel_path=path,
- yt_id=yt_id,
- tags_str=VideoFile.tags_default.joined)
+ old_cwd = Path.cwd()
+ chdir(PATH_DOWNLOADS)
+ for path in [p for p in Path('.').iterdir() if p.is_file()]:
+ yt_id = self._id_from_filename(path)
+ if path not in known_paths:
+ print(f'SYNC: new file {path}, saving to YT ID "{yt_id}".')
+ file = VideoFile(digest=None,
+ rel_path=path,
+ yt_id=yt_id,
+ tags_str=VideoFile.tags_default.joined)
+ with DbConn() as conn: