Listenbrainz: save listen even if send failed

This commit is contained in:
emeric
2022-01-24 21:28:28 +01:00
parent fba20fcb7d
commit 86b16266b6
5 changed files with 196 additions and 142 deletions
@@ -24,15 +24,13 @@
#include "services/database/ArtistId.hpp"
#include "services/database/ClusterId.hpp"
#include "services/database/IdType.hpp"
#include "services/database/ListenId.hpp"
#include "services/database/Object.hpp"
#include "services/database/ReleaseId.hpp"
#include "services/database/TrackId.hpp"
#include "services/database/Types.hpp"
#include "services/database/UserId.hpp"
LMS_DECLARE_IDTYPE(ListenId)
namespace Database
{
@@ -90,6 +88,11 @@ class Listen : public Object<Listen, ListenId>
const std::vector<ClusterId>& clusterIds,
Range range = {});
ScrobblingState getScrobblingState() const { return _scrobblingState; }
ObjectPtr<User> getUser() const { return _user; }
void setScrobblingState(ScrobblingState state) { _scrobblingState = state; }
template<class Action>
void persist(Action& a)
{
@@ -0,0 +1,25 @@
/*
* Copyright (C) 2022 Emeric Poupon
*
* This file is part of LMS.
*
* LMS is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* LMS is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with LMS. If not, see <http://www.gnu.org/licenses/>.
*/
#pragma once
#include "services/database/IdType.hpp"
LMS_DECLARE_IDTYPE(ListenId)