Skip to content

Commit

Permalink
its not working now
Browse files Browse the repository at this point in the history
but no errors are thrown
  • Loading branch information
Neurofibromin committed May 5, 2024
1 parent faaf8cf commit 609a6dc
Show file tree
Hide file tree
Showing 5 changed files with 37 additions and 22 deletions.
2 changes: 2 additions & 0 deletions ViewModels/DownloadingViewModel.cs
Original file line number Diff line number Diff line change
Expand Up @@ -30,5 +30,7 @@ namespace bookmark_dlp.ViewModels
{
public partial class DownloadingViewModel : ViewModelBase
{
public DownloadingViewModel() {
}
}
}
4 changes: 2 additions & 2 deletions ViewModels/MainWindowViewModel.cs
Original file line number Diff line number Diff line change
Expand Up @@ -40,9 +40,9 @@ public partial class MainWindowViewModel : ViewModelBase

public MainWindowViewModel()
{

StartPage = new StartPageViewModel();
Settings = new SettingsViewModel();
StartPage = new StartPageViewModel();

Downloading = new DownloadingViewModel();

ContentViewModel = StartPage;
Expand Down
12 changes: 10 additions & 2 deletions ViewModels/SettingsViewModel.cs
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ public partial class SettingsViewModel : ViewModelBase


public SettingsViewModel() {
Console.WriteLine("Settings!");
//Console.WriteLine("Settings!");

}

Expand All @@ -66,7 +66,15 @@ public async Task ChooseYtdlpBinary(CancellationToken token)
try
{
var file = await DoOpenFilePickerAsync();
Yt_dlp_binary_path = file.Path.ToString();
if (file != null)
{
Yt_dlp_binary_path = file.TryGetLocalPath();
}
else
{

Yt_dlp_binary_path = Yt_dlp_binary_path;
}
}
catch (Exception e)
{
Expand Down
19 changes: 11 additions & 8 deletions ViewModels/StartPageViewModel.cs
Original file line number Diff line number Diff line change
Expand Up @@ -43,19 +43,22 @@ public partial class StartPageViewModel : ViewModelBase
[ObservableProperty]
public bool ytdlp_executable_not_found = true;
[ObservableProperty]
public string chosenBrowser;
public string? chosenBrowser;

public StartPageViewModel() {


if (Methods.Yt_dlp_pathfinder(Directory.GetCurrentDirectory()) != null) { Ytdlp_executable_not_found = false; }


/*Task.Run(async () =>
{
Console.WriteLine("something");
});*/
// if (Methods.Yt_dlp_pathfinder(Directory.GetCurrentDirectory()) != null) { Ytdlp_executable_not_found = false; }

//implement some inotifypropertychanged for this?



/*Task.Run(async () =>
{
Console.WriteLine("something");
});*/

}

[ObservableProperty] private string? _fileText;
Expand Down
22 changes: 12 additions & 10 deletions Views/StartPageView.axaml
Original file line number Diff line number Diff line change
Expand Up @@ -109,16 +109,18 @@
Command="{Binding $parent[Window].DataContext.SettingsCommand}">
Settings
</Button>
<TextBlock
Grid.Column="1"
Margin="4"
HorizontalAlignment="Center"
VerticalAlignment="Center"
Background="Red"
IsEnabled="False"
IsVisible="{Binding Ytdlp_executable_not_found}">
No yt-dlp executable found
</TextBlock>
<StackPanel Grid.Column="1">
<Label Content="{Binding}" />
<TextBlock
Margin="4"
HorizontalAlignment="Center"
VerticalAlignment="Center"
Background="Red"
IsEnabled="False"
IsVisible="{Binding Ytdlp_executable_not_found}">
No yt-dlp executable found
</TextBlock>
</StackPanel>
<Button
Grid.Column="2"
Margin="10"
Expand Down

0 comments on commit 609a6dc

Please sign in to comment.