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 &cl)
 
CoverLocationoperator= (const CoverLocation &cl)
 
bool valid () const
 
QStringList local_paths () const
 
void add_local_path (const QString &path)
 
QString local_path (int idx) const
 
QString cover_path () const
 
QString identifer () const
 
QStringList search_urls () const
 
void remove_first_search_url ()
 
bool has_search_urls () const
 
QString search_term () const
 
void set_search_term (const QString &search_term)
 
QString to_string () const
 
QString preferred_path () 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 (const QString &artist)
 The slowest, but by far the most accurate function. Checks all local cover paths by all known tracks for the album. Fetches album from database and calls get_cover_location(const QString& album_name, const QStringList& artists) 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 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 (const QString &append_path)
 returns the standard cover directory More...
 

Member Function Documentation

static QString CoverLocation::get_cover_directory ( const QString &  append_path)
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 ( const QString &  artist)
static

The slowest, but by far the most accurate function. Checks all local cover paths by all known tracks for the album. 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 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::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
static CoverLocation CoverLocation::getInvalidLocation ( )
static

returns an invalid location

Returns
CoverLocation object
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