Fix some songs not downloading hopefully

This commit is contained in:
2026-10-16 00:00:56 -05:00
parent e62d9f5c1d
commit a8658fdc4c
3 changed files with 23 additions and 53 deletions
View File
-33
View File
@@ -1,33 +0,0 @@
version: 43
jobs:
- name: build
steps:
- type: CheckoutStep
name: Checkout code
cloneCredential:
type: DefaultCredential
withLfs: true
withSubmodules: true
cloneDepth: 1
condition: SUCCESSFUL
optional: false
- type: BuildImageStep
name: build image
output:
type: RegistryOutput
tags: onedev.site.tesses.net/tytd2025/tytdcompanion/tytdcompanion:latest
registryLogins:
- registryUrl: '@server_url@'
userName: '@job_token@'
passwordSecret: dockersecret
condition: SUCCESSFUL
optional: false
triggers:
- type: BranchUpdateTrigger
branches: master
userMatch: anyone
projects: tytd2025/tytdcompanion
retryCondition: never
maxRetries: 3
retryDelay: 30
timeout: 14400
+9 -6
View File
@@ -17,6 +17,7 @@ using YoutubeExplode.Search;
using YouTubeMusicAPI.Client;
using YouTubeMusicAPI.Models.Search;
using YouTubeMusicAPI.Pagination;
using System.Net.Http.Headers;
@@ -896,12 +897,14 @@ namespace Tesses.YouTubeDownloader2025Companion
string path = mId.ToString();
if (File.Exists(path))
{
ContentDisposition disposition = new ContentDisposition();
disposition.FileName = Path.GetFileName(path);
disposition.Inline = inline;
disposition.ModificationDate = File.GetLastWriteTime(path);
disposition.CreationDate = File.GetCreationTime(path);
ctx.ResponseHeaders["Content-Disposition"] = [disposition.ToString()];
string filename = Path.GetFileName(path);
var cd = new ContentDispositionHeaderValue(inline ? "inline":"attachment");
cd.ModificationDate = File.GetLastWriteTime(path);
cd.CreationDate = File.GetCreationTime(path);
cd.FileName = filename;
cd.FileNameStar = filename; // auto-encodes to RFC 5987
ctx.ResponseHeaders["Content-Disposition"] = [cd.ToString()];
await ctx.SendFileAsync(path);
return;
}