Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix lockup when downloading clips with metadata #907

Merged
merged 2 commits into from
Nov 28, 2023

Conversation

@ScrubN ScrubN closed this Nov 28, 2023
@ScrubN ScrubN reopened this Nov 28, 2023
@ScrubN ScrubN changed the title Change generated clip temp file name Fix lockup when downloading clips with metadata Nov 28, 2023
@@ -63,7 +63,7 @@ void DownloadProgressHandler(StreamCopyProgress streamProgress)
TwitchHelper.CreateDirectory(downloadOptions.TempFolder);
}

var tempFile = Path.Combine(downloadOptions.TempFolder, $"clip_{DateTimeOffset.Now.ToUnixTimeMilliseconds()}_{Path.GetRandomFileName()}");
var tempFile = Path.Combine(downloadOptions.TempFolder, $"{downloadOptions.Id}_{DateTimeOffset.UtcNow.Ticks}.mp4");
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Using DateTimeOffset.UtcNow.Ticks instead of DateTimeOffset.UtcNow.ToUnixTimeMilliseconds() is necessary to avoid conflicting names if the same url is pasted more than once in url mass downloader. Yes I could have left the name as it was before, but this name is more friendly to end users.

@ScrubN ScrubN merged commit 4b74386 into lay295:master Nov 28, 2023
3 checks passed
@ScrubN ScrubN deleted the clip-metadata-fix branch November 28, 2023 23:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
1 participant