Skip to content

Commit

Permalink
Package updates and fix breaking changes
Browse files Browse the repository at this point in the history
  • Loading branch information
rik-smeets committed Apr 21, 2021
1 parent a425ee3 commit 27591be
Show file tree
Hide file tree
Showing 7 changed files with 19 additions and 20 deletions.
8 changes: 4 additions & 4 deletions Harmonia.UnitTests/Harmonia.UnitTests.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,10 @@
<Product>Harmonia.UnitTests</Product>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="16.8.3" />
<PackageReference Include="Moq" Version="4.16.0" />
<PackageReference Include="MSTest.TestAdapter" Version="2.1.2" />
<PackageReference Include="MSTest.TestFramework" Version="2.1.2" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="16.9.4" />
<PackageReference Include="Moq" Version="4.16.1" />
<PackageReference Include="MSTest.TestAdapter" Version="2.2.3" />
<PackageReference Include="MSTest.TestFramework" Version="2.2.3" />
<PackageReference Include="Shouldly" Version="4.0.3" />
</ItemGroup>
<ItemGroup>
Expand Down
3 changes: 1 addition & 2 deletions Harmonia.UnitTests/ViewModels/MainViewModelTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@
using MahApps.Metro.Controls.Dialogs;
using Microsoft.VisualStudio.TestTools.UnitTesting;
using Moq;
using Notifications.Wpf;
using Notifications.Wpf.Core;
using Shouldly;
using YoutubeExplode.Exceptions;
Expand Down Expand Up @@ -389,6 +388,6 @@ private static void ValidateFailedDownload(DownloadItem downloadItem)
}

private static Video CreateVideo(string title = "Artist - Title")
=> new Video(default, title, "Artist", default, DateTime.Now, "Description", default, default, default, default);
=> new(default, title, default, default, "Description", default, default, default, default);
}
}
12 changes: 6 additions & 6 deletions Harmonia/Harmonia.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
<ApplicationIcon>.\Assets\harmonia.ico</ApplicationIcon>
<AssemblyName>Harmonia</AssemblyName>
<RootNamespace>Harmonia</RootNamespace>
<Version>2.0.0</Version>
<Version>2.0.1</Version>
</PropertyGroup>

<ItemGroup>
Expand All @@ -27,21 +27,21 @@
</ItemGroup>

<ItemGroup>
<PackageReference Include="Fody" Version="6.3.0">
<PackageReference Include="Fody" Version="6.5.1">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
<PackageReference Include="MahApps.Metro" Version="2.4.3" />
<PackageReference Include="MahApps.Metro" Version="2.4.5" />
<PackageReference Include="Notifications.Wpf.Core" Version="1.3.2" />
<PackageReference Include="Onova" Version="2.6.2" />
<PackageReference Include="PropertyChanged.Fody" Version="3.3.1" />
<PackageReference Include="PropertyChanged.Fody" Version="3.3.3" />
<PackageReference Include="SharpClipboard" Version="3.5.2" />
<PackageReference Include="System.Configuration.ConfigurationManager" Version="5.0.0" />
<PackageReference Include="TagLibSharp" Version="2.2.0" />
<PackageReference Include="Unity" Version="5.11.9" />
<PackageReference Include="Unity" Version="5.11.10" />
<PackageReference Include="Xabe.FFmpeg" Version="4.4.0" />
<PackageReference Include="Xabe.FFmpeg.Downloader" Version="4.4.0" />
<PackageReference Include="YoutubeExplode" Version="5.1.9" />
<PackageReference Include="YoutubeExplode" Version="6.0.0" />
</ItemGroup>

<ItemGroup>
Expand Down
8 changes: 4 additions & 4 deletions Harmonia/Services/YouTubeDownloadService.cs
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,11 @@ namespace Harmonia.Services
{
public class YouTubeDownloadService : IYouTubeDownloadService
{
private readonly YoutubeClient _youTubeClient = new YoutubeClient();
private readonly YoutubeClient _youTubeClient = new();
private readonly ISettingsProvider _settingsProvider;

private static readonly Regex IllegalFileNameRegex =
new Regex($"[{Regex.Escape(new string(Path.GetInvalidFileNameChars()) + new string(Path.GetInvalidPathChars()))}]");
new($"[{Regex.Escape(new string(Path.GetInvalidFileNameChars()) + new string(Path.GetInvalidPathChars()))}]");

public YouTubeDownloadService(ISettingsProvider settingsProvider)
{
Expand All @@ -32,9 +32,9 @@ public async Task<string> DownloadMp4AndGetPath(Video video, string requestedFil
var streamManifest = await _youTubeClient.Videos.Streams.GetManifestAsync(video.Id);

var streamInfo = streamManifest
.GetAudioOnly()
.GetAudioOnlyStreams()
.Where(s => s.Container == Container.Mp4)
.WithHighestBitrate();
.GetWithHighestBitrate();

var fileExtension = streamInfo.Container.Name;
var fileName = $"{requestedFileName}.{fileExtension}";
Expand Down
4 changes: 2 additions & 2 deletions Harmonia/ViewModels/MainViewModel.cs
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,8 @@ namespace Harmonia.ViewModels
{
public class MainViewModel
{
private readonly ObservableCollection<DownloadItem> _downloadItems = new ObservableCollection<DownloadItem>();
private readonly Regex YouTubeUrlRegex = new Regex(@"youtu(?:\.be|be\.com)/(?:.*v(?:/|=)|(?:.*/)?)([a-zA-Z0-9-_]{11})+");
private readonly ObservableCollection<DownloadItem> _downloadItems = new();
private readonly Regex YouTubeUrlRegex = new(@"youtu(?:\.be|be\.com)/(?:.*v(?:/|=)|(?:.*/)?)([a-zA-Z0-9-_]{11})+");
private readonly IYouTubeDownloadService _youTubeDownloadService;
private readonly IDialogCoordinator _dialogCoordinator;
private readonly IConversionService _conversionService;
Expand Down
2 changes: 1 addition & 1 deletion Harmonia/Views/MainWindow.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@ private async void btnOpenOutputDirectory_Click(object sender, RoutedEventArgs e
}
else
{
Process.Start(_settingsProvider.OutputDirectory);
Process.Start("explorer.exe", _settingsProvider.OutputDirectory);
}
}

Expand Down
2 changes: 1 addition & 1 deletion Harmonia/Wrappers/ClipboardWrapper.cs
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ public class ClipboardWrapper : IClipboardWrapper
{
public event EventHandler<string> ClipboardTextChanged;

private readonly SharpClipboard _clipboard = new SharpClipboard();
private readonly SharpClipboard _clipboard = new();

public ClipboardWrapper()
{
Expand Down

0 comments on commit 27591be

Please sign in to comment.