Skip to content

Conversation

@LorenzOnionware
Copy link

No description provided.

sealed partial class ServiceProvider { } No newline at end of file
sealed partial class ServiceProvider
{
private static string logfile = Path.Combine(AppSettings.Instance.LogPath, $"{DateTime.Now:yyyy-MM-dd_HH-mm-ss}.log");
Copy link
Owner

Choose a reason for hiding this comment

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

Add unix time stamp

Suggested change
private static string logfile = Path.Combine(AppSettings.Instance.LogPath, $"{DateTime.Now:yyyy-MM-dd_HH-mm-ss}.log");
private static string logfile = Path.Combine(AppSettings.Instance.LogPath, $"{DateTime.Now:yyyy-MM-dd_HH-mm-ss}_{DateTimeOffset.UtcNow.ToUnixTimeSeconds()}.log");

{
try { Directory.Delete(dir, true); }
catch { /* Dont crash if a directory cant be deleted */ }
catch { logger.LogInformation("Directory cant be deleted in DownloadVideosAsync");/* Dont crash if a directory cant be deleted */ }
Copy link
Owner

Choose a reason for hiding this comment

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

Which directory is affected? Add dir to log.

this.dispatcher = dispatcher ?? throw new ArgumentNullException(nameof(dispatcher));
this.taskbarProgressService = taskbarProgressService;
this.versionService = versionService;
logger.LogDebug(GetVersionDescription());
Copy link
Owner

Choose a reason for hiding this comment

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

The version has nothing to do with the MediaViewModel. In addition, the MediaViewModel isn't always called, the app can also start on the downloader page.
Move it somewhere more generic, like the app initialization code file (maybe Program.cs).

{
public YouTubeDownloaderViewModel(IDialogService dialogService, IDownloaderDialogService downloaderDialogService, IDispatcherService dispatcher, INetworkStatusService networkStatusService, IToastNotificationService toastNotificationService, IPathProvider pathProvider, ITaskbarProgressService taskbarProgressService, IWindowClosingService windowClosingService, IFiletagEditorDialog filetagDialogService)
{
public ILogger<YouTubeDownloaderViewModel> logger;
Copy link
Owner

Choose a reason for hiding this comment

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

Move down to the other fields, starting at line 81

{
if (VideoNotFound)
{
//WHAT the Hell??
Copy link
Owner

Choose a reason for hiding this comment

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

Klappe 😾

if (!validUri)
{
await RefreshResultsAsync(videolink.Clone() as string);
logger.LogWarning("InvalidUri in YouTubeDownloaderViewModel");
Copy link
Owner

Choose a reason for hiding this comment

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

Log URL

using Microsoft.UI.Windowing;
using Microsoft.UI.Composition.SystemBackdrops;
using System.Runtime.InteropServices;
using Microsoft.Extensions.Logging;
Copy link
Owner

Choose a reason for hiding this comment

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

What did you changed in this code file?
If no changes, revert.


namespace OnionMedia.Services
{
//Why does a programmer code in java? Because he can´t see sharp. rofl
Copy link
Owner

Choose a reason for hiding this comment

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

LorenzOnionware and others added 5 commits February 10, 2025 18:52
Co-authored-by: Jaden <91136545+onionware-github@users.noreply.github.com>
Co-authored-by: Jaden <91136545+onionware-github@users.noreply.github.com>
All downlaods are logged now.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants