public bool UpdateLastfmSession(string sessionKey)
{
ISQLiteConnection conn = null;
try
{
conn = Injection.Kernel.Get<IDatabase>().GetSqliteConnection();
int affected = conn.Execute("UPDATE User SET LastfmSession = ? WHERE UserName = ?", sessionKey, UserName);
if (affected > 0)
{
this.LastfmSession = sessionKey;
return Injection.Kernel.Get<IUserRepository>().UpdateUserCache(this);
}
}
catch (Exception e)
{
logger.Error(e);
}
finally
{
Injection.Kernel.Get<IDatabase>().CloseSqliteConnection(conn);
}
return false;
}