diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..795cc69 --- /dev/null +++ b/.gitignore @@ -0,0 +1,2 @@ +/HarmonyWinUI/obj +/HarmonyWinUI/bin diff --git a/HarmonyWinUI/HarmonyWinUI.csproj b/HarmonyWinUI/HarmonyWinUI.csproj index dfc8361..135e7fe 100644 --- a/HarmonyWinUI/HarmonyWinUI.csproj +++ b/HarmonyWinUI/HarmonyWinUI.csproj @@ -31,18 +31,52 @@ false + + + + + + + + - + - + + + + + + MSBuild:Compile + + + + + + MSBuild:Compile + + + + + + MSBuild:Compile + + + + + + MSBuild:Compile + + + + + + MSBuild:Compile + \ No newline at end of file diff --git a/HarmonyWinUI/HarmonyWinUI.csproj.user b/HarmonyWinUI/HarmonyWinUI.csproj.user index 04baafa..cc69da4 100644 --- a/HarmonyWinUI/HarmonyWinUI.csproj.user +++ b/HarmonyWinUI/HarmonyWinUI.csproj.user @@ -16,5 +16,20 @@ Designer + + Designer + + + Designer + + + Designer + + + Designer + + + Designer + \ No newline at end of file diff --git a/HarmonyWinUI/MainWindow.xaml b/HarmonyWinUI/MainWindow.xaml index 71f55ce..0a9ca9a 100644 --- a/HarmonyWinUI/MainWindow.xaml +++ b/HarmonyWinUI/MainWindow.xaml @@ -1,35 +1,43 @@ + x:Class="HarmonyWinUI.MainWindow" + xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" + xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" + xmlns:local="using:HarmonyWinUI" + xmlns:d="http://schemas.microsoft.com/expression/blend/2008" + xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" + mc:Ignorable="d" + Title="HarmonyWinUI"> - - - + + + - - + + - + - + - + + + + + + + + + + + + + diff --git a/HarmonyWinUI/MainWindow.xaml.cs b/HarmonyWinUI/MainWindow.xaml.cs index 5b17413..d969c75 100644 --- a/HarmonyWinUI/MainWindow.xaml.cs +++ b/HarmonyWinUI/MainWindow.xaml.cs @@ -1,17 +1,8 @@ +using HarmonyWinUI.Pages; using Microsoft.UI.Xaml; using Microsoft.UI.Xaml.Controls; -using Microsoft.UI.Xaml.Controls.Primitives; -using Microsoft.UI.Xaml.Data; -using Microsoft.UI.Xaml.Input; -using Microsoft.UI.Xaml.Media; -using Microsoft.UI.Xaml.Navigation; using System; -using System.Collections.Generic; -using System.IO; -using System.Linq; -using System.Runtime.InteropServices.WindowsRuntime; -using Windows.Foundation; -using Windows.Foundation.Collections; +using Windows.System; // added // To learn more about WinUI, the WinUI project structure, // and more about our project templates, see: http://aka.ms/winui-project-info. @@ -26,6 +17,52 @@ namespace HarmonyWinUI public MainWindow() { InitializeComponent(); + + // default + MainNavigationContentFrame.Navigate(typeof(Dashboard)); + } + + private async void MainNavigation_SelectionChanged(NavigationView sender, NavigationViewSelectionChangedEventArgs args) + { + if (args.IsSettingsSelected) + { + MainNavigationContentFrame.Navigate(typeof(Settings)); + return; + } + + if (args.SelectedItem is not NavigationViewItem item) return; + + switch (item.Tag?.ToString()) + { + case "Dashboard": + MainNavigationContentFrame.Navigate(typeof(Dashboard)); + break; + + case "FavoriteAlbums": + MainNavigationContentFrame.Navigate(typeof(FavoriteAlbums)); + break; + + case "FavoriteTracks": + MainNavigationContentFrame.Navigate(typeof(FavoriteTracks)); + break; + + case "FavoriteArtists": + MainNavigationContentFrame.Navigate(typeof(FavoriteArtists)); + break; + + case "PageDonate": + await Launcher.LaunchUriAsync( + new Uri("https://www.anycoin.cz/donate/igormino") + ); + break; + + case "PageHomepage": + await Launcher.LaunchUriAsync( + new Uri("https://harmony.tpsoft.org/") + ); + break; + } } } + } diff --git a/HarmonyWinUI/Pages/Dashboard.xaml b/HarmonyWinUI/Pages/Dashboard.xaml new file mode 100644 index 0000000..cb4191b --- /dev/null +++ b/HarmonyWinUI/Pages/Dashboard.xaml @@ -0,0 +1,16 @@ + + + + + + + diff --git a/HarmonyWinUI/Pages/Dashboard.xaml.cs b/HarmonyWinUI/Pages/Dashboard.xaml.cs new file mode 100644 index 0000000..256b9ff --- /dev/null +++ b/HarmonyWinUI/Pages/Dashboard.xaml.cs @@ -0,0 +1,31 @@ +using Microsoft.UI.Xaml; +using Microsoft.UI.Xaml.Controls; +using Microsoft.UI.Xaml.Controls.Primitives; +using Microsoft.UI.Xaml.Data; +using Microsoft.UI.Xaml.Input; +using Microsoft.UI.Xaml.Media; +using Microsoft.UI.Xaml.Navigation; +using System; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System.Runtime.InteropServices.WindowsRuntime; +using Windows.Foundation; +using Windows.Foundation.Collections; + +// To learn more about WinUI, the WinUI project structure, +// and more about our project templates, see: http://aka.ms/winui-project-info. + +namespace HarmonyWinUI.Pages +{ + /// + /// An empty page that can be used on its own or navigated to within a Frame. + /// + public sealed partial class Dashboard : Page + { + public Dashboard() + { + InitializeComponent(); + } + } +} diff --git a/HarmonyWinUI/Pages/FavoriteAlbums.xaml b/HarmonyWinUI/Pages/FavoriteAlbums.xaml new file mode 100644 index 0000000..2260ed4 --- /dev/null +++ b/HarmonyWinUI/Pages/FavoriteAlbums.xaml @@ -0,0 +1,16 @@ + + + + + + + diff --git a/HarmonyWinUI/Pages/FavoriteAlbums.xaml.cs b/HarmonyWinUI/Pages/FavoriteAlbums.xaml.cs new file mode 100644 index 0000000..d9b1c79 --- /dev/null +++ b/HarmonyWinUI/Pages/FavoriteAlbums.xaml.cs @@ -0,0 +1,31 @@ +using Microsoft.UI.Xaml; +using Microsoft.UI.Xaml.Controls; +using Microsoft.UI.Xaml.Controls.Primitives; +using Microsoft.UI.Xaml.Data; +using Microsoft.UI.Xaml.Input; +using Microsoft.UI.Xaml.Media; +using Microsoft.UI.Xaml.Navigation; +using System; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System.Runtime.InteropServices.WindowsRuntime; +using Windows.Foundation; +using Windows.Foundation.Collections; + +// To learn more about WinUI, the WinUI project structure, +// and more about our project templates, see: http://aka.ms/winui-project-info. + +namespace HarmonyWinUI.Pages +{ + /// + /// An empty page that can be used on its own or navigated to within a Frame. + /// + public sealed partial class FavoriteAlbums : Page + { + public FavoriteAlbums() + { + InitializeComponent(); + } + } +} diff --git a/HarmonyWinUI/Pages/FavoriteArtists.xaml b/HarmonyWinUI/Pages/FavoriteArtists.xaml new file mode 100644 index 0000000..a09fe04 --- /dev/null +++ b/HarmonyWinUI/Pages/FavoriteArtists.xaml @@ -0,0 +1,16 @@ + + + + + + + diff --git a/HarmonyWinUI/Pages/FavoriteArtists.xaml.cs b/HarmonyWinUI/Pages/FavoriteArtists.xaml.cs new file mode 100644 index 0000000..1706dfb --- /dev/null +++ b/HarmonyWinUI/Pages/FavoriteArtists.xaml.cs @@ -0,0 +1,31 @@ +using Microsoft.UI.Xaml; +using Microsoft.UI.Xaml.Controls; +using Microsoft.UI.Xaml.Controls.Primitives; +using Microsoft.UI.Xaml.Data; +using Microsoft.UI.Xaml.Input; +using Microsoft.UI.Xaml.Media; +using Microsoft.UI.Xaml.Navigation; +using System; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System.Runtime.InteropServices.WindowsRuntime; +using Windows.Foundation; +using Windows.Foundation.Collections; + +// To learn more about WinUI, the WinUI project structure, +// and more about our project templates, see: http://aka.ms/winui-project-info. + +namespace HarmonyWinUI.Pages +{ + /// + /// An empty page that can be used on its own or navigated to within a Frame. + /// + public sealed partial class FavoriteArtists : Page + { + public FavoriteArtists() + { + InitializeComponent(); + } + } +} diff --git a/HarmonyWinUI/Pages/FavoriteTracks.xaml b/HarmonyWinUI/Pages/FavoriteTracks.xaml new file mode 100644 index 0000000..0123f20 --- /dev/null +++ b/HarmonyWinUI/Pages/FavoriteTracks.xaml @@ -0,0 +1,16 @@ + + + + + + + diff --git a/HarmonyWinUI/Pages/FavoriteTracks.xaml.cs b/HarmonyWinUI/Pages/FavoriteTracks.xaml.cs new file mode 100644 index 0000000..9543a99 --- /dev/null +++ b/HarmonyWinUI/Pages/FavoriteTracks.xaml.cs @@ -0,0 +1,31 @@ +using Microsoft.UI.Xaml; +using Microsoft.UI.Xaml.Controls; +using Microsoft.UI.Xaml.Controls.Primitives; +using Microsoft.UI.Xaml.Data; +using Microsoft.UI.Xaml.Input; +using Microsoft.UI.Xaml.Media; +using Microsoft.UI.Xaml.Navigation; +using System; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System.Runtime.InteropServices.WindowsRuntime; +using Windows.Foundation; +using Windows.Foundation.Collections; + +// To learn more about WinUI, the WinUI project structure, +// and more about our project templates, see: http://aka.ms/winui-project-info. + +namespace HarmonyWinUI.Pages +{ + /// + /// An empty page that can be used on its own or navigated to within a Frame. + /// + public sealed partial class FavoriteTracks : Page + { + public FavoriteTracks() + { + InitializeComponent(); + } + } +} diff --git a/HarmonyWinUI/Pages/Settings.xaml b/HarmonyWinUI/Pages/Settings.xaml new file mode 100644 index 0000000..46637fc --- /dev/null +++ b/HarmonyWinUI/Pages/Settings.xaml @@ -0,0 +1,16 @@ + + + + + + + diff --git a/HarmonyWinUI/Pages/Settings.xaml.cs b/HarmonyWinUI/Pages/Settings.xaml.cs new file mode 100644 index 0000000..2a20c77 --- /dev/null +++ b/HarmonyWinUI/Pages/Settings.xaml.cs @@ -0,0 +1,31 @@ +using Microsoft.UI.Xaml; +using Microsoft.UI.Xaml.Controls; +using Microsoft.UI.Xaml.Controls.Primitives; +using Microsoft.UI.Xaml.Data; +using Microsoft.UI.Xaml.Input; +using Microsoft.UI.Xaml.Media; +using Microsoft.UI.Xaml.Navigation; +using System; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System.Runtime.InteropServices.WindowsRuntime; +using Windows.Foundation; +using Windows.Foundation.Collections; + +// To learn more about WinUI, the WinUI project structure, +// and more about our project templates, see: http://aka.ms/winui-project-info. + +namespace HarmonyWinUI.Pages +{ + /// + /// An empty page that can be used on its own or navigated to within a Frame. + /// + public sealed partial class Settings : Page + { + public Settings() + { + InitializeComponent(); + } + } +} diff --git a/vendor/poznamky.txt b/vendor/poznamky.txt new file mode 100644 index 0000000..0b3f062 --- /dev/null +++ b/vendor/poznamky.txt @@ -0,0 +1,9 @@ +najdi umelkca: +https://musicbrainz.org/ws/2/artist?query=artist:stromae&fmt=json&limit=10 + +potom z neho vyber jeho ID: ab2528d9-719f-4261-8098-21849222a0f2 + +a podla toho najdi jeho albumy: +https://musicbrainz.org/ws/2/release-group?artist=ab2528d9-719f-4261-8098-21849222a0f2&type=album&fmt=json&limit=100 + + diff --git a/vendor/update.bat b/vendor/update.bat new file mode 100644 index 0000000..a0f9191 --- /dev/null +++ b/vendor/update.bat @@ -0,0 +1,22 @@ +set "ROOT=%~dp0" +if "%ROOT:~-1%"=="\" set "ROOT=%ROOT:~0,-1%" + +set "DIR_FFMPG=%ROOT%\ffmpeg-master-latest-win64-gpl-shared" +set "DIST_PUBLIC=%DIST_DIR%\public" +set "DIST_APP=%DIST_PUBLIC%" +set "FRONTEND_DIR=%ROOT%\frontend" +set "BACKEND_DIR=%ROOT%\backend" + +echo [1/4] Cleaning FFMPEG +if exist "%DIR_FFMPG%" ( + rmdir /S /Q "%DIR_FFMPG%" +} + +echo [2/4] Download YT-DLP +curl -L -o yt-dlp.exe https://github.com/yt-dlp/yt-dlp/releases/latest/download/yt-dlp.exe + +echo [3/4] Download FFMPEG +curl -L -o ffmpeg.zip https://github.com/BtbN/FFmpeg-Builds/releases/download/latest/ffmpeg-master-latest-win64-gpl-shared.zip + +echo [4/4] Unzip FFMPEG +uinzip ffmpeg.zip diff --git a/vendor/yt.bat b/vendor/yt.bat new file mode 100644 index 0000000..e80e927 --- /dev/null +++ b/vendor/yt.bat @@ -0,0 +1,8 @@ +@echo off + +yt-dlp.exe ^ + -f ba ^ + --embed-thumbnail ^ + --embed-metadata ^ + -o "temp\download.%%(ext)s" ^ + "%~1" \ No newline at end of file