Update XML comments

This commit is contained in:
whimsical-c4lic0 2026-02-09 00:55:54 -06:00
parent 407419a819
commit fee9ca1e97
2 changed files with 32 additions and 29 deletions

View File

@ -876,7 +876,7 @@ public class Program(IServiceProvider serviceProvider)
long message_id = Convert.ToInt64(messageUrl.Split("?firstId=")[1]);
long user_id = Convert.ToInt64(messageUrl.Split("/")[6]);
JObject user = await apiService.GetUserInfoById($"/users/list?x[]={user_id.ToString()}");
string username = string.Empty;
string username = "";
Log.Debug($"Message ID: {message_id}");
Log.Debug($"User ID: {user_id}");
@ -1544,7 +1544,7 @@ public class Program(IServiceProvider serviceProvider)
"Posts",
new SpectreProgressReporter(task),
configService.CurrentConfig.GetCreatorFileNameFormatConfig(username)
.PaidPostFileNameFormat ?? string.Empty,
.PaidPostFileNameFormat ?? "",
postInfo,
mediaInfo,
postInfo?.FromUser,
@ -1574,7 +1574,7 @@ public class Program(IServiceProvider serviceProvider)
"Posts",
new SpectreProgressReporter(task),
configService.CurrentConfig.GetCreatorFileNameFormatConfig(username)
.PaidPostFileNameFormat ?? string.Empty,
.PaidPostFileNameFormat ?? "",
postInfo,
mediaInfo,
postInfo?.FromUser,
@ -1694,7 +1694,7 @@ public class Program(IServiceProvider serviceProvider)
"Messages",
new SpectreProgressReporter(task),
configService.CurrentConfig.GetCreatorFileNameFormatConfig(username)
.PaidMessageFileNameFormat ?? string.Empty,
.PaidMessageFileNameFormat ?? "",
messageInfo,
mediaInfo,
messageInfo?.FromUser,
@ -1725,7 +1725,7 @@ public class Program(IServiceProvider serviceProvider)
"Messages",
new SpectreProgressReporter(task),
configService.CurrentConfig.GetCreatorFileNameFormatConfig(username)
.PaidMessageFileNameFormat ?? string.Empty,
.PaidMessageFileNameFormat ?? "",
messageInfo,
mediaInfo,
messageInfo?.FromUser,
@ -1921,7 +1921,7 @@ public class Program(IServiceProvider serviceProvider)
"Messages",
new SpectreProgressReporter(task),
configService.CurrentConfig.GetCreatorFileNameFormatConfig(username)
.PaidMessageFileNameFormat ?? string.Empty,
.PaidMessageFileNameFormat ?? "",
messageInfo,
mediaInfo,
messageInfo?.FromUser,
@ -1953,7 +1953,7 @@ public class Program(IServiceProvider serviceProvider)
"Messages",
new SpectreProgressReporter(task),
configService.CurrentConfig.GetCreatorFileNameFormatConfig(username)
.PaidMessageFileNameFormat ?? string.Empty,
.PaidMessageFileNameFormat ?? "",
messageInfo,
mediaInfo,
messageInfo?.FromUser,
@ -2061,7 +2061,7 @@ public class Program(IServiceProvider serviceProvider)
"Messages",
new SpectreProgressReporter(task),
configService.CurrentConfig.GetCreatorFileNameFormatConfig(username)
.PaidMessageFileNameFormat ?? string.Empty,
.PaidMessageFileNameFormat ?? "",
messageInfo,
mediaInfo,
messageInfo?.FromUser,
@ -2093,7 +2093,7 @@ public class Program(IServiceProvider serviceProvider)
"Messages",
new SpectreProgressReporter(task),
configService.CurrentConfig.GetCreatorFileNameFormatConfig(username)
.PaidMessageFileNameFormat ?? string.Empty,
.PaidMessageFileNameFormat ?? "",
messageInfo,
mediaInfo,
messageInfo?.FromUser,
@ -2212,7 +2212,7 @@ public class Program(IServiceProvider serviceProvider)
"Posts",
new SpectreProgressReporter(task),
configService.CurrentConfig.GetCreatorFileNameFormatConfig(username).PostFileNameFormat ??
string.Empty,
"",
postInfo,
mediaInfo,
postInfo?.Author,
@ -2234,7 +2234,7 @@ public class Program(IServiceProvider serviceProvider)
"Posts",
new SpectreProgressReporter(task),
configService.CurrentConfig.GetCreatorFileNameFormatConfig(username)
.PostFileNameFormat ?? string.Empty,
.PostFileNameFormat ?? "",
postInfo,
mediaInfo,
postInfo?.Author,
@ -2622,7 +2622,7 @@ public class Program(IServiceProvider serviceProvider)
return Path.GetFullPath(filename);
}
string pathEnv = Environment.GetEnvironmentVariable("PATH") ?? string.Empty;
string pathEnv = Environment.GetEnvironmentVariable("PATH") ?? "";
foreach (string path in pathEnv.Split(Path.PathSeparator))
{
string fullPath = Path.Combine(path, filename);

View File

@ -412,12 +412,10 @@ public class DownloadService(
/// <param name="url"></param>
/// <param name="folder"></param>
/// <param name="media_id"></param>
/// <param name="task"></param>
/// <param name="filenameFormat"></param>
/// <param name="generalInfo"></param>
/// <param name="generalMedia"></param>
/// <param name="generalAuthor"></param>
/// <param name="users"></param>
/// <param name="api_type"></param>
/// <param name="progressReporter"></param>
/// <param name="serverFileName"></param>
/// <param name="resolvedFileName"></param>
/// <returns></returns>
protected async Task<bool> CreateDirectoriesAndDownloadMedia(string path,
string url,
@ -466,7 +464,7 @@ public class DownloadService(
/// <param name="path">The initial relative path.</param>
/// <param name="extension">The file extension.</param>
/// <returns>A string that represents the updated path based on the file extension.</returns>
private string UpdatePathBasedOnExtension(string folder, string path, string extension)
private static string UpdatePathBasedOnExtension(string folder, string path, string extension)
{
string subdirectory = "";
@ -509,14 +507,17 @@ public class DownloadService(
/// <summary>
/// Generates a custom filename based on the given format and properties.
/// </summary>
/// <param name="filename"></param>
/// <param name="filenameFormat">The format string for the filename.</param>
/// <param name="postInfo">General information about the post.</param>
/// <param name="postMedia">Media associated with the post.</param>
/// <param name="author">Author of the post.</param>
/// <param name="username"></param>
/// <param name="users">Dictionary containing user-related data.</param>
/// <param name="fileNameHelper">Helper class for filename operations.</param>
/// <param name="fileNameService"></param>
/// <param name="option"></param>
/// <returns>A Task resulting in a string that represents the custom filename.</returns>
private async Task<string> GenerateCustomFileName(string filename,
private static async Task<string> GenerateCustomFileName(string filename,
string? filenameFormat,
object? postInfo,
object? postMedia,
@ -641,12 +642,13 @@ public class DownloadService(
/// </summary>
/// <param name="folder">The folder where the media is stored.</param>
/// <param name="media_id">The ID of the media.</param>
/// <param name="fullPath">The full path to the media.</param>
/// <param name="api_type"></param>
/// <param name="url">The URL from where to download the media.</param>
/// <param name="path">The relative path to the media.</param>
/// <param name="serverFilename"></param>
/// <param name="resolvedFilename">The filename after any required manipulations.</param>
/// <param name="extension">The file extension.</param>
/// <param name="task">The task object for tracking progress.</param>
/// <param name="progressReporter"></param>
/// <returns>A Task resulting in a boolean indicating whether the media is newly downloaded or not.</returns>
public async Task<bool> ProcessMediaDownload(string folder,
long media_id,
@ -730,12 +732,13 @@ public class DownloadService(
/// </summary>
/// <param name="folder"></param>
/// <param name="media_id"></param>
/// <param name="api_type"></param>
/// <param name="url"></param>
/// <param name="path"></param>
/// <param name="serverFilename"></param>
/// <param name="resolvedFilename"></param>
/// <param name="extension"></param>
/// <param name="task"></param>
/// <param name="dBHelper"></param>
/// <param name="progressReporter"></param>
/// <returns>A Task resulting in a boolean indicating whether the media is newly downloaded or not.</returns>
private async Task<bool> HandleNewMedia(string folder,
long media_id,
@ -838,8 +841,8 @@ public class DownloadService(
/// </summary>
/// <param name="folder"></param>
/// <param name="media_id"></param>
/// <param name="task"></param>
/// <param name="dBHelper"></param>
/// <param name="api_type"></param>
/// <param name="progressReporter"></param>
/// <returns>A boolean indicating whether the media is newly downloaded or not.</returns>
private async Task<bool> HandlePreviouslyDownloadedMediaAsync(string folder, long media_id, string api_type,
IProgressReporter progressReporter)
@ -863,7 +866,7 @@ public class DownloadService(
/// </summary>
/// <param name="filePath">The path to the file.</param>
/// <returns>The file size in bytes.</returns>
private long GetLocalFileSize(string filePath) => new FileInfo(filePath).Length;
private static long GetLocalFileSize(string filePath) => new FileInfo(filePath).Length;
/// <summary>
@ -871,7 +874,7 @@ public class DownloadService(
/// </summary>
/// <param name="url">The URL to download the file from.</param>
/// <param name="destinationPath">The path where the downloaded file will be saved.</param>
/// <param name="task">Progress tracking object.</param>
/// <param name="progressReporter"></param>
/// <returns>A Task resulting in a DateTime indicating the last modified date of the downloaded file.</returns>
private async Task<DateTime> DownloadFile(string url, string destinationPath, IProgressReporter progressReporter)
{