Skip to content

Commit

Permalink
nuget update
Browse files Browse the repository at this point in the history
style adjustments
crash fix
  • Loading branch information
tensei committed Apr 13, 2022
1 parent 9089022 commit 4253deb
Show file tree
Hide file tree
Showing 9 changed files with 37 additions and 26 deletions.
2 changes: 1 addition & 1 deletion anidow/Bootstrapper.cs
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
using Anidow.Services;
using Anidow.Torrent_Clients;
using FluentScheduler;
using Hardcodet.Wpf.TaskbarNotification;
using H.NotifyIcon;
using Jot;
using Jot.Storage;
using Microsoft.AppCenter;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,8 @@
using Anidow.Utils;
using GraphQL.Client.Http;
using GraphQL.Client.Serializer.SystemTextJson;
using Hardcodet.Wpf.TaskbarNotification;
using H.NotifyIcon;
using H.NotifyIcon.Core;
using Microsoft.EntityFrameworkCore;
using Notifications.Wpf.Core;
using Serilog;
Expand Down Expand Up @@ -103,7 +104,7 @@ public async Task SaveAnime()
await Anime.UpdateInDatabase();
if (_settingsService.Settings.Notifications)
{
_taskbarIcon.ShowBalloonTip("Saved", Anime.Name, BalloonIcon.Info);
_taskbarIcon.ShowNotification("Saved", Anime.Name, NotificationIcon.Info);
}
else
{
Expand Down
3 changes: 1 addition & 2 deletions anidow/Pages/HomeView.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,6 @@
ItemContainerStyle="{StaticResource ListViewItemHome}"
ItemsSource="{Binding Source={StaticResource Episodes}, Mode=OneWay}"
Loaded="{s:Action ListViewLoaded}"
ScrollViewer.CanContentScroll="False"
SelectedItem="{Binding ActiveItem}"
SelectionChanged="{s:Action SelectionChanged}">
<ListView.ContextMenu>
Expand Down Expand Up @@ -109,6 +108,7 @@
Margin="8,0,0,0"
extensions:ProgressBarExtension.Content="{Binding TorrentProgressContent}"
extensions:ProgressBarExtension.IsProgressAnimationEnabled="False"
Foreground="#2F5CC1"
Maximum="1"
Minimum="0"
ToolTip="Download progress"
Expand Down Expand Up @@ -180,7 +180,6 @@
<GroupStyle.ContainerStyle>
<Style TargetType="{x:Type GroupItem}">
<Setter Property="Margin" Value="0,0,50,0" />
<Setter Property="HorizontalAlignment" Value="Left" />
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="{x:Type GroupItem}">
Expand Down
5 changes: 3 additions & 2 deletions anidow/Pages/HomeViewModel.cs
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,8 @@
using Anidow.Utils;
using BencodeNET.Torrents;
using FluentScheduler;
using Hardcodet.Wpf.TaskbarNotification;
using H.NotifyIcon;
using H.NotifyIcon.Core;
using Humanizer;
using Microsoft.EntityFrameworkCore;
using Serilog;
Expand Down Expand Up @@ -174,7 +175,7 @@ async Task GetAndSetAnime(TrackContext ctx, string id)

if (_settingsService.Settings.Notifications)
{
_taskbarIcon.ShowBalloonTip("Added", item.Name, BalloonIcon.None);
_taskbarIcon.ShowNotification("Added", item.Name);
}
else
{
Expand Down
4 changes: 2 additions & 2 deletions anidow/Services/AnimeBytesService.cs
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
using Anidow.Properties;
using Anidow.Utils;
using BencodeNET.Torrents;
using Hardcodet.Wpf.TaskbarNotification;
using H.NotifyIcon;
using Microsoft.EntityFrameworkCore;
using Serilog;
using Stylet;
Expand Down Expand Up @@ -154,7 +154,7 @@ public async Task CheckForNewEpisodes([CanBeNull] List<AnimeBytesTorrentItem> fe

if (_settingsService.Settings.Notifications)
{
_taskbarIcon.ShowBalloonTip("Added", item.Name, BalloonIcon.None);
_taskbarIcon.ShowNotification("Added", item.Name);
}
else
{
Expand Down
7 changes: 4 additions & 3 deletions anidow/Services/NotifyService.cs
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,8 @@
using Anidow.Enums;
using Anidow.Events;
using Anidow.Model;
using Hardcodet.Wpf.TaskbarNotification;
using H.NotifyIcon;
using H.NotifyIcon.Core;
using Humanizer;
using Microsoft.EntityFrameworkCore;
using Newtonsoft.Json;
Expand Down Expand Up @@ -297,9 +298,9 @@ private void SendEvent(NotifyItem item)

private void NotifyUser(NotifyItem item, int matches)
{
_taskbarIcon.ShowBalloonTip(
_taskbarIcon.ShowNotification(
$"New {"match".ToQuantity(matches)} found!",
$"Found {matches} new {"match".ToQuantity(matches, ShowQuantityAs.None)} for {item.Name}",
BalloonIcon.Info);
NotificationIcon.Info);
}
}
2 changes: 1 addition & 1 deletion anidow/Services/SettingsService.cs
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
using System.Threading.Tasks;
using Anidow.Model;
using Anidow.Utils;
using Hardcodet.Wpf.TaskbarNotification;
using H.NotifyIcon;
using Notifications.Wpf.Core;
using Serilog;
using Stylet;
Expand Down
19 changes: 14 additions & 5 deletions anidow/Services/TorrentService.cs
Original file line number Diff line number Diff line change
Expand Up @@ -129,12 +129,21 @@ public async Task<(bool, string)> TestConnection(SettingsModel settings)

public async Task UpdateTorrentProgress(IEnumerable<IEpisode> items)
{
var torrents = _settingsService.Settings.TorrentClient switch
object[] torrents;
try
{
TorrentClient.QBitTorrent => (object[])await GetTorrents<QBitTorrentEntry[]>(),
TorrentClient.Deluge => null,
_ => null,
};
torrents = _settingsService.Settings.TorrentClient switch
{
TorrentClient.QBitTorrent => (object[])await GetTorrents<QBitTorrentEntry[]>(),
TorrentClient.Deluge => null,
_ => null,
};
}
catch (Exception)
{
// ignore
return;
}

if (torrents is null)
{
Expand Down
16 changes: 8 additions & 8 deletions anidow/anidow.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -97,23 +97,23 @@
</PackageReference>
<PackageReference Include="GraphQL.Client" Version="4.0.2" />
<PackageReference Include="GraphQL.Client.Serializer.SystemTextJson" Version="4.0.2" />
<PackageReference Include="H.NotifyIcon.Wpf" Version="1.1.9" />
<PackageReference Include="H.NotifyIcon.Wpf" Version="2.0.29" />
<PackageReference Include="HtmlAgilityPack" Version="1.11.42" />
<PackageReference Include="Humanizer.Core" Version="2.14.1" />
<PackageReference Include="Jot" Version="2.1.13" />
<PackageReference Include="MahApps.Metro.IconPacks.FontAwesome" Version="4.11.0" />
<PackageReference Include="Microsoft.AppCenter" Version="4.5.0" />
<PackageReference Include="Microsoft.AppCenter.Analytics" Version="4.5.0" />
<PackageReference Include="Microsoft.AppCenter.Crashes" Version="4.5.0" />
<PackageReference Include="Microsoft.EntityFrameworkCore" Version="6.0.3" />
<PackageReference Include="Microsoft.EntityFrameworkCore.Design" Version="6.0.3">
<PackageReference Include="Microsoft.EntityFrameworkCore" Version="6.0.4" />
<PackageReference Include="Microsoft.EntityFrameworkCore.Design" Version="6.0.4">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
<PackageReference Include="Microsoft.EntityFrameworkCore.Proxies" Version="6.0.3" />
<PackageReference Include="Microsoft.EntityFrameworkCore.Relational" Version="6.0.3" />
<PackageReference Include="Microsoft.EntityFrameworkCore.Sqlite" Version="6.0.3" />
<PackageReference Include="Microsoft.EntityFrameworkCore.Tools" Version="6.0.3">
<PackageReference Include="Microsoft.EntityFrameworkCore.Proxies" Version="6.0.4" />
<PackageReference Include="Microsoft.EntityFrameworkCore.Relational" Version="6.0.4" />
<PackageReference Include="Microsoft.EntityFrameworkCore.Sqlite" Version="6.0.4" />
<PackageReference Include="Microsoft.EntityFrameworkCore.Tools" Version="6.0.4">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
Expand All @@ -125,7 +125,7 @@
<PackageReference Include="Serilog.Sinks.Console" Version="4.0.1" />
<PackageReference Include="Serilog.Sinks.File" Version="5.0.0" />
<PackageReference Include="Stylet" Version="1.3.6" />
<PackageReference Include="System.IdentityModel.Tokens.Jwt" Version="6.16.0" />
<PackageReference Include="System.IdentityModel.Tokens.Jwt" Version="6.17.0" />
<PackageReference Include="System.ServiceModel.Syndication" Version="6.0.0" />
<PackageReference Include="WPF.ListViewLayoutManager" Version="2.0.0" />
</ItemGroup>
Expand Down

0 comments on commit 4253deb

Please sign in to comment.