Sayonara Player
Public Member Functions | Static Public Member Functions | List of all members
CoverLocation Class Reference

#include <CoverLocation.h>

Detailed Description

The CoverLocation class.

Public Member Functions

 CoverLocation (const CoverLocation &)
 
void print () const
 
QString toString () const
 
bool valid () const
 
QStringList local_paths () const
 
QString local_path (int idx) const
 
QString cover_path () const
 
QString search_url () const
 
QString search_term () const
 
void set_search_term (const QString &search_term)
 

Static Public Member Functions

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 More...
 
static CoverLocation get_cover_location (const QString &album_name, const QStringList &artists)
 overloaded. Picks major artist out of artists and calls get_cover_location(const QString& album_name, const QString& artist_name) More...
 
static CoverLocation get_cover_location (const Album &album)
 overloaded. Calls get_cover_location(const QString& album_name, const QStringList& artists) More...
 
static CoverLocation get_cover_location (int album_id, quint8 db_id)
 overloaded. Fetches album from database and calls get_cover_location(const QString& album_name, const QStringList& artists) More...
 
static CoverLocation get_cover_location (const QString &artist)
 Creates cover token of the form artist_<md5sum of artist> More...
 
static CoverLocation get_cover_location (const Artist &artist)
 overloaded. extracts artist name and calls get_cover_location(const QString& artist) More...
 
static CoverLocation get_cover_location (const MetaData &md)
 overloaded. if MetaData::album_id < 0 calls get_cover_location(const QString& album_name, const QString& artist_name) else extract Album from database and calls get_cover_location(const Album& album) More...
 
static CoverLocation get_cover_location (const QUrl &url, const QString &target_path)
 fetch a cover from a specific url More...
 
static CoverLocation get_cover_location_by_searchstring (const QString &search_string, const QString &target_path)
 fetch a cover for a specific search string More...
 
static CoverLocation getInvalidLocation ()
 returns an invalid location More...
 
static bool isInvalidLocation (const QString &cover_path)
 returns if path is the same as the invalid location path More...
 
static QString get_cover_directory ()
 returns the standard cover directory More...
 

Member Function Documentation

§ get_cover_directory()

static QString CoverLocation::get_cover_directory ( )
static

returns the standard cover directory

Returns
usually ~/.Sayonara/covers

§ get_cover_location() [1/8]

static CoverLocation CoverLocation::get_cover_location ( const QString &  album_name,
const QString &  artist_name 
)
static

creates CoverLocation by taking the md5 sum between album_name and artist_name

Parameters
album_nameAlbum name
artist_nameArtist name
Returns
CoverLocation object

§ get_cover_location() [2/8]

static CoverLocation CoverLocation::get_cover_location ( const QString &  album_name,
const QStringList &  artists 
)
static

overloaded. Picks major artist out of artists and calls get_cover_location(const QString& album_name, const QString& artist_name)

Parameters
album_nameAlbum name
artistsList of artists
Returns
CoverLocation object

§ get_cover_location() [3/8]

static CoverLocation CoverLocation::get_cover_location ( const Album album)
static

§ get_cover_location() [4/8]

static CoverLocation CoverLocation::get_cover_location ( int  album_id,
quint8  db_id 
)
static

overloaded. Fetches album from database and calls get_cover_location(const QString& album_name, const QStringList& artists)

Parameters
album_idAlbum ID
db_idDatabase ID for album
Returns
CoverLocation object

§ get_cover_location() [5/8]

static CoverLocation CoverLocation::get_cover_location ( const QString &  artist)
static

Creates cover token of the form artist_<md5sum of artist>

Parameters
artistArtist name
Returns
CoverLocation object

§ get_cover_location() [6/8]

static CoverLocation CoverLocation::get_cover_location ( const Artist artist)
static

overloaded. extracts artist name and calls get_cover_location(const QString& artist)

Parameters
artistArtist object
Returns
CoverLocation object

§ get_cover_location() [7/8]

static CoverLocation CoverLocation::get_cover_location ( const MetaData md)
static

overloaded. if MetaData::album_id < 0 calls get_cover_location(const QString& album_name, const QString& artist_name) else extract Album from database and calls get_cover_location(const Album& album)

Parameters
Metadataobject
Returns
CoverLocation object

§ get_cover_location() [8/8]

static CoverLocation CoverLocation::get_cover_location ( const QUrl &  url,
const QString &  target_path 
)
static

fetch a cover from a specific url

Parameters
urlurl, the cover has to be fetched from
target_pathpath where the found image has to be saved
Returns
CoverLocation object

§ get_cover_location_by_searchstring()

static CoverLocation CoverLocation::get_cover_location_by_searchstring ( const QString &  search_string,
const QString &  target_path 
)
static

fetch a cover for a specific search string

Parameters
search_stringthe string where the cover has to be fetched for
target_pathpath where the found image has to be saved
Returns
CoverLocation object

§ getInvalidLocation()

static CoverLocation CoverLocation::getInvalidLocation ( )
static

returns an invalid location

Returns
CoverLocation object

§ isInvalidLocation()

static bool CoverLocation::isInvalidLocation ( const QString &  cover_path)
static

returns if path is the same as the invalid location path

Parameters
cover_paththe path to be compared
Returns