1 /* This file is part of Clementine.
2    Copyright 2012, David Sansome <me@davidsansome.com>
3    Copyright 2014, Krzysztof Sobiecki <sobkas@gmail.com>
4    Copyright 2014, John Maguire <john.maguire@gmail.com>
5 
6    Clementine is free software: you can redistribute it and/or modify
7    it under the terms of the GNU General Public License as published by
8    the Free Software Foundation, either version 3 of the License, or
9    (at your option) any later version.
10 
11    Clementine is distributed in the hope that it will be useful,
12    but WITHOUT ANY WARRANTY; without even the implied warranty of
13    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
14    GNU General Public License for more details.
15 
16    You should have received a copy of the GNU General Public License
17    along with Clementine.  If not, see <http://www.gnu.org/licenses/>.
18 */
19 
20 #ifndef INTERNET_LASTFM_LASTFMCOMPAT_H_
21 #define INTERNET_LASTFM_LASTFMCOMPAT_H_
22 
23 #include "config.h"
24 #include "fixlastfm.h"
25 
26 #ifdef HAVE_LIBLASTFM1
27 #include <lastfm5/Audioscrobbler.h>
28 #include <lastfm5/misc.h>
29 #include <lastfm5/ScrobbleCache.h>
30 #include <lastfm5/ScrobblePoint.h>
31 #include <lastfm5/User.h>
32 #include <lastfm5/ws.h>
33 #include <lastfm5/XmlQuery.h>
34 #else
35 #include <lastfm5/Audioscrobbler>
36 #include <lastfm5/misc.h>
37 #include <lastfm5/ScrobbleCache>
38 #include <lastfm5/ScrobblePoint>
39 #include <lastfm5/User>
40 #include <lastfm5/ws.h>
41 #include <lastfm5/XmlQuery>
42 #endif
43 
44 namespace lastfm {
45 namespace compat {
46 
47 lastfm::XmlQuery EmptyXmlQuery();
48 
49 bool ParseQuery(const QByteArray& data, lastfm::XmlQuery* query,
50                 bool* connection_problems = nullptr);
51 
52 bool ParseUserList(QNetworkReply* reply, QList<lastfm::User>* users);
53 
54 uint ScrobbleTimeMin();
55 
56 #ifdef HAVE_LIBLASTFM1
57 typedef lastfm::ScrobbleCache ScrobbleCache;
58 typedef lastfm::User AuthenticatedUser;
59 #else
60 typedef ::ScrobbleCache ScrobbleCache;
61 typedef lastfm::AuthenticatedUser AuthenticatedUser;
62 #endif
63 }  // namespace compat
64 }  // namespace lastfm
65 
66 #endif  // INTERNET_LASTFM_LASTFMCOMPAT_H_
67