Skip to content

Commit

Permalink
WindowsStore: MPfm.Library now builds correctly. However, the WinRT i…
Browse files Browse the repository at this point in the history
…mplementation of DatabaseFacade is not completed yet.

Related to issue #423.
  • Loading branch information
ycastonguay committed Sep 11, 2013
1 parent 1c82b8c commit 36f7a1f
Show file tree
Hide file tree
Showing 9 changed files with 395 additions and 371 deletions.
6 changes: 3 additions & 3 deletions MPfm/MPfm.Core/MPfm.Core.WindowsStore.csproj
Expand Up @@ -35,7 +35,7 @@
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Debug|ARM'">
<DebugSymbols>true</DebugSymbols>
<OutputPath>bin\ARM\Debug\</OutputPath>
<DefineConstants>DEBUG;TRACE;NETFX_CORE</DefineConstants>
<DefineConstants>TRACE;DEBUG;NETFX_CORE;WINDOWSSTORE</DefineConstants>
<NoWarn>;2008</NoWarn>
<DebugType>full</DebugType>
<PlatformTarget>ARM</PlatformTarget>
Expand All @@ -57,7 +57,7 @@
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Debug|x64'">
<DebugSymbols>true</DebugSymbols>
<OutputPath>bin\x64\Debug\</OutputPath>
<DefineConstants>DEBUG;TRACE;NETFX_CORE</DefineConstants>
<DefineConstants>TRACE;DEBUG;NETFX_CORE;WINDOWSSTORE</DefineConstants>
<NoWarn>;2008</NoWarn>
<DebugType>full</DebugType>
<PlatformTarget>x64</PlatformTarget>
Expand All @@ -79,7 +79,7 @@
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Debug|x86'">
<DebugSymbols>true</DebugSymbols>
<OutputPath>bin\x86\Debug\</OutputPath>
<DefineConstants>DEBUG;TRACE;NETFX_CORE</DefineConstants>
<DefineConstants>TRACE;DEBUG;NETFX_CORE;WINDOWSSTORE</DefineConstants>
<NoWarn>;2008</NoWarn>
<DebugType>full</DebugType>
<PlatformTarget>x86</PlatformTarget>
Expand Down
19 changes: 15 additions & 4 deletions MPfm/MPfm.Library/Database/DatabaseFacade.cs
Expand Up @@ -902,8 +902,14 @@ public int GetAudioFilePlayCountFromHistory(Guid audioFileId)
string query = "SELECT COUNT(*) FROM History WHERE AudioFileId = '" + audioFileId.ToString() + "'";
object value = _gateway.ExecuteScalar(query);

// Check value for null
if (value == DBNull.Value)
bool isNull = false;
#if WINDOWSSTORE
isNull = value == null;
#else
isNull = value == DBNull.Value;
#endif

if (isNull)
{
// No play count
return 0;
Expand Down Expand Up @@ -940,8 +946,13 @@ public int GetAudioFilePlayCountFromHistory(Guid audioFileId)
string query = "SELECT TOP 1 FROM History WHERE AudioFileId = '" + audioFileId.ToString() + "' ORDER BY EventDateTime";
object value = _gateway.ExecuteScalar(query);

// Check value for null
if (value == DBNull.Value)
bool isNull = false;
#if WINDOWSSTORE
isNull = value == null;
#else
isNull = value == DBNull.Value;
#endif
if (isNull)
{
// No last played value
return null;
Expand Down

0 comments on commit 36f7a1f

Please sign in to comment.