Sayonara Player
CoverLocation.h
1 /* CoverLocation.h */
2 
3 /* Copyright (C) 2011-2016 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 
22 
23 #ifndef COVERLOCATION_H
24 #define COVERLOCATION_H
25 
26 #include <QString>
27 #include <QStringList>
28 #include <QMetaType>
29 
30 class MetaData;
31 class Album;
32 class Artist;
38 {
39 
40 public:
41 
45  QString search_url;
46 
50  QString cover_path;
51 
55  QStringList local_paths;
56 
60  bool valid;
61 
62  CoverLocation();
64 
65  void print() const;
66  QString toString() const;
67 
74  static CoverLocation get_cover_location(const QString& album_name, const QString& artist_name);
75 
83  static CoverLocation get_cover_location(const QString& album_name, const QStringList& artists);
84 
85 
92  static CoverLocation get_cover_location(const Album& album);
93 
94 
102  static CoverLocation get_cover_location(int album_id, quint8 db_id);
103 
104 
110  static CoverLocation get_cover_location(const QString& artist);
111 
112 
119  static CoverLocation get_cover_location(const Artist& artist);
120 
121 
131  static CoverLocation get_cover_location(const MetaData& md);
132 
138 
139 
144  static QString get_cover_directory();
145 
146 };
147 
148 Q_DECLARE_METATYPE(CoverLocation)
149 #endif // COVERLOCATION_H
static CoverLocation getInvalidLocation()
returns an invalid location
QString search_url
search_url url where to fetch covers
Definition: CoverLocation.h:45
Definition: MetaData.h:49
QString cover_path
cover_path path, in .Sayonara, where cover is stored. Ignored if local_paths are not empty ...
Definition: CoverLocation.h:50
The CoverLocation class.
Definition: CoverLocation.h:37
bool valid
valid if CoverLocation object contains a valid download url
Definition: CoverLocation.h:60
static QString get_cover_directory()
returns the standard cover directory
The Album class.
Definition: Album.h:41
static CoverLocation get_cover_location(const QString &album_name, const QString &artist_name)
creates CoverLocation by taking the md5 sum between album_name and artist_name
The Artist class.
Definition: Artist.h:36
QStringList local_paths
local_paths paths where images can be fetched from if they should not be fetched from the ...
Definition: CoverLocation.h:55