Skip to content

Commit

Permalink
v3.0.14
Browse files Browse the repository at this point in the history
  • Loading branch information
torum committed Aug 19, 2022
1 parent 52c4707 commit 140a64d
Show file tree
Hide file tree
Showing 3 changed files with 39 additions and 33 deletions.
6 changes: 3 additions & 3 deletions MPDCtrl-Desktop/MPDCtrl/MPDCtrl.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,13 @@

<PropertyGroup>
<OutputType>WinExe</OutputType>
<TargetFramework>net5.0-windows</TargetFramework>
<TargetFramework>net6.0-windows</TargetFramework>
<UseWPF>true</UseWPF>
<ApplicationIcon>MPDCtrl2.ico</ApplicationIcon>
<Version>3.0.13.0</Version>
<Version>3.0.14.0</Version>
<Authors>torum</Authors>
<Company>Torum</Company>
<Copyright>2021</Copyright>
<Copyright></Copyright>
<Description>MPD Client.</Description>
<PackageProjectUrl>https://torum.github.io/MPDCtrl/</PackageProjectUrl>
<StartupObject>MPDCtrl.App</StartupObject>
Expand Down
24 changes: 18 additions & 6 deletions MPDCtrl-Desktop/MPDCtrl/Models/BinaryDownloader.cs
Original file line number Diff line number Diff line change
Expand Up @@ -924,17 +924,13 @@ private async Task<CommandBinaryResult> MpdReQueryAlbumArt(string uri, int offse

if (!_albumCover.IsDownloading)
{
Debug.WriteLine("Error@MpdQueryAlbumArt: _albumCover.IsDownloading == false. Ignoring.");

CommandBinaryResult f = new();
f.IsSuccess = false;
return f;
}

if (_albumCover.SongFilePath != uri)
{
Debug.WriteLine("Error@MpdQueryAlbumArt: _albumCover.SongFilePath != uri. Ignoring.");

_albumCover.IsDownloading = false;

CommandBinaryResult f = new();
Expand All @@ -959,8 +955,24 @@ private static int CompareVersionString(string a, string b)

private static BitmapSource BitmaSourceFromByteArray(byte[] buffer)
{
using var stream = new MemoryStream(buffer);
return BitmapFrame.Create(stream, BitmapCreateOptions.None, BitmapCacheOption.OnLoad);
// Bug in MPD 0.23.5
if (buffer?.Length > 0)
{
using var stream = new MemoryStream(buffer);
try
{
return BitmapFrame.Create(stream, BitmapCreateOptions.None, BitmapCacheOption.OnLoad);

}
catch
{
return null;
}
}
else
{
return null;
}
}

public void MpdBinaryConnectionDisconnect()
Expand Down
42 changes: 18 additions & 24 deletions MPDCtrl-Desktop/MPDCtrl/ViewModels/MainViewModel.cs
Original file line number Diff line number Diff line change
@@ -1,30 +1,23 @@
using System;
using MPDCtrl.Common;
using MPDCtrl.Models;
using MPDCtrl.ViewModels.Classes;
using System;
using System.Collections.Generic;
using System.Threading.Tasks;
using System.Text;
using System.Windows.Data;
using System.Collections.ObjectModel;
using System.ComponentModel;
using System.Diagnostics;
using System.IO;
using System.Linq;
using System.Net;
using System.Security.Cryptography;
using System.Media;
using System.Diagnostics;
using System.Threading.Tasks;
using System.Windows;
using System.Windows.Media;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Input;
using System.Windows.Media;
using System.Xml;
using System.Xml.Linq;
using System.Windows.Input;
using System.IO;
using System.ComponentModel;
using System.Windows.Threading;
using System.Globalization;
using System.Net;
using System.Text.RegularExpressions;
using System.Windows.Media.Imaging;
using MPDCtrl.Common;
using MPDCtrl.Views;
using MPDCtrl.Models;
using MPDCtrl.ViewModels.Classes;

namespace MPDCtrl.ViewModels
{
Expand All @@ -46,6 +39,8 @@ namespace MPDCtrl.ViewModels
/// Add Search option "Exact" or "Contain".
///
/// Version history:
/// v3.0.14 MS Store release.
/// v3.0.13.2 Moved to Windows11 PC and .NET6 environment. Fixed a bug caused by a bug in MPD 0.23.5(included in Ubuntu 22.04.1 LTS).
/// v3.0.13.1 Little cleanup.
/// v3.0.13 MS Store release.
/// v3.0.12.3 Fixed bug : Move to NowPlaying after queue update was not working .
Expand Down Expand Up @@ -121,7 +116,7 @@ public class MainViewModel : ViewModelBase
const string _appName = "MPDCtrl";

// Application version
const string _appVer = "v3.0.13.1";
const string _appVer = "v3.0.14";

public static string AppVer
{
Expand Down Expand Up @@ -157,11 +152,11 @@ public static bool DeveloperMode
{
get
{
#if DEBUG
#if DEBUG
return true;
#else
#else
return false;
#endif
#endif
}
}

Expand Down Expand Up @@ -7809,5 +7804,4 @@ public void EscapeCommand_ExecuteAsync()

#endregion
}

}

0 comments on commit 140a64d

Please sign in to comment.