Sayonara Player
Public Member Functions | Static Public Member Functions | Public Attributes | 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
 

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 getInvalidLocation ()
 returns an invalid location More...
 
static QString get_cover_directory ()
 returns the standard cover directory More...
 

Public Attributes

QString search_url
 search_url url where to fetch covers
 
QString cover_path
 cover_path path, in .Sayonara, where cover is stored. Ignored if local_paths are not empty
 
QStringList local_paths
 local_paths paths where images can be fetched from if they should not be fetched from the .Sayonara directory
 
bool valid
 valid if CoverLocation object contains a valid download url
 

Member Function Documentation

static QString CoverLocation::get_cover_directory ( )
static

returns the standard cover directory

Returns
usually ~/.Sayonara/covers
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
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
static CoverLocation CoverLocation::get_cover_location ( const Album album)
static
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
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
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
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
static CoverLocation CoverLocation::getInvalidLocation ( )
static

returns an invalid location

Returns
CoverLocation object