Skip to content
This repository has been archived by the owner on Apr 13, 2024. It is now read-only.

Commit

Permalink
Adds FileContainer parameter
Browse files Browse the repository at this point in the history
And use mp4 as default container (this fixes wrong duration on files from crunchyroll)
  • Loading branch information
Marcos Cordeiro committed Nov 13, 2023
1 parent c326d32 commit ec8e12a
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 1 deletion.
3 changes: 2 additions & 1 deletion Wasari.App/GenericDownloadService.cs
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,8 @@ private StringBuilder BuildEpisodeName(IWasariEpisode episode)
if (episode.Number.HasValue || episode.SeasonNumber.HasValue)
episodeNameBuilder.Append(" - ");
episodeNameBuilder.Append(episode.Title);
episodeNameBuilder.Append(FFmpegOptions.Value.UseHevc ? ".mkv" : ".mp4");
episodeNameBuilder.Append('.');
episodeNameBuilder.Append(FFmpegOptions.Value.FileContainer);
return episodeNameBuilder;
}
}
4 changes: 4 additions & 0 deletions Wasari.Cli/Commands/DownloadCommand.cs
Original file line number Diff line number Diff line change
Expand Up @@ -105,6 +105,9 @@ public DownloadCommand(EnvironmentService environmentService, ILogger<DownloadCo

[CommandOption("webhook-url", Description = "Webhook URL to send notifications to", EnvironmentVariable = "WASARI_WEBHOOK_URL")]
public Uri? WebhookUrl { get; init; }

[CommandOption("file-container", Description = "File container to use for final video file")]
public string FileContainer { get; set; } = "mp4";

private EnvironmentService EnvironmentService { get; }

Expand Down Expand Up @@ -158,6 +161,7 @@ public async ValueTask ExecuteAsync(IConsole console)
o.Shaders = Shaders;
o.Resolution = Resolution;
o.Threads = FfmpegThreads;
o.FileContainer = FileContainer;
});
serviceCollection.Configure<AuthenticationOptions>(o =>
{
Expand Down
2 changes: 2 additions & 0 deletions Wasari.FFmpeg/FFmpegOptions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@ namespace Wasari.FFmpeg;
public record FFmpegOptions
{
public bool UseHevc { get; set; }

public string FileContainer { get; set; } = "mp4";

public IFFmpegShader[]? Shaders { get; set; }

Expand Down

0 comments on commit ec8e12a

Please sign in to comment.