diff --git a/Source/WetPicsRebirth/Commands/ServiceCommands/Posting/PostNext.cs b/Source/WetPicsRebirth/Commands/ServiceCommands/Posting/PostNext.cs index 05e0d00..92de457 100644 --- a/Source/WetPicsRebirth/Commands/ServiceCommands/Posting/PostNext.cs +++ b/Source/WetPicsRebirth/Commands/ServiceCommands/Posting/PostNext.cs @@ -125,7 +125,7 @@ private async Task PostNextForActress(Actress actress, params int[] skipIds) } } - if (loadedPost.Post.FileSize > 50_000_000) + if (ShouldSkip(loadedPost)) { var newSkipIds = skipIds.Append(loadedPost.Post.PostHeader.Id).ToArray(); await PostNextForActress(actress, newSkipIds); @@ -149,6 +149,8 @@ await _postedMediaRepository.Add( await post.File.DisposeAsync(); } + private static bool ShouldSkip(LoadedPost loadedPost) => loadedPost.Post.FileSize > 50_000_000; + private async Task<(Message sentPost, string fileId, MediaType fileType)> SentPostToTelegram( Actress actress, Post post) diff --git a/Source/WetPicsRebirth/Infrastructure/Engines/BooruEngine.cs b/Source/WetPicsRebirth/Infrastructure/Engines/BooruEngine.cs index b3cc83b..1abebb1 100644 --- a/Source/WetPicsRebirth/Infrastructure/Engines/BooruEngine.cs +++ b/Source/WetPicsRebirth/Infrastructure/Engines/BooruEngine.cs @@ -70,7 +70,10 @@ async Task LoadPostCore() } private static string GetMediaUrl(Imouto.BooruParser.Post post) - => post.OriginalUrl?.EndsWith(".zip") == true ? post.SampleUrl! : post.OriginalUrl!; + => post.OriginalUrl?.EndsWith(".zip") == true + || post.OriginalUrl?.EndsWith(".webm") == true + ? post.SampleUrl! + : post.OriginalUrl!; public string CreateCaption(ImageSource source, string options, Post post) {