Sayonara Player
Toggle main menu visibility
Loading...
Searching...
No Matches
src
Components
Covers
CoverFetchManager.h
1
/* CoverFetchManager.h */
2
3
/* Copyright (C) 2011-2024 Michael Lugmair (Lucio Carreras)
4
*
5
* This file is part of sayonara player
6
*
7
* This program is free software: you can redistribute it and/or modify
8
* it under the terms of the GNU General Public License as published by
9
* the Free Software Foundation, either version 3 of the License, or
10
* (at your option) any later version.
11
12
* This program is distributed in the hope that it will be useful,
13
* but WITHOUT ANY WARRANTY; without even the implied warranty of
14
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15
* GNU General Public License for more details.
16
17
* You should have received a copy of the GNU General Public License
18
* along with this program. If not, see <http://www.gnu.org/licenses/>.
19
*/
20
21
#ifndef COVERFETCHMANAGER_H
22
#define COVERFETCHMANAGER_H
23
24
#include "Utils/Singleton.h"
25
#include "Utils/Pimpl.h"
26
27
#include <QList>
28
#include <QObject>
29
30
namespace
Cover
31
{
32
namespace
Fetcher
33
{
34
class
Base
;
35
class
Url
;
36
37
using
CoverFetcherPtr = std::shared_ptr<Cover::Fetcher::Base>;
38
using
CoverFetcherList = QList<CoverFetcherPtr>;
39
48
class
Manager
:
49
public
QObject
50
{
51
Q_OBJECT
52
SINGLETON(
Manager
)
53
PIMPL(
Manager
)
54
55
public
:
61
void
registerCoverFetcher
(CoverFetcherPtr fetcher);
62
68
QList<Url>
artistAddresses
(
const
QString& artist)
const
;
69
76
QList<Url>
albumAddresses
(
const
QString& artist,
const
QString& album)
const
;
77
83
QList<Url>
searchAddresses
(
const
QString& str)
const
;
84
85
QList<Url>
radioSearchAddresses(
const
QString& stationName,
const
QString& radioUrl)
const
;
86
92
QList<Url>
searchAddresses
(
const
QString& str,
93
const
QString& coverFetcherIdentifier)
const
;
94
101
CoverFetcherPtr
coverfetcher
(
const
Url
& url)
const
;
102
107
CoverFetcherList
coverfetchers
()
const
;
108
109
bool
isActive(
const
CoverFetcherPtr fetcher)
const
;
110
bool
isActive(
const
QString& identifier)
const
;
111
120
Url
directFetcherUrl
(
const
QString& url)
const
;
121
122
Url
websiteFetcherUrl(
const
QString& url)
const
;
123
124
static
bool
isSearchstringWebsite(
const
QString& searchstring);
125
126
private
slots:
127
void
serversChanged();
128
};
129
130
}
131
}
132
#endif
// COVERFETCHMANAGER_H
Cover::Fetcher::Base
The CoverFetcherInterface interface.
Definition
CoverFetcher.h:35
Cover::Fetcher::Manager
Retrieve Download Urls for Cover Searcher. CoverFetcherInterface can be registered,...
Definition
CoverFetchManager.h:50
Cover::Fetcher::Manager::coverfetcher
CoverFetcherPtr coverfetcher(const Url &url) const
get a CoverFetcherInterface by a specific url
Cover::Fetcher::Manager::artistAddresses
QList< Url > artistAddresses(const QString &artist) const
get urls for a artist search query
Cover::Fetcher::Manager::searchAddresses
QList< Url > searchAddresses(const QString &str, const QString &coverFetcherIdentifier) const
get urls for a fuzzy query
Cover::Fetcher::Manager::directFetcherUrl
Url directFetcherUrl(const QString &url) const
If the LibraryItem has a reference to a cover download url an appropriate Url object can be retrieved...
Cover::Fetcher::Manager::albumAddresses
QList< Url > albumAddresses(const QString &artist, const QString &album) const
get urls for a album search query
Cover::Fetcher::Manager::searchAddresses
QList< Url > searchAddresses(const QString &str) const
get urls for a fuzzy query
Cover::Fetcher::Manager::coverfetchers
CoverFetcherList coverfetchers() const
fetches all available cover fetcher
Cover::Fetcher::Manager::registerCoverFetcher
void registerCoverFetcher(CoverFetcherPtr fetcher)
Register a cover fetcher. Per default there is one for Discogs, last.fm and Google.
Cover::Fetcher::Url
An Url is defined by its identifier and a custom url string. The identifier is the same as being used...
Definition
CoverFetcherUrl.h:37
QList
Definition
EngineUtils.h:33
Generated on
for Sayonara Player by
1.17.0