Skip to content

Better image loading #4

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 73 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
73 commits
Select commit Hold shift + click to select a range
60f30db
renamed directory SoftThorn.Monstercat.Browser.Cli to Cli
Insire Oct 8, 2022
3189892
pool string builders for better startup performance
Insire Oct 9, 2022
3c2c6c1
added 5min request cache for faster application starts
Insire Oct 9, 2022
a0ab8f1
improve download performance, when there is nothing to download
Insire Oct 9, 2022
7c4f5f8
added Top x Tracks card
Insire Jan 2, 2023
484b80c
added Daignostics view showing raw data
Insire Jan 2, 2023
452883f
added fuzzy search for tracks
Insire Jan 2, 2023
aee2279
replace SynchronizationContext with IScheduler
Insire Jan 6, 2023
4b6c721
ui performance, and bugfix filter already downloaded files
Insire Jan 6, 2023
d888e94
.NET 7
Insire Jan 7, 2023
fa6132c
removed remainders from history features from code, reset playback ba…
Insire Jan 7, 2023
bc39725
updated dotnet-project-licenses
Insire Jan 7, 2023
66012f1
added toast notifications
Insire Jan 8, 2023
af1c64f
fixed request caching never fetching new data
Insire Jan 9, 2023
7aa4bf2
added SoftThorn.Monstercat.UnitTests wtih DownloadServiceTests
Insire Jan 14, 2023
f4a21d6
improved progress response time for downloads
Insire Jan 15, 2023
e2a5cf3
wip
Insire Jan 15, 2023
e21c7cd
remember playback volume between app starts
Insire Jan 15, 2023
a083423
updated readme
Insire Jan 15, 2023
9998259
CommunityToolkit.Mvvm bumped to 8.1
Insire Jan 21, 2023
772e800
fixed a bunch of warnings
Insire Jan 21, 2023
4b3e85e
improved handling of invalid mp3 frames encountered during live strea…
Insire Jan 21, 2023
4c4f048
use latest .net 7 sdk
Insire Jan 21, 2023
7edb5f6
updated wpf and core nuget packages
Insire Apr 22, 2023
6725dfb
rewrote charts, added download action via click on bar chart for genr…
Insire Apr 22, 2023
b3a9dfc
update .NET sdk
Insire Apr 22, 2023
298624c
Merge branch 'development/wpf' into playlistsupport
Insire Apr 22, 2023
1bccad2
updated wpf and core nuget packages
Insire Apr 29, 2023
f9ed105
added playlist creation
Insire Apr 29, 2023
42292e9
fix tests and cli
Insire Apr 29, 2023
0cb2707
added IncludeOnlyNewTracks filter for playlist creation, fixed updati…
Insire May 7, 2023
6cdb3af
wip
Insire Jun 4, 2023
c15ccad
update .net sdk
Insire Jun 8, 2023
5bfe462
fixed tracks not downloadable after logging in
Insire Jun 11, 2023
b76080a
prevent duplicate files in playlist
Insire Jun 11, 2023
ad01acd
updated nuget packages
Insire Jun 11, 2023
2845663
added ImagePlaceholder
Insire Jun 11, 2023
f3f5033
fixed bar chart order
Insire Jun 11, 2023
68f1701
fixed filter icon in DataView
Insire Jun 17, 2023
f5c5af0
renamed PlaylistManagerView file
Insire Jun 17, 2023
8a5052a
handle missing track description resulting in no default playlist file
Insire Jun 17, 2023
ff25548
use better icon for playback button
Insire Jun 17, 2023
10f466d
fixed global json
Insire Jun 17, 2023
aa463e8
added playlist manager
Insire Jun 17, 2023
9d126a7
use unique keys for locks and images in memorycache
Insire Jun 17, 2023
654a7d8
implemented loading monstercat playlists
Insire Jun 25, 2023
2b31c86
improve download performance
Insire Aug 20, 2023
2c41b60
update .NET SDK
Insire Aug 20, 2023
03e135a
hide sections in shell during refresh
Insire Aug 20, 2023
447284c
include tracks in playlist that have been downloaded already
Insire Aug 20, 2023
065d6a5
make downloads more efficient and sync changed download folder to Pla…
Insire Aug 20, 2023
74ba3ff
split apart WindowService
Insire Aug 20, 2023
597e1cd
use more available resources, when writing playlist files
Insire Aug 20, 2023
f334935
added basic version of saving playlist as file
Insire Aug 20, 2023
2cfae3c
migrate to central package management
Insire Aug 20, 2023
e74780d
update nuget packages
Insire Aug 20, 2023
97e1a5d
added source mapping
Insire Aug 20, 2023
d5a5a4d
migrating moq to NSubstitue
Insire Aug 27, 2023
abd4381
updated dependencies, fixed PackageSourceMapping in nuget.config
Insire Aug 27, 2023
ed7202a
renamed TrackRepository
Insire Aug 27, 2023
e240049
added playlist management
Insire Sep 23, 2023
c9eaf0f
better progress reporting, fixed playlist update
Insire Sep 23, 2023
6e93cbe
updated nuget packages and referenced transitive dependencies to clos…
Insire Sep 23, 2023
9f91507
fixed SaveFileDialog not adding filextesion, refactored playlist butt…
Insire Oct 8, 2023
96df1f0
migrate to .net8 and add windows installer
Insire Nov 23, 2023
98351c8
fixed cli, moved to MS.Ext.Logging as logging abstraction
Insire Dec 17, 2023
7966aa7
fixed tests
Insire Dec 17, 2023
3854270
improve handling of missing credentials
Insire May 12, 2024
af4ce41
misc
Insire May 12, 2024
be29a84
drop playlist creation during download
Insire May 12, 2024
be7490e
added new ReleaseType filter to searchview
Insire May 12, 2024
5f3fc9a
Merge branch 'main' into better_image_loading
Insire May 12, 2024
3d319e6
updated readme
Insire May 12, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
43 changes: 41 additions & 2 deletions .editorconfig
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,9 @@ indent_size = 4
charset = utf-8
trim_trailing_whitespace = true
insert_final_newline = true
dotnet_style_operator_placement_when_wrapping = beginning_of_line
tab_width = 4
end_of_line = crlf


[*.cs]
Expand Down Expand Up @@ -98,7 +101,7 @@ dotnet_style_parentheses_in_other_operators = never_if_unnecessary:warning
# object initializers

dotnet_style_object_initializer = true:warning
dotnet_style_collection_initializer = true:warning
dotnet_style_collection_initializer = false:suggestion

# conditionals

Expand Down Expand Up @@ -180,7 +183,7 @@ csharp_prefer_simple_using_statement = false:suggestion
dotnet_style_prefer_simplified_boolean_expressions = true:suggestion

# IDE0058: Expression value is never used
csharp_style_unused_value_expression_statement_preference = discard_variable
csharp_style_unused_value_expression_statement_preference = discard_variable:silent
dotnet_diagnostic.IDE0058.severity = none

# IDE0045: Use conditional expression for assignment
Expand All @@ -195,3 +198,39 @@ dotnet_diagnostic.CA1806.severity = none
# IDE0130: Namespace does not match folder structure
dotnet_style_namespace_match_folder = true
dotnet_diagnostic.IDE0130.severity = none

# IDE0090: Use 'new(...)'
csharp_style_implicit_object_creation_when_type_is_apparent = false:suggestion

csharp_style_namespace_declarations = block_scoped:silent
csharp_style_prefer_method_group_conversion = true:silent
csharp_style_prefer_top_level_statements = true:silent
csharp_style_expression_bodied_lambdas = true:silent
csharp_style_expression_bodied_local_functions = false:silent
csharp_style_prefer_null_check_over_type_check = true:suggestion
csharp_style_prefer_local_over_anonymous_function = true:suggestion
csharp_style_prefer_index_operator = true:suggestion
csharp_style_prefer_range_operator = true:suggestion
csharp_style_prefer_tuple_swap = true:suggestion
csharp_style_prefer_utf8_string_literals = true:suggestion
csharp_style_unused_value_assignment_preference = discard_variable:suggestion

dotnet_style_coalesce_expression = true:silent
dotnet_style_null_propagation = true:silent
dotnet_style_prefer_is_null_check_over_reference_equality_method = true:silent
dotnet_style_prefer_auto_properties = true:silent
dotnet_style_object_initializer = true:warning
dotnet_style_prefer_simplified_boolean_expressions = true:suggestion
dotnet_style_prefer_conditional_expression_over_assignment = false:silent
dotnet_style_prefer_conditional_expression_over_return = false:suggestion
dotnet_style_explicit_tuple_names = true:error
dotnet_style_prefer_inferred_tuple_names = true:suggestion
dotnet_style_prefer_inferred_anonymous_type_member_names = false:suggestion
dotnet_style_prefer_compound_assignment = true:suggestion
dotnet_style_prefer_simplified_interpolation = true:suggestion
dotnet_style_namespace_match_folder = true:suggestion
dotnet_style_readonly_field = true:warning
csharp_style_prefer_primary_constructors = false:suggestion

# IDE0300: Simplify collection initialization
dotnet_style_prefer_collection_expression = false
16 changes: 8 additions & 8 deletions build/cake/Build.sln → Build.sln
Original file line number Diff line number Diff line change
@@ -1,25 +1,25 @@

Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio Version 16
VisualStudioVersion = 16.0.31112.23
# Visual Studio Version 17
VisualStudioVersion = 17.7.34221.43
MinimumVisualStudioVersion = 10.0.40219.1
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Build", "Build.csproj", "{A3681B14-6073-4CEF-9484-537EACE8036F}"
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Build", "build\cake\Build.csproj", "{E23ADC45-EE86-433F-9656-2D8E479996DB}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
Release|Any CPU = Release|Any CPU
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{A3681B14-6073-4CEF-9484-537EACE8036F}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{A3681B14-6073-4CEF-9484-537EACE8036F}.Debug|Any CPU.Build.0 = Debug|Any CPU
{A3681B14-6073-4CEF-9484-537EACE8036F}.Release|Any CPU.ActiveCfg = Release|Any CPU
{A3681B14-6073-4CEF-9484-537EACE8036F}.Release|Any CPU.Build.0 = Release|Any CPU
{E23ADC45-EE86-433F-9656-2D8E479996DB}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{E23ADC45-EE86-433F-9656-2D8E479996DB}.Debug|Any CPU.Build.0 = Debug|Any CPU
{E23ADC45-EE86-433F-9656-2D8E479996DB}.Release|Any CPU.ActiveCfg = Release|Any CPU
{E23ADC45-EE86-433F-9656-2D8E479996DB}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution
SolutionGuid = {87B91DF1-B65B-485A-8DE2-E8454257A3D3}
SolutionGuid = {1BA4F329-14BA-4003-AC56-B766D7834FC5}
EndGlobalSection
EndGlobal
4 changes: 2 additions & 2 deletions Directory.Build.targets
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,12 @@
<PropertyGroup>
<Nullable>enable</Nullable>
<GenerateAssemblyInfo>False</GenerateAssemblyInfo>
<LangVersion>10.0</LangVersion>
<LangVersion>12.0</LangVersion>
<CodeAnalysisRuleSet>.\..\..\SoftThorn.Monstercat.Browser.ruleset</CodeAnalysisRuleSet>
</PropertyGroup>

<ItemGroup Condition=" '$(Configuration)'=='Debug' ">
<PackageReference Include="Roslynator.Analyzers" Version="4.1.1">
<PackageReference Include="Roslynator.Analyzers">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
Expand Down
88 changes: 88 additions & 0 deletions Directory.Packages.props
Original file line number Diff line number Diff line change
@@ -0,0 +1,88 @@
<Project>
<PropertyGroup>
<ManagePackageVersionsCentrally>true</ManagePackageVersionsCentrally>
</PropertyGroup>
<ItemGroup>
<!--Avalonia -->
<PackageVersion Include="Avalonia" Version="0.10.17" />
<PackageVersion Include="Avalonia.Desktop" Version="0.10.17" />
<!--Condition below is needed to remove Avalonia.Diagnostics package from build output in Release configuration.-->
<PackageVersion Condition="'$(Configuration)' == 'Debug'" Include="Avalonia.Diagnostics" Version="0.10.17" />
<PackageVersion Include="Material.Avalonia" Version="3.0.0-rc0.90-nightly" />
<PackageVersion Include="Material.Icons.Avalonia" Version="1.1.10" />
<PackageVersion Include="Serilog.Extensions.Logging" Version="8.0.0" />
<!--CLI -->
<PackageVersion Include="Spectre.Console" Version="0.48.0" />
<PackageVersion Include="Spectre.Console.Cli" Version="0.48.0" />
<PackageVersion Include="Spectre.Console.Analyzer" Version="0.48.0" />
<!--NAudio -->
<PackageVersion Include="NAudio" Version="2.2.1" />
<PackageVersion Include="NAudio.Core" Version="2.2.1" />
<!--LiveCharts -->
<PackageVersion Include="LiveChartsCore" Version="2.0.0-beta.300" />
<PackageVersion Include="LiveChartsCore.SkiaSharpView" Version="2.0.0-beta.300" />
<PackageVersion Include="LiveChartsCore.SkiaSharpView.WPF" Version="2.0.0-beta.300" />
<PackageVersion Include="Microsoft.Extensions.ObjectPool" Version="8.0.4" />
<PackageVersion Include="Microsoft.Extensions.Configuration.CommandLine" Version="8.0.0" />
<PackageVersion Include="Microsoft.Extensions.Configuration.EnvironmentVariables" Version="8.0.0" />
<PackageVersion Include="Microsoft.Extensions.Caching.Memory" Version="8.0.0" />
<PackageVersion Include="Microsoft.Extensions.Configuration.Abstractions" Version="8.0.0" />
<PackageVersion Include="Microsoft.Extensions.Configuration.Binder" Version="8.0.1" />
<PackageVersion Include="Microsoft.Extensions.Configuration.Json" Version="8.0.0" />
<PackageVersion Include="Microsoft.Extensions.Configuration.UserSecrets" Version="8.0.0" />
<!--WPF -->
<PackageVersion Include="Jot" Version="2.1.17" />
<PackageVersion Include="Ookii.Dialogs.Wpf" Version="5.0.1" />
<PackageVersion Include="MahApps.Metro.IconPacks.FontAwesome" Version="4.11.0" />
<PackageVersion Include="MaterialDesignThemes.MahApps" Version="0.3.0" />
<PackageVersion Include="MahApps.Metro" Version="2.4.10" />
<PackageVersion Include="XamlFlair.WPF" Version="1.2.13" />
<PackageVersion Include="Magick.NET.SystemWindowsMedia" Version="7.2.1" />
<!--Logging-->
<PackageVersion Include="Microsoft.Extensions.Logging.Abstractions" Version="8.0.1" />
<PackageVersion Include="Microsoft.Extensions.Logging" Version="8.0.0" />
<PackageVersion Include="Serilog" Version="3.1.1" />
<PackageVersion Include="Serilog.Enrichers.Environment" Version="2.3.0" />
<PackageVersion Include="Serilog.Enrichers.Process" Version="2.0.2" />
<PackageVersion Include="Serilog.Enrichers.Thread" Version="3.1.0" />
<PackageVersion Include="Serilog.Sinks.Debug" Version="2.0.0" />
<PackageVersion Include="Serilog.Sinks.XUnit" Version="3.0.5" />
<PackageVersion Include="Serilog.Sinks.TestCorrelator" Version="3.2.0" />
<!--Misc-->
<PackageVersion Include="Newtonsoft.Json" Version="13.0.1" />
<PackageVersion Include="Roslynator.Analyzers" Version="4.12.2" />
<PackageVersion Include="EmailValidation" Version="1.0.10" />
<PackageVersion Include="akavache" Version="9.1.20" />
<PackageVersion Include="CommunityToolkit.Mvvm" Version="8.2.2" />
<PackageVersion Include="DynamicData" Version="8.4.1" />
<PackageVersion Include="Gress" Version="2.1.1" />
<PackageVersion Include="MonstercatNet" Version="3.0.52" />
<PackageVersion Include="z440.atl.core" Version="5.23.0" />
<PackageVersion Include="FuzzySharp" Version="2.0.2" />
<PackageVersion Include="System.Text.Json" Version="8.0.3" />
<PackageVersion Include="DryIoc.dll" Version="5.4.3" />
<PackageVersion Include="Magick.NET-Q8-AnyCPU" Version="13.5.0" />
<PackageVersion Include="Microsoft.IO.RecyclableMemoryStream" Version="3.0.0" />
<PackageVersion Include="Nerdbank.GitVersioning" Version="3.6.133" />
<PackageVersion Include="Microsoft.NET.Test.Sdk" Version="17.9.0" />
<PackageVersion Include="NSubstitute" Version="5.1.0" />
<PackageVersion Include="SkiaSharp" Version="2.88.6" />
<PackageVersion Include="System.Drawing.Common" Version="8.0.4" />
<PackageVersion Include="System.Net.Http" Version="4.3.4" />
<PackageVersion Include="System.Text.RegularExpressions" Version="4.3.1" />
<!--Assertions-->
<PackageVersion Include="FluentAssertions" Version="6.12.0" />
<PackageVersion Include="FluentAssertions.Analyzers" Version="0.31.0" />
<!--XUnit-->
<PackageVersion Include="xunit" Version="2.8.0" />
<PackageVersion Include="xunit.runner.visualstudio" Version="2.8.0" />
<PackageVersion Include="coverlet.collector" Version="6.0.2" />
<!--Cake-->
<PackageVersion Include="Cake.Compression" Version="0.3.0" />
<PackageVersion Include="Cake.Frosting" Version="3.0.0" />
<PackageVersion Include="Cake.GitVersioning" Version="3.6.133" />
<PackageVersion Include="Cake.Incubator" Version="7.0.0" />
<PackageVersion Include="SharpZipLib" Version="1.4.1" />
<PackageVersion Include="GitVersion.CommandLine" Version="5.11.1" />
</ItemGroup>
</Project>
8 changes: 2 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ The SoftThorn.Monstercat.Browser app (or SMB app for short) is my approach for d
## Features

- Browse the latest tracks and releases from [monstercat](https://www.monstercat.com/)
- Stream/Play music directly from [monstercat](https://www.monstercat.com/)
- Download any/all of their music to your local device (You need an active Gold Subscription for that!)
- Settings
- Download locations
Expand All @@ -28,17 +29,12 @@ The SoftThorn.Monstercat.Browser app (or SMB app for short) is my approach for d

### Planned

- Settings Storage (persist configuration between app restarts)
- color selection?
- Enable AssetSize Configuration (Download the art in the format and size you like)
- AutoUpdate via Github releases
- Playlist (manage playback via playlists)
- Playbackmode (shuffle, one, all, folder)

### ToDo

- add Previous button for going back to the previous track
- remember playback volume level
- figure out how to show playback progress with NAudio
- auto updates
- sign my binaries
Expand All @@ -54,6 +50,6 @@ This app uses SDK-style project files, which means you are required to use [Visu
For anyone not wishing to install that, they atleast need:

- Windows 10 (older versions work probably too, but the repository is not configured for those)
- [Net 6.0](https://dotnet.microsoft.com/download/dotnet-core/6.0)
- [Net 8.0](https://dotnet.microsoft.com/download/dotnet-core/8.0)
- [Visual Studio Code](https://code.visualstudio.com/) with the [C# Extension](https://github.com/OmniSharp/omnisharp-vscode) provided by Microsoft
- [git](https://git-scm.com/)
11 changes: 10 additions & 1 deletion SoftThorn.Monstercat.Browser.sln
Original file line number Diff line number Diff line change
Expand Up @@ -9,17 +9,22 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "SoftThorn.Monstercat.Browse
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution Items", "{73F118B7-BF91-451D-887F-3390EF495E67}"
ProjectSection(SolutionItems) = preProject
.editorconfig = .editorconfig
Directory.Build.props = Directory.Build.props
Directory.Build.targets = Directory.Build.targets
Directory.Packages.props = Directory.Packages.props
global.json = global.json
nuget.config = nuget.config
README.md = README.md
SoftThorn.Monstercat.Browser.ruleset = SoftThorn.Monstercat.Browser.ruleset
version.json = version.json
EndProjectSection
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "SoftThorn.Monstercat.Browser.Avalonia", "src\Avalonia\SoftThorn.Monstercat.Browser.Avalonia.csproj", "{B3989C1E-304F-4A19-B165-CAD1599E18FC}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "SoftThorn.Monstercat.Browser.Cli", "src\SoftThorn.Monstercat.Browser.Cli\SoftThorn.Monstercat.Browser.Cli.csproj", "{B244F528-4062-4FC0-99BB-5899FB895CB7}"
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "SoftThorn.Monstercat.Browser.Cli", "src\Cli\SoftThorn.Monstercat.Browser.Cli.csproj", "{B244F528-4062-4FC0-99BB-5899FB895CB7}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "SoftThorn.Monstercat.UnitTests", "src\UnitTests\SoftThorn.Monstercat.UnitTests.csproj", "{8CFF5DAE-DF5E-4EBC-919F-E500EF05846D}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Expand All @@ -43,6 +48,10 @@ Global
{B244F528-4062-4FC0-99BB-5899FB895CB7}.Debug|Any CPU.Build.0 = Debug|Any CPU
{B244F528-4062-4FC0-99BB-5899FB895CB7}.Release|Any CPU.ActiveCfg = Release|Any CPU
{B244F528-4062-4FC0-99BB-5899FB895CB7}.Release|Any CPU.Build.0 = Release|Any CPU
{8CFF5DAE-DF5E-4EBC-919F-E500EF05846D}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{8CFF5DAE-DF5E-4EBC-919F-E500EF05846D}.Debug|Any CPU.Build.0 = Debug|Any CPU
{8CFF5DAE-DF5E-4EBC-919F-E500EF05846D}.Release|Any CPU.ActiveCfg = Release|Any CPU
{8CFF5DAE-DF5E-4EBC-919F-E500EF05846D}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
Expand Down
Binary file modified assets/icons/Material-Play.ico
Binary file not shown.
14 changes: 7 additions & 7 deletions build/cake/Build.csproj
Original file line number Diff line number Diff line change
@@ -1,20 +1,20 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFramework>net60</TargetFramework>
<TargetFramework>net7.0</TargetFramework>

<!-- Make sure start same folder .NET Core CLI and Visual Studio -->
<RunWorkingDirectory>$(MSBuildProjectDirectory)</RunWorkingDirectory>
</PropertyGroup>

<ItemGroup>
<PackageReference Include="Cake.Compression" Version="0.3.0" />
<PackageReference Include="Cake.Frosting" Version="2.2.0" />
<PackageReference Include="Cake.GitVersioning" Version="3.5.113" />
<PackageReference Include="Cake.Incubator" Version="7.0.0" />
<PackageReference Include="SharpZipLib" Version="1.4.0" />
<PackageReference Include="Cake.Compression" />
<PackageReference Include="Cake.Frosting" />
<PackageReference Include="Cake.GitVersioning" />
<PackageReference Include="Cake.Incubator" />
<PackageReference Include="SharpZipLib" />

<PackageReference Include="GitVersion.CommandLine" Version="5.10.3">
<PackageReference Include="GitVersion.CommandLine">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
Expand Down
2 changes: 1 addition & 1 deletion build/cake/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ public static int Main(string[] args)
.UseContext<BuildContext>()
.UseWorkingDirectory("../../")
.SetToolPath("../")
.InstallTool(new Uri("nuget:?package=GitVersion.CommandLine&version=5.10.3"))
.InstallTool(new Uri("nuget:?package=GitVersion.CommandLine&version=5.12.0"))
.Run(args);
}
}
Expand Down
2 changes: 1 addition & 1 deletion build/cake/Tasks/GenerateLicenseFileTask.cs
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ namespace Build
public sealed class GenerateLicenseFileTask : FrostingTask<BuildContext>
{
private const string DotnetToolName = "dotnet-project-licenses";
private const string DotnetToolVersion = "2.4.0";
private const string DotnetToolVersion = "2.5.0";

public override void Run(BuildContext context)
{
Expand Down
2 changes: 1 addition & 1 deletion global.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"sdk": {
"version": "6.0.401",
"version": "8.0.204",
"rollForward": "disable"
}
}
27 changes: 27 additions & 0 deletions nuget.config
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
<?xml version="1.0" encoding="utf-8"?>
<configuration>
<packageSources>
<!--To inherit the global NuGet package sources remove the <clear/> line below -->
<clear />
<add key="nuget" value="https://api.nuget.org/v3/index.json" />
<add key="local" value="D:\Drop\NuGet" />
</packageSources>

<!-- Define mappings by adding package patterns beneath the target source. -->
<!-- Contoso.* packages and NuGet.Common will be restored from contoso.com, everything else from nuget.org. -->
<packageSourceMapping>
<!-- key value for <packageSource> should match key values from <packageSources> element -->
<packageSource key="local">
<package pattern="Monstercat*" />
</packageSource>
<packageSource key="nuget">
<package pattern="*" />
</packageSource>
</packageSourceMapping>

<activePackageSource>
<!-- All non-disabled sources are active -->
<add key="All" value="(Aggregate source)" />
</activePackageSource>

</configuration>
13 changes: 12 additions & 1 deletion src/Avalonia/App.axaml.cs
Original file line number Diff line number Diff line change
@@ -1,7 +1,11 @@
using Avalonia;
using Avalonia.Controls.ApplicationLifetimes;
using Avalonia.Markup.Xaml;
using Avalonia.Media.Imaging;
using DryIoc;
using Microsoft.Extensions.Caching.Memory;
using Microsoft.Extensions.Logging;
using Microsoft.IO;
using SoftThorn.Monstercat.Browser.Core;
using System.Threading;

Expand All @@ -25,6 +29,10 @@ public override async void OnFrameworkInitializationCompleted()
{
var container = _container = CompositionRoot.Get();

ImageLoader.Manager = container.Resolve<RecyclableMemoryStreamManager>();
ImageLoader.ImageFactory = container.Resolve<IImageFactory<IBitmap>>();
ImageLoader.AsyncImageLoader = new RamCachedWebImageLoader<IBitmap>(container.Resolve<ILogger<RamCachedWebImageLoader<IBitmap>>>(), new MemoryCache(new MemoryCacheOptions()), ImageLoader.Manager, ImageLoader.ImageFactory);

var settingsViewModel = container.Resolve<SettingsViewModel>();
// the shellviewmodel has to exist, so that loading the settings updates its own and all of its dependencies initial state
var shellViewModel = container.Resolve<ShellViewModel>();
Expand All @@ -37,7 +45,10 @@ public override async void OnFrameworkInitializationCompleted()
desktop.MainWindow = new Shell(shellViewModel);

var loginViewModel = container.Resolve<LoginViewModel>();
await loginViewModel.TryLogin(null, CancellationToken.None);
if (!await loginViewModel.TryLogin(null, CancellationToken.None))
{
desktop.Shutdown();
}

await shellViewModel.Refresh();

Expand Down
Loading