Skip to content

Commit

Permalink
Merge branch 'develop'
Browse files Browse the repository at this point in the history
  • Loading branch information
Otiel committed Feb 20, 2022
2 parents 93b37bf + 38a2644 commit 4e8e3e1
Show file tree
Hide file tree
Showing 80 changed files with 4,453 additions and 1,222 deletions.
1 change: 1 addition & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
* text=auto
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,9 @@ ipch/
# ReSharper is a .NET coding add-in
_ReSharper*

# Rider
.idea

# NCrunch
*.ncrunch*
.*crunch*.local.xml
Expand Down
16 changes: 15 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,17 @@
# 1.4.0

## New features

* Added an option to download tracks and cover arts using HTTP instead of HTTPS. You can use this option if your HTTPS traffic to Bandcamp is blocked. Thanks **@LedAlex**! [#185](https://github.com/Otiel/BandcampDownloader/issues/185) [#193](https://github.com/Otiel/BandcampDownloader/pull/193)

## Improvements

* Added / updated translations thanks to contributors. [#170](https://github.com/Otiel/BandcampDownloader/pull/170) [#184](https://github.com/Otiel/BandcampDownloader/pull/184) [#190](https://github.com/Otiel/BandcampDownloader/pull/190)

## Bug fixes

* Fixed lyrics not saved. Thanks **@roonel**! [#176](https://github.com/Otiel/BandcampDownloader/issues/176) [#182](https://github.com/Otiel/BandcampDownloader/pull/182)

# 1.3.5

## Bug fixes
Expand All @@ -6,7 +20,7 @@

## Improvements

* Updated the following languages thanks to [contributors](https://github.com/Otiel/BandcampDownloader/pull/160): Italian.
* Updated the following languages thanks to [contributors](https://github.com/Otiel/BandcampDownloader/pull/166): Italian.

# 1.3.4

Expand Down
4 changes: 2 additions & 2 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,9 @@

This repository follows [git flow](https://nvie.com/posts/a-successful-git-branching-model) as a git branching and release management workflow. In short, after having forked the repository, you need to:

* Checkout a new branch from the `develop` branch, named either `feature-` or `fix-`:
* Checkout a new branch from the `develop` branch, named either `feature/` or `fix/`:

git checkout -b fix-cover-not-downloaded develop
git checkout -b fix/cover-not-downloaded develop

* Commit your changes to the new branch.
* When done, create a new pull request to your new branch.
Expand Down
2 changes: 1 addition & 1 deletion LICENSE
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
BandcampDownloader is licensed under the
MIT License

Copyright (c) 2018-2020 Otiel
Copyright (c) 2018-2022 Otiel

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
Expand Down
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<a href="https://github.com/Otiel/BandcampDownloader/releases/latest"><img alt="Download" src="docs/images/DownloadButton.png"></a>
</p>

[![build:master status](https://img.shields.io/appveyor/ci/Otiel/BandcampDownloader/master.svg?label=build:master&logo=appveyor)](https://ci.appveyor.com/project/Otiel/bandcampdownloader/branch/master) [![build:develop status](https://img.shields.io/appveyor/ci/Otiel/BandcampDownloader/develop.svg?label=build:develop&logo=appveyor)](https://ci.appveyor.com/project/Otiel/bandcampdownloader/branch/develop)
[![build:master status](https://img.shields.io/appveyor/ci/Otiel/BandcampDownloader/master.svg?label=build:master&logo=appveyor)](https://ci.appveyor.com/project/Otiel/bandcampdownloader/branch/master) [![build:develop status](https://img.shields.io/appveyor/ci/Otiel/BandcampDownloader/develop.svg?label=build:develop&logo=appveyor)](https://ci.appveyor.com/project/Otiel/bandcampdownloader/branch/develop) [![Translation status](https://hosted.weblate.org/widgets/bandcampdownloader/-/bandcampdownloader/svg-badge.svg)](https://hosted.weblate.org/engage/bandcampdownloader/)

## Description

Expand Down Expand Up @@ -35,7 +35,7 @@ See the [changelog](CHANGELOG.md).

## Contributing

You can help translating the application by going to the [Weblate project](https://hosted.weblate.org/engage/bandcampdownloader). See [here](docs/help-translate.md) for more info.
You can help translating the application by going to the [Weblate project](https://hosted.weblate.org/engage/bandcampdownloader). See the [documentation](docs/help-translate.md) for more info.

[![Translation status](https://hosted.weblate.org/widgets/bandcampdownloader/-/287x66-white.png)](https://hosted.weblate.org/engage/bandcampdownloader)

Expand Down
10 changes: 5 additions & 5 deletions docs/new-release.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,17 +11,17 @@ This repository follows [git flow](https://nvie.com/posts/a-successful-git-branc

## Create a new release branch

1. Create a new branch named `release-X.Y.Z` from `develop` and switch to this new branch.
1. Create a new branch named `release/X.Y.Z` from `develop` and switch to this new branch.
2. Bump the version number:
* Commit the changes on `CHANGELOG.md`.
* Update the assembly number on `AssemblyInfo.cs` and commit.

## Finish the release branch

1. Merge `release-X.Y.Z` into `master`.
2. Create a new tag called `vX.Y.Z`.
3. Merge `release-X.Y.Z` into `develop`.
4. Delete the `release-X.Y.Z` branch.
1. Merge `release/X.Y.Z` into `develop`.
2. Delete the `release/X.Y.Z` branch.
3. Merge `develop` into `master`.
4. Create a new tag called `vX.Y.Z` on `master`.
5. Push `master`, `develop` and the new tag.

## Create the GitHub release
Expand Down
41 changes: 28 additions & 13 deletions src/BandcampDownloader/App.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -6,26 +6,31 @@
using NLog.Config;
using NLog.Targets;

namespace BandcampDownloader {

public partial class App: Application {
namespace BandcampDownloader
{
public partial class App : Application
{
/// <summary>
/// Random class used to create random numbers.
/// </summary>
public static readonly Random Random = new Random();
private static readonly Logger _logger = LogManager.GetCurrentClassLogger();

/// <summary>
/// The settings chosen by the user.
/// </summary>
public static IUserSettings UserSettings { get; set; }

protected override void OnStartup(StartupEventArgs e) {
protected override void OnStartup(StartupEventArgs e)
{
base.OnStartup(e);
InitializeLogger();

// Manage unhandled exceptions
AppDomain.CurrentDomain.UnhandledException += CurrentDomain_UnhandledException;

LogAppProperties();

// Define the default security protocol to use for connection as TLS (#109)
ServicePointManager.SecurityProtocol |= SecurityProtocolType.Tls | SecurityProtocolType.Tls11 | SecurityProtocolType.Tls12;

Expand All @@ -34,17 +39,20 @@ protected override void OnStartup(StartupEventArgs e) {
ThemeHelper.ApplySkin(UserSettings.Theme);
}

private void CurrentDomain_UnhandledException(object sender, UnhandledExceptionEventArgs e) {
private void CurrentDomain_UnhandledException(object sender, UnhandledExceptionEventArgs e)
{
LogUnhandledExceptionToFile((Exception) e.ExceptionObject);

MessageBox.Show(String.Format(BandcampDownloader.Properties.Resources.messageBoxUnhandledException, Constants.UrlIssues), "Bandcamp Downloader", MessageBoxButton.OK, MessageBoxImage.Error);
MessageBox.Show(string.Format(BandcampDownloader.Properties.Resources.messageBoxUnhandledException, Constants.UrlIssues), "Bandcamp Downloader", MessageBoxButton.OK, MessageBoxImage.Error);
}

/// <summary>
/// Initializes the logger component.
/// </summary>
private void InitializeLogger() {
var fileTarget = new FileTarget() {
private void InitializeLogger()
{
var fileTarget = new FileTarget()
{
FileName = Constants.LogFilePath,
Layout = "${longdate} ${level:uppercase=true:padding=-5:padCharacter= } ${message}",
ArchiveAboveSize = Constants.MaxLogSize,
Expand All @@ -61,21 +69,28 @@ private void InitializeLogger() {
/// Initializes data context for bindings between settings values and settings controls. This must be called
/// before initializing UI forms.
/// </summary>
private void InitializeSettings() {
private void InitializeSettings()
{
App.UserSettings = new ConfigurationBuilder<IUserSettings>().UseIniFile(Constants.UserSettingsFilePath).Build();
if (string.IsNullOrEmpty(UserSettings.DownloadsPath)) {
if (string.IsNullOrEmpty(UserSettings.DownloadsPath))
{
// Its default value cannot be set in settings as it isn't determined by a constant function
App.UserSettings.DownloadsPath = Environment.GetFolderPath(Environment.SpecialFolder.Desktop) + "\\{artist}\\{album}";
}
}

private void LogAppProperties()
{
_logger.Info($"BandcampDownloader version: {Constants.AppVersion}");
_logger.Info($".NET Framework version: {SystemVersionHelper.GetDotNetFrameworkVersion()}");
}

/// <summary>
/// Writes the specified Exception to the application log file, along with the .NET version.
/// </summary>
/// <param name="exception">The Exception to log.</param>
private void LogUnhandledExceptionToFile(Exception exception) {
Logger logger = LogManager.GetCurrentClassLogger();
logger.Log(LogLevel.Fatal, $".NET Framework version: {SystemVersionHelper.GetDotNetFrameworkVersion()}");
private void LogUnhandledExceptionToFile(Exception exception)
{
LogHelper.LogExceptionAndInnerExceptionsToFile(exception);
}
}
Expand Down
9 changes: 9 additions & 0 deletions src/BandcampDownloader/BandcampDownloader.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -155,6 +155,7 @@
<Compile Include="Core\LogArgs.cs" />
<Compile Include="Helpers\LanguageHelper.cs" />
<Compile Include="Helpers\RichTextBoxHelper.cs" />
<Compile Include="Helpers\UrlHelper.cs" />
<Compile Include="Helpers\SystemVersionHelper.cs" />
<Compile Include="Helpers\ThemeHelper.cs" />
<Compile Include="Model\FileType.cs" />
Expand Down Expand Up @@ -292,24 +293,32 @@
<DependentUpon>Settings.settings</DependentUpon>
<DesignTimeSharedInput>True</DesignTimeSharedInput>
</Compile>
<EmbeddedResource Include="Properties\Resources.ar.resx" />
<EmbeddedResource Include="Properties\Resources.de.resx" />
<EmbeddedResource Include="Properties\Resources.eo.resx" />
<EmbeddedResource Include="Properties\Resources.es.resx" />
<EmbeddedResource Include="Properties\Resources.fi.resx" />
<EmbeddedResource Include="Properties\Resources.fr.resx" />
<EmbeddedResource Include="Properties\Resources.hr.resx" />
<EmbeddedResource Include="Properties\Resources.hu.resx" />
<EmbeddedResource Include="Properties\Resources.id.resx" />
<EmbeddedResource Include="Properties\Resources.it.resx" />
<EmbeddedResource Include="Properties\Resources.ko.resx" />
<EmbeddedResource Include="Properties\Resources.nb-NO.resx" />
<EmbeddedResource Include="Properties\Resources.nl.resx" />
<EmbeddedResource Include="Properties\Resources.pl.resx" />
<EmbeddedResource Include="Properties\Resources.pt.resx" />
<EmbeddedResource Include="Properties\Resources.pt-BR.resx" />
<EmbeddedResource Include="Properties\Resources.resx">
<Generator>ResXFileCodeGenerator</Generator>
<LastGenOutput>Resources.Designer.cs</LastGenOutput>
<SubType>Designer</SubType>
</EmbeddedResource>
<EmbeddedResource Include="Properties\Resources.ru.resx" />
<EmbeddedResource Include="Properties\Resources.sv.resx" />
<EmbeddedResource Include="Properties\Resources.tr.resx" />
<EmbeddedResource Include="Properties\Resources.uk.resx" />
<EmbeddedResource Include="Properties\Resources.vi.resx" />
<EmbeddedResource Include="Properties\Resources.zh.resx" />
<None Include="app.config">
<SubType>Designer</SubType>
Expand Down
7 changes: 4 additions & 3 deletions src/BandcampDownloader/Core/Constants.cs
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
using System.IO;
using System.Reflection;

namespace BandcampDownloader {

internal static class Constants {
namespace BandcampDownloader
{
internal static class Constants
{
/// <summary>
/// The version number of BandcampDownloader.
/// </summary>
Expand Down
Loading

0 comments on commit 4e8e3e1

Please sign in to comment.