about summary refs log tree commit diff stats
diff options
context:
space:
mode:
authorBenedikt Peetz <benedikt.peetz@b-peetz.de>2024-08-21 19:48:41 +0200
committerBenedikt Peetz <benedikt.peetz@b-peetz.de>2024-08-21 19:48:41 +0200
commit269cf79c5e25b6b3440ad11dee4b0662cdc74221 (patch)
treefff306e1fd44c64dadd8733c76cb0748610ebad9
parentbuild(flake): Wrap the yt binary with the required dependencies (diff)
downloadyt-269cf79c5e25b6b3440ad11dee4b0662cdc74221.tar.gz
yt-269cf79c5e25b6b3440ad11dee4b0662cdc74221.zip
docs(yt_dlp/lib): Improve some comments
-rw-r--r--src/update/mod.rs2
-rw-r--r--yt_dlp/src/lib.rs2
2 files changed, 3 insertions, 1 deletions
diff --git a/src/update/mod.rs b/src/update/mod.rs
index 23b17f9..bdd6c27 100644
--- a/src/update/mod.rs
+++ b/src/update/mod.rs
@@ -70,6 +70,8 @@ pub async fn update(
     )
     .lines();
 
+    // We can get away with not having to re-fetch the hashes every time, as the returned video
+    // should not contain duplicates.
     let hashes = get_all_hashes(app).await?;
 
     while let Some(line) = out.next_line().await? {
diff --git a/yt_dlp/src/lib.rs b/yt_dlp/src/lib.rs
index 5bb02c1..27f1a58 100644
--- a/yt_dlp/src/lib.rs
+++ b/yt_dlp/src/lib.rs
@@ -331,8 +331,8 @@ pub async fn download(
         info!("Started downloading url: '{}'", url);
         let info_json = extract_info(download_options, url, true, true).await?;
 
+        // Try to work around yt-dlp type weirdness
         let result_string = if let Some(filename) = info_json.filename {
-            // Try to work around yt-dlp type weirdness
             filename
         } else {
             (&info_json.requested_downloads.expect("This must exist")[0].filename).to_owned()