[TB] fix: download urls still not returning filename via HEAD.

This commit is contained in:
Sam Heinz 2025-03-16 19:49:03 +10:00
parent fd7bc529c8
commit 9d57466472

View file

@ -322,6 +322,15 @@ public class TorBoxTorrentClient(ILogger<TorBoxTorrentClient> logger, IHttpClien
{
return fileName.Trim('"');
}
} else
{
if (response.Content.Headers.ContentType?.MediaType == "application/zip")
{
return $"download-{new Random().Next(1, 10001)}.zip";
} else
{
logger.LogDebug($"Failed to get filename for URI {downloadUrl}");
}
}
}