Peter Simons [Wed, 21 Jun 2023 14:46:54 +0000 (16:46 +0200)]
Adapt code to optparse-applicative 0.18.1 and later.
optparse-applicative switched to the 'prettyprinter' library in its latest
release, which means the 'H.text' function has disappeared. Instead, 'H.pretty'
can be used to convert all 'Pretty a' types into a renderable document.
Joey Hess [Tue, 20 Jun 2023 18:55:25 +0000 (14:55 -0400)]
display destination file before youtube-dl download
Rather than after it, which can leave one wondering what file it's
downloading.
youtubeDl should not ever return Right Nothing in normal operation,
becaause it's already asked youtube-dl if it supports the url. So it
would have to succeed at that, then not download any file, but also
exit successfully, in order for the new error message to display.
Joey Hess [Mon, 19 Jun 2023 19:01:47 +0000 (15:01 -0400)]
Improve resuming interrupted download when using yt-dlp or youtube-dl
Fixes a failure like this:
curl: (33) HTTP server doesn't seem to support byte ranges. Cannot resume.
That happens because the whole web page has already been downloaded
previously, and kept, so now addurl tries to download it, and curl asks the
server to resume from the last byte. And youtube.com can't, for whatever
stupid reason.
So, delete the temp file after determining that youtube-dl can be used.
Joey Hess [Mon, 19 Jun 2023 18:23:14 +0000 (14:23 -0400)]
Improve resuming interrupted download when using yt-dlp
Sometimes resuming an interrupted download will fail to resume and download
more files with different names. That resulted in the workdir having
multiple files at the end, which causes git-annex to give up because it
does not know what was downloaded.
To fix this, use a yt-dlp feature, which appends to a file the name of each
file after it's finished downloading it. So the presence of other cruft in
the workdir will not confuse git-annex.
Joey Hess [Mon, 19 Jun 2023 16:09:18 +0000 (12:09 -0400)]
assistant: Fix a crash when a small file is deleted immediately after being created
git add will fail if the file got deleted in the meantime. And since it was
queued, there was a window until the queue flushed where a deletion of the
file would cause a crash.
Instead, reuse Command.Add.addFile, which sha1 hashes the file itself
immediately, and then queues the index update. Ignore exceptions that will
happen if the file got deleted already.
Joey Hess [Mon, 19 Jun 2023 15:24:32 +0000 (11:24 -0400)]
skip sending individual files to export remotes
That will fail, and it already exports whole trees. f6dd34ca817bdf38d7b8d79be3ed626a266e3232 made it sync content with
import remotes, and if an import remote is also an export remote, that
caused this new failure mode.
Joey Hess [Thu, 15 Jun 2023 14:01:42 +0000 (10:01 -0400)]
Fix display when run with -J1
Commit b6642dde8a49f34d7983a40e99bf7032a731c964 broke it by enabling
non-concurrent display mode while leaving concurrency set in the config
and having already started concurrency earlier.
(I don't actually know if that commit was a good idea.)