diff --git a/PlaylistDownloader.exe b/PlaylistDownloader.exe index 1b529f1..016f902 100644 Binary files a/PlaylistDownloader.exe and b/PlaylistDownloader.exe differ diff --git a/PlaylistDownloader.zip b/PlaylistDownloader.zip index d9a5282..26ab4f6 100644 Binary files a/PlaylistDownloader.zip and b/PlaylistDownloader.zip differ diff --git a/PlaylistDownloader/Installer/InnoPlaylistDownloaderInstallerScript.iss b/PlaylistDownloader/Installer/InnoPlaylistDownloaderInstallerScript.iss index 52d082a..cac5355 100644 --- a/PlaylistDownloader/Installer/InnoPlaylistDownloaderInstallerScript.iss +++ b/PlaylistDownloader/Installer/InnoPlaylistDownloaderInstallerScript.iss @@ -18,7 +18,7 @@ DisableDirPage=yes DefaultGroupName=PlaylistDownloader DisableProgramGroupPage=yes OutputBaseFilename=setup -SetupIconFile=..\PlaylistDownloader\icon.ico +SetupIconFile=..\PlaylistDownloader\img\icon.ico UninstallDisplayIcon={app}\PlaylistDownloader.exe Compression=lzma SolidCompression=yes @@ -29,8 +29,11 @@ Name: "english"; MessagesFile: "compiler:Default.isl" [Tasks] Name: "desktopicon"; Description: "{cm:CreateDesktopIcon}"; GroupDescription: "{cm:AdditionalIcons}"; +[InstallDelete] +Type: filesandordirs; Name: {app}\* + [Files] -Source: "..\PlaylistDownloader\bin\Release\*"; DestDir: "{app}"; Flags: ignoreversion recursesubdirs createallsubdirs; Excludes: "ffmpeg/*,youtube-dl.exe,*.log,*.vshost.*,*.pdb,youtube-dl.exe.new,youtube-dl-updater.bat" +Source: "..\PlaylistDownloader\bin\Release\*"; DestDir: "{app}"; Flags: ignoreversion recursesubdirs createallsubdirs; Excludes: "\ffmpeg,\youtube-dl.exe" Source: "..\PlaylistDownloader\bin\Release\youtube-dl.exe"; DestDir: "{userappdata}/PlaylistDownloader"; Flags: ignoreversion recursesubdirs createallsubdirs Source: "..\PlaylistDownloader\bin\Release\ffmpeg\*"; DestDir: "{userappdata}/PlaylistDownloader/ffmpeg"; Flags: ignoreversion recursesubdirs createallsubdirs diff --git a/PlaylistDownloader/PlaylistDownloader.UnitTests/DownloaderTests.cs b/PlaylistDownloader/PlaylistDownloader.UnitTests/DownloaderTests.cs deleted file mode 100644 index 8ac6379..0000000 --- a/PlaylistDownloader/PlaylistDownloader.UnitTests/DownloaderTests.cs +++ /dev/null @@ -1,48 +0,0 @@ -using NUnit.Framework; -using System; -using System.Collections.Generic; -using System.IO; -using System.Linq; -using System.Text; -using System.Threading.Tasks; - -namespace PlaylistDownloader.UnitTests -{ - [TestFixture] - public class DownloaderTests - { - // TODO 005 make all file names lower case - //[TestCase("https://www.youtube.com/watch?v=rpIPNEEo6ng", "Top-15-New-Biggest-Upcoming-Open-World-Games-in-2017-2018.mp3")] - [TestCase("https://www.youtube.com/watch?v=447ZQHns2Jo", "How-to-take-off-and-installing-logitech-illuminated-keyboard-key.mp3")] - //[TestCase("https://www.youtube.com/watch?v=Ub81XBbvURs", "Editors-Smokers-Outside-the-Hospital-Doors.mp3")] - public async Task Downloader_DownloadYoutubeLink_ShouldSucceed(string url, string fileName) - { - // Arrange - string currentDirectory = Path.GetDirectoryName(System.Reflection.Assembly.GetExecutingAssembly().Location); - string relativePathToProject = "..\\..\\..\\PlaylistDownloader\\bin\\debug\\"; - var runSettings = new RunSettings - { - IsDebug = true, - YoutubeDlPath = Path.Combine(currentDirectory, relativePathToProject, "youtube-dl.exe"), - FfmpegPath = Path.Combine(currentDirectory, relativePathToProject, "ffmpeg\\ffmpeg.exe"), - NormalizedSuffix = "-normalized" - - }; - - File.Delete(Path.Combine(runSettings.SongsFolder, fileName)); - - var playListItem = new PlaylistItem(null) - { - Name = url - }; - - var downloader = new Downloader(runSettings, new List { playListItem }); - - // Act - string filePath = await downloader.DownloadPlaylistItem(playListItem); - - // Assert - Assert.That(File.Exists(filePath), Is.True); - } - } -} diff --git a/PlaylistDownloader/PlaylistDownloader.UnitTests/PlaylistDownloader.UnitTests.csproj b/PlaylistDownloader/PlaylistDownloader.UnitTests/PlaylistDownloader.UnitTests.csproj deleted file mode 100644 index 9d082b9..0000000 --- a/PlaylistDownloader/PlaylistDownloader.UnitTests/PlaylistDownloader.UnitTests.csproj +++ /dev/null @@ -1,57 +0,0 @@ - - - - - Debug - AnyCPU - {CE2ACA8E-01B2-483E-9D86-C06ACA0EEE65} - Library - Properties - PlaylistDownloader.UnitTests - PlaylistDownloader.UnitTests - v4.6.1 - 512 - - - - true - full - false - bin\Debug\ - DEBUG;TRACE - prompt - 4 - - - pdbonly - true - bin\Release\ - TRACE - prompt - 4 - - - - ..\packages\NUnit.3.7.1\lib\net45\nunit.framework.dll - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/PlaylistDownloader/PlaylistDownloader.UnitTests/Properties/AssemblyInfo.cs b/PlaylistDownloader/PlaylistDownloader.UnitTests/Properties/AssemblyInfo.cs deleted file mode 100644 index 4b93a92..0000000 --- a/PlaylistDownloader/PlaylistDownloader.UnitTests/Properties/AssemblyInfo.cs +++ /dev/null @@ -1,36 +0,0 @@ -using System.Reflection; -using System.Runtime.CompilerServices; -using System.Runtime.InteropServices; - -// General Information about an assembly is controlled through the following -// set of attributes. Change these attribute values to modify the information -// associated with an assembly. -[assembly: AssemblyTitle("PlaylistDownloader.UnitTests")] -[assembly: AssemblyDescription("")] -[assembly: AssemblyConfiguration("")] -[assembly: AssemblyCompany("")] -[assembly: AssemblyProduct("PlaylistDownloader.UnitTests")] -[assembly: AssemblyCopyright("Copyright © 2017")] -[assembly: AssemblyTrademark("")] -[assembly: AssemblyCulture("")] - -// Setting ComVisible to false makes the types in this assembly not visible -// to COM components. If you need to access a type in this assembly from -// COM, set the ComVisible attribute to true on that type. -[assembly: ComVisible(false)] - -// The following GUID is for the ID of the typelib if this project is exposed to COM -[assembly: Guid("ce2aca8e-01b2-483e-9d86-c06aca0eee65")] - -// Version information for an assembly consists of the following four values: -// -// Major Version -// Minor Version -// Build Number -// Revision -// -// You can specify all the values or you can default the Build and Revision Numbers -// by using the '*' as shown below: -// [assembly: AssemblyVersion("1.0.*")] -[assembly: AssemblyVersion("1.0.0.0")] -[assembly: AssemblyFileVersion("1.0.0.0")] diff --git a/PlaylistDownloader/PlaylistDownloader.UnitTests/packages.config b/PlaylistDownloader/PlaylistDownloader.UnitTests/packages.config deleted file mode 100644 index b32e02a..0000000 --- a/PlaylistDownloader/PlaylistDownloader.UnitTests/packages.config +++ /dev/null @@ -1,11 +0,0 @@ - - - - - - - - - - - \ No newline at end of file diff --git a/PlaylistDownloader/PlaylistDownloader.sln b/PlaylistDownloader/PlaylistDownloader.sln index 8d702e6..b180a63 100644 --- a/PlaylistDownloader/PlaylistDownloader.sln +++ b/PlaylistDownloader/PlaylistDownloader.sln @@ -5,8 +5,6 @@ VisualStudioVersion = 16.0.30406.217 MinimumVisualStudioVersion = 10.0.40219.1 Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "SilentUpdater", "SilentUpdater\SilentUpdater.csproj", "{95EE76E5-8C7B-4BE4-8127-9515C3EF6B72}" EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "PlaylistDownloader.UnitTests", "PlaylistDownloader.UnitTests\PlaylistDownloader.UnitTests.csproj", "{CE2ACA8E-01B2-483E-9D86-C06ACA0EEE65}" -EndProject Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "PlaylistDownloader", "PlaylistDownloader\PlaylistDownloader.csproj", "{7DAE846A-611D-4985-9E7B-2CBDAE6FE8DC}" EndProject Global @@ -19,10 +17,6 @@ Global {95EE76E5-8C7B-4BE4-8127-9515C3EF6B72}.Debug|Any CPU.Build.0 = Debug|Any CPU {95EE76E5-8C7B-4BE4-8127-9515C3EF6B72}.Release|Any CPU.ActiveCfg = Release|Any CPU {95EE76E5-8C7B-4BE4-8127-9515C3EF6B72}.Release|Any CPU.Build.0 = Release|Any CPU - {CE2ACA8E-01B2-483E-9D86-C06ACA0EEE65}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {CE2ACA8E-01B2-483E-9D86-C06ACA0EEE65}.Debug|Any CPU.Build.0 = Debug|Any CPU - {CE2ACA8E-01B2-483E-9D86-C06ACA0EEE65}.Release|Any CPU.ActiveCfg = Release|Any CPU - {CE2ACA8E-01B2-483E-9D86-C06ACA0EEE65}.Release|Any CPU.Build.0 = Release|Any CPU {7DAE846A-611D-4985-9E7B-2CBDAE6FE8DC}.Debug|Any CPU.ActiveCfg = Debug|Any CPU {7DAE846A-611D-4985-9E7B-2CBDAE6FE8DC}.Debug|Any CPU.Build.0 = Debug|Any CPU {7DAE846A-611D-4985-9E7B-2CBDAE6FE8DC}.Release|Any CPU.ActiveCfg = Release|Any CPU diff --git a/PlaylistDownloader/PlaylistDownloader/MainWindow.xaml b/PlaylistDownloader/PlaylistDownloader/MainWindow.xaml deleted file mode 100644 index b2fb3fa..0000000 --- a/PlaylistDownloader/PlaylistDownloader/MainWindow.xaml +++ /dev/null @@ -1,12 +0,0 @@ - - - - - diff --git a/PlaylistDownloader/PlaylistDownloader/MainWindow.xaml.cs b/PlaylistDownloader/PlaylistDownloader/MainWindow.xaml.cs deleted file mode 100644 index 7e8a558..0000000 --- a/PlaylistDownloader/PlaylistDownloader/MainWindow.xaml.cs +++ /dev/null @@ -1,25 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using System.Windows; -using System.Windows.Controls; -using System.Windows.Data; -using System.Windows.Documents; -using System.Windows.Input; -using System.Windows.Media; -using System.Windows.Media.Imaging; -using System.Windows.Navigation; -using System.Windows.Shapes; - -namespace PlaylistDownloader1 { - /// - /// Interaction logic for MainWindow.xaml - /// - public partial class MainWindow : Window { - public MainWindow() { - InitializeComponent(); - } - } -} diff --git a/PlaylistDownloader/PlaylistDownloader/PlaylistDownloader.csproj b/PlaylistDownloader/PlaylistDownloader/PlaylistDownloader.csproj index e5150e0..2f2c70e 100644 --- a/PlaylistDownloader/PlaylistDownloader/PlaylistDownloader.csproj +++ b/PlaylistDownloader/PlaylistDownloader/PlaylistDownloader.csproj @@ -50,7 +50,7 @@ 4 - icon.ico + img\icon.ico PlaylistDownloader.App @@ -142,41 +142,42 @@ - + MSBuild:Compile Designer - + Component - + + + DownloadWindow.xaml - + - - + + + LogWindow.xaml + + SettingsWindow.xaml - - + + MSBuild:Compile Designer - - MSBuild:Compile + Designer + MSBuild:Compile - + App.xaml Code - - MainWindow.xaml - Code - - + MSBuild:Compile Designer @@ -199,7 +200,9 @@ ResXFileCodeGenerator Resources.Designer.cs - + + PreserveNewest + SettingsSingleFileGenerator @@ -210,17 +213,27 @@ - + PreserveNewest - + PreserveNewest - - - - - + + PreserveNewest + + + PreserveNewest + + + PreserveNewest + + + PreserveNewest + + + PreserveNewest + @@ -256,6 +269,9 @@ Always + + PreserveNewest + Always @@ -272,5 +288,6 @@ false + \ No newline at end of file diff --git a/PlaylistDownloader/PlaylistDownloader/Downloader.cs b/PlaylistDownloader/PlaylistDownloader/helpers/Downloader.cs similarity index 68% rename from PlaylistDownloader/PlaylistDownloader/Downloader.cs rename to PlaylistDownloader/PlaylistDownloader/helpers/Downloader.cs index 5e36971..34a7eb2 100644 --- a/PlaylistDownloader/PlaylistDownloader/Downloader.cs +++ b/PlaylistDownloader/PlaylistDownloader/helpers/Downloader.cs @@ -8,7 +8,9 @@ using System.Text.RegularExpressions; using System.Threading; using System.Threading.Tasks; +using Manatee.Json.Serialization; using NLog; +using PlaylistDownloader.helpers; namespace PlaylistDownloader { @@ -86,74 +88,76 @@ protected override void OnDoWork(DoWorkEventArgs args) public async Task DownloadPlaylistItem(PlaylistItem item) { - string destinationFilePathWithoutExtension = null; - string tempFilePathWithoutExtension = null; - - item.DownloadProgress = 5; - if (!string.IsNullOrWhiteSpace(item.Name)) - { + try { + PlaylistLogger.Info("Start Downloading " + item.Name); + string destinationFilePathWithoutExtension = null; + string tempFilePathWithoutExtension = null; + + item.DownloadProgress = 5; + if (!string.IsNullOrWhiteSpace(item.Name)) { + + YoutubeLink youtubeLink = YoutubeSearcher.GetYoutubeLinks(item.Name).FirstOrDefault(); + item.FileName = MakeValidFileName(youtubeLink.Label); + item.FileName = string.Concat(youtubeLink.Label.Split(Path.GetInvalidFileNameChars())).Trim().Replace('–', '-'); + var workingFolder = Path.GetTempPath(); + tempFilePathWithoutExtension = Path.Combine(Path.GetTempPath(), item.FileName); + destinationFilePathWithoutExtension = Path.Combine(_runSettings.SongsFolder, item.FileName); + + if (!File.Exists(destinationFilePathWithoutExtension + ".mp3")) { + item.DownloadProgress = 10; + + if (youtubeLink == null) { + item.SetDownloadStatus(false); + } else { + // Download videoand extract the mp3 file + await StartProcess( + _runSettings.YoutubeDlPath, + string.Format(" --ffmpeg-location \"{0}\"" + + " --format bestaudio[ext=mp3]/best" + + " --audio-quality 0" + + " --no-part" + + " --extract-audio" + + " --audio-format mp3" + + " --output \"{1}\"" + + " {2}", _runSettings.FfmpegPath, tempFilePathWithoutExtension + "-raw.%(ext)s", youtubeLink.Url), + item, + ParseYoutubeDlProgress); + // -o "c:\Users\Julian\Music\PlaylistDownloader\\%(title)s.%(ext)s" + + // Normalize audio file after the youtube-dl process has exited + await StartProcess(_runSettings.FfmpegPath, + string.Format(" -i \"{0}\"" + + " -af loudnorm=I=-16:TP=-1.5:LRA=11" + + //" -ar 48k" + + " -y" + + " \"{1}\"", tempFilePathWithoutExtension + "-raw.mp3", tempFilePathWithoutExtension + _runSettings.NormalizedSuffix + ".mp3"), + item, + ParseYoutubeDlProgress); + + // move to destination + File.Move(tempFilePathWithoutExtension + _runSettings.NormalizedSuffix + ".mp3", + destinationFilePathWithoutExtension + _runSettings.NormalizedSuffix + ".mp3"); + + // Delete the non normalized file after completion if not in debug mode + File.Delete(Path.Combine(_runSettings.SongsFolder, item.FileName + "-raw.mp3")); + } - YoutubeLink youtubeLink = YoutubeSearcher.GetYoutubeLinks(item.Name).FirstOrDefault(); - item.FileName = MakeValidFileName(youtubeLink.Label); - item.FileName = string.Concat(youtubeLink.Label.Split(Path.GetInvalidFileNameChars())).Trim().Replace('–', '-'); - var workingFolder = Path.GetTempPath(); - tempFilePathWithoutExtension = Path.Combine(Path.GetTempPath(), item.FileName); - destinationFilePathWithoutExtension = Path.Combine(_runSettings.SongsFolder, item.FileName); - if (!File.Exists(destinationFilePathWithoutExtension + ".mp3")) - { - item.DownloadProgress = 10; - - if (youtubeLink == null) - { - item.SetDownloadStatus(false); } - else - { - // Download videoand extract the mp3 file - await StartProcess( - _runSettings.YoutubeDlPath, - string.Format(" --ffmpeg-location \"{0}\"" + - " --format bestaudio[ext=mp3]/best" + - " --audio-quality 0" + - " --no-part" + - " --extract-audio" + - " --audio-format mp3" + - " --output \"{1}\"" + - " {2}", _runSettings.FfmpegPath, tempFilePathWithoutExtension + "-raw.%(ext)s", youtubeLink.Url), - item, - ParseYoutubeDlProgress); - // -o "c:\Users\Julian\Music\PlaylistDownloader\\%(title)s.%(ext)s" - - // Normalize audio file after the youtube-dl process has exited - await StartProcess(_runSettings.FfmpegPath, - string.Format(" -i \"{0}\"" + - " -af loudnorm=I=-16:TP=-1.5:LRA=11" + - //" -ar 48k" + - " -y" + - " \"{1}\"", tempFilePathWithoutExtension + "-raw.mp3", tempFilePathWithoutExtension + _runSettings.NormalizedSuffix + ".mp3"), - item, - ParseYoutubeDlProgress); - - // move to destination - File.Move(tempFilePathWithoutExtension + _runSettings.NormalizedSuffix + ".mp3", - destinationFilePathWithoutExtension + _runSettings.NormalizedSuffix + ".mp3"); - - // Delete the non normalized file after completion if not in debug mode - File.Delete(Path.Combine(_runSettings.SongsFolder, item.FileName + "-raw.mp3")); - } - - } - } - item.DownloadProgress = 100; - _progress++; - OnProgressChanged(new ProgressChangedEventArgs(_progress * 100 / _totalSongs, null)); + item.DownloadProgress = 100; + _progress++; + OnProgressChanged(new ProgressChangedEventArgs(_progress * 100 / _totalSongs, null)); - + PlaylistLogger.Info("Finished Downloading " + item.Name); - return destinationFilePathWithoutExtension; + return destinationFilePathWithoutExtension; + } catch(Exception ex) { + var serializer = new JsonSerializer(); + PlaylistLogger.Error("Failed to download item: " + serializer.Serialize(ex)); + return null; + } } private void ParseYoutubeDlProgress(string consoleLine, PlaylistItem item) diff --git a/PlaylistDownloader/PlaylistDownloader/helpers/LogInfo.cs b/PlaylistDownloader/PlaylistDownloader/helpers/LogInfo.cs new file mode 100644 index 0000000..d615dd7 --- /dev/null +++ b/PlaylistDownloader/PlaylistDownloader/helpers/LogInfo.cs @@ -0,0 +1,19 @@ +using NLog; + +namespace PlaylistDownloader.helpers { + public class LogInfo { + public string Message { + get; + set; + } + public LogLevel Level { + get; + set; + } + + public LogInfo(string message, LogLevel level) { + this.Message = message; + this.Level = level; + } + } +} diff --git a/PlaylistDownloader/PlaylistDownloader/helpers/Logger.cs b/PlaylistDownloader/PlaylistDownloader/helpers/Logger.cs new file mode 100644 index 0000000..84235a2 --- /dev/null +++ b/PlaylistDownloader/PlaylistDownloader/helpers/Logger.cs @@ -0,0 +1,25 @@ +using NLog; +using System; +using System.Collections.ObjectModel; + +namespace PlaylistDownloader.helpers { + class PlaylistLogger { + public static ObservableCollection Logs = new ObservableCollection(); + private static readonly Logger Logger = LogManager.GetLogger("global"); + + public static void Error(string message) { + App.Current.Dispatcher.Invoke(delegate { + Logs.Add(new LogInfo(message, LogLevel.Error)); + }); + Logger.Error(message); + } + + public static void Info(string message) { + App.Current.Dispatcher.Invoke(delegate + { + Logs.Add(new LogInfo(message, LogLevel.Info)); + }); + Logger.Info(message); + } + } +} diff --git a/PlaylistDownloader/PlaylistDownloader/PlaylistItem.cs b/PlaylistDownloader/PlaylistDownloader/helpers/PlaylistItem.cs similarity index 100% rename from PlaylistDownloader/PlaylistDownloader/PlaylistItem.cs rename to PlaylistDownloader/PlaylistDownloader/helpers/PlaylistItem.cs diff --git a/PlaylistDownloader/PlaylistDownloader/RunSettings.cs b/PlaylistDownloader/PlaylistDownloader/helpers/RunSettings.cs similarity index 100% rename from PlaylistDownloader/PlaylistDownloader/RunSettings.cs rename to PlaylistDownloader/PlaylistDownloader/helpers/RunSettings.cs diff --git a/PlaylistDownloader/PlaylistDownloader/YoutubeSearcher.cs b/PlaylistDownloader/PlaylistDownloader/helpers/YoutubeSearcher.cs similarity index 98% rename from PlaylistDownloader/PlaylistDownloader/YoutubeSearcher.cs rename to PlaylistDownloader/PlaylistDownloader/helpers/YoutubeSearcher.cs index 6299b57..3e4480d 100644 --- a/PlaylistDownloader/PlaylistDownloader/YoutubeSearcher.cs +++ b/PlaylistDownloader/PlaylistDownloader/helpers/YoutubeSearcher.cs @@ -34,7 +34,7 @@ public static IEnumerable GetYoutubeLinks(string query, int numberO while (page < 20 && (links == null || links.Count < numberOfResults)) { string requestUrl = string.Format(URL, HttpUtility.UrlEncode(query)?.Replace("%20", "+"), page); - links = GetLinksFromUrl(query); + links = GetLinksFromUrl(requestUrl); page++; } diff --git a/PlaylistDownloader/PlaylistDownloader/img/clipboard.png b/PlaylistDownloader/PlaylistDownloader/img/clipboard.png new file mode 100644 index 0000000..3142bd3 Binary files /dev/null and b/PlaylistDownloader/PlaylistDownloader/img/clipboard.png differ diff --git a/PlaylistDownloader/PlaylistDownloader/icon.ico b/PlaylistDownloader/PlaylistDownloader/img/icon.ico similarity index 100% rename from PlaylistDownloader/PlaylistDownloader/icon.ico rename to PlaylistDownloader/PlaylistDownloader/img/icon.ico diff --git a/PlaylistDownloader/PlaylistDownloader/icon.png b/PlaylistDownloader/PlaylistDownloader/img/icon.png similarity index 100% rename from PlaylistDownloader/PlaylistDownloader/icon.png rename to PlaylistDownloader/PlaylistDownloader/img/icon.png diff --git a/PlaylistDownloader/PlaylistDownloader/App.xaml b/PlaylistDownloader/PlaylistDownloader/views/App.xaml similarity index 83% rename from PlaylistDownloader/PlaylistDownloader/App.xaml rename to PlaylistDownloader/PlaylistDownloader/views/App.xaml index 88d014f..0856055 100644 --- a/PlaylistDownloader/PlaylistDownloader/App.xaml +++ b/PlaylistDownloader/PlaylistDownloader/views/App.xaml @@ -1,7 +1,7 @@  + StartupUri="views/SettingsWindow.xaml"> diff --git a/PlaylistDownloader/PlaylistDownloader/App.xaml.cs b/PlaylistDownloader/PlaylistDownloader/views/App.xaml.cs similarity index 100% rename from PlaylistDownloader/PlaylistDownloader/App.xaml.cs rename to PlaylistDownloader/PlaylistDownloader/views/App.xaml.cs diff --git a/PlaylistDownloader/PlaylistDownloader/DownloadWindow.xaml b/PlaylistDownloader/PlaylistDownloader/views/DownloadWindow.xaml similarity index 94% rename from PlaylistDownloader/PlaylistDownloader/DownloadWindow.xaml rename to PlaylistDownloader/PlaylistDownloader/views/DownloadWindow.xaml index 8a67c54..e0e7650 100644 --- a/PlaylistDownloader/PlaylistDownloader/DownloadWindow.xaml +++ b/PlaylistDownloader/PlaylistDownloader/views/DownloadWindow.xaml @@ -5,7 +5,7 @@ xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" xmlns:d="http://schemas.microsoft.com/expression/blend/2008" mc:Ignorable="d" - Icon="icon.ico"> + Icon="/img/icon.ico"> @@ -46,13 +46,13 @@ diff --git a/PlaylistDownloader/PlaylistDownloader/DownloadWindow.xaml.cs b/PlaylistDownloader/PlaylistDownloader/views/DownloadWindow.xaml.cs similarity index 100% rename from PlaylistDownloader/PlaylistDownloader/DownloadWindow.xaml.cs rename to PlaylistDownloader/PlaylistDownloader/views/DownloadWindow.xaml.cs diff --git a/PlaylistDownloader/PlaylistDownloader/views/LogWindow.xaml b/PlaylistDownloader/PlaylistDownloader/views/LogWindow.xaml new file mode 100644 index 0000000..a30a383 --- /dev/null +++ b/PlaylistDownloader/PlaylistDownloader/views/LogWindow.xaml @@ -0,0 +1,23 @@ + + + + + + + + + + + + + + + diff --git a/PlaylistDownloader/PlaylistDownloader/views/LogWindow.xaml.cs b/PlaylistDownloader/PlaylistDownloader/views/LogWindow.xaml.cs new file mode 100644 index 0000000..fb58c88 --- /dev/null +++ b/PlaylistDownloader/PlaylistDownloader/views/LogWindow.xaml.cs @@ -0,0 +1,21 @@ +using PlaylistDownloader.helpers; +using System.Collections.ObjectModel; +using System.Windows; + +namespace PlaylistDownloader.views { + /// + /// Interaction logic for LogWindow.xaml + /// + public partial class LogWindow : Window { + public ObservableCollection Logs { + get { + return PlaylistLogger.Logs; + } + } + + public LogWindow() { + InitializeComponent(); + DataContext = this; + } + } +} diff --git a/PlaylistDownloader/PlaylistDownloader/SettingsWindow.xaml b/PlaylistDownloader/PlaylistDownloader/views/SettingsWindow.xaml similarity index 63% rename from PlaylistDownloader/PlaylistDownloader/SettingsWindow.xaml rename to PlaylistDownloader/PlaylistDownloader/views/SettingsWindow.xaml index 6943975..fee3560 100644 --- a/PlaylistDownloader/PlaylistDownloader/SettingsWindow.xaml +++ b/PlaylistDownloader/PlaylistDownloader/views/SettingsWindow.xaml @@ -4,9 +4,8 @@ Title="Playlist Downloader" Height="382" Width="689" xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" xmlns:d="http://schemas.microsoft.com/expression/blend/2008" - xmlns:carViewer="clr-namespace:PlaylistDownloader" mc:Ignorable="d" - Icon="icon.ico" Loaded="WindowLoaded"> + Icon="/img/icon.ico" Loaded="WindowLoaded">