From: Christian Heller Date: Wed, 25 Dec 2024 19:59:20 +0000 (+0100) Subject: Fix sync using from hash representation for retrieving "missing" files. X-Git-Url: https://plomlompom.com/repos/%7B%7B%20web_path%20%7D%7D/decks/%7B%7Bdeck_id%7D%7D/%7B%7Bprefix%7D%7D?a=commitdiff_plain;h=66897c5d22ce9a7495668162c92b6c1702a799ab;p=ytplom Fix sync using from hash representation for retrieving "missing" files. --- diff --git a/src/sync.py b/src/sync.py index dde4348..bd7a74a 100755 --- a/src/sync.py +++ b/src/sync.py @@ -8,7 +8,7 @@ from urllib.request import urlopen # non-included libs from paramiko import SSHClient # type: ignore from scp import SCPClient # type: ignore -from ytplom.db import DbConn, PATH_DB +from ytplom.db import DbConn, Hash, PATH_DB from ytplom.misc import ( PATH_TEMP, Config, QuotaLog, VideoFile, YoutubeQuery, YoutubeVideo) from ytplom.http import PAGE_NAMES @@ -101,7 +101,7 @@ def fill_missing(scp: SCPClient, config: Config) -> None: direction, mover = direction_mover for digest in (d for d in missings[i] if d not in missings[int(not bool(i))]): - vf = VideoFile.get_one(conn, digest) + vf = VideoFile.get_one(conn, Hash.from_b64(digest)) print(f'SYNC: sending {direction} file {vf.full_path}') mover(vf.full_path, vf.full_path)