Skip to content

Commit

Permalink
#61 logging (#71)
Browse files Browse the repository at this point in the history
* Update WebScraper.cs

* Update MainWindowViewModel.cs

* Update CyberdropDownloader.Avalonia.csproj
  • Loading branch information
Anequit authored Jan 23, 2022
1 parent 4fa923b commit 9c81d32
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 15 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -6,15 +6,15 @@
<AssemblyName>Cyberdrop Downloader</AssemblyName>
<Copyright>Copyright © 2022</Copyright>
<Product>Cyberdrop Downloader</Product>
<AssemblyVersion>2.2.4.0</AssemblyVersion>
<AssemblyVersion>2.2.5.0</AssemblyVersion>
<FileVersion>2.2.4.0</FileVersion>
<NeutralLanguage>en</NeutralLanguage>
<Company />
<Authors />
<PackageIconUrl />
<ApplicationIcon>Assets\duck.ico</ApplicationIcon>
<Win32Resource />
<Version>2.2.4</Version>
<Version>2.2.5</Version>
<PackageProjectUrl>https://github.com/izqalan/cy-client</PackageProjectUrl>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|AnyCPU'">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
using Avalonia.Threading;
using CyberdropDownloader.Avalonia.ViewModels.Core;
using CyberdropDownloader.Core;
using CyberdropDownloader.Core.Exceptions;
using ReactiveUI;
using System;
using System.Diagnostics;
Expand All @@ -10,7 +11,6 @@
using System.Reflection;
using System.Threading;
using System.Threading.Tasks;
using CyberdropDownloader.Core.Exceptions;

namespace CyberdropDownloader.Avalonia.ViewModels
{
Expand Down Expand Up @@ -135,9 +135,11 @@ await Task.Run(async () =>
case NullAlbumFilesException:
Log("Failed to fetch album files.");
break;
}

continue;
default:
Log("Unknown webscraper error. Please report this to the github repository.");
continue;
}
}

// If the album url is invalid, then log and skip over it
Expand Down
13 changes: 3 additions & 10 deletions src/CyberdropDownloader.Core/WebScraper.cs
Original file line number Diff line number Diff line change
Expand Up @@ -25,17 +25,10 @@ await Task.Run(async () =>

if(htmlDocument != null)
{
try
{
(string title, string size, Queue<AlbumFile> files) albumData = FetchAlbumData(htmlDocument);
(string title, string size, Queue<AlbumFile> files) albumData = FetchAlbumData(htmlDocument);

_album = new Album(albumData.title, albumData.size, albumData.files);
_successful = true;
}
catch(Exception)
{
_successful = false;
}
_album = new Album(albumData.title, albumData.size, albumData.files);
_successful = true;
}
});
}
Expand Down

0 comments on commit 9c81d32

Please sign in to comment.