MythTV  master
Public Types | Public Member Functions | Static Public Member Functions | Private Member Functions | Private Attributes | List of all members
VideoMetadata Class Reference

#include <libmythmetadata/videometadata.h>

Collaboration diagram for VideoMetadata:
[legend]

Public Types

using genre_entry = std::pair< int, QString >
 
using country_entry = std::pair< int, QString >
 
using cast_entry = std::pair< int, QString >
 
using genre_list = std::vector< genre_entry >
 
using country_list = std::vector< country_entry >
 
using cast_list = std::vector< cast_entry >
 

Public Member Functions

 VideoMetadata (const QString &filename=QString(), const QString &sortFilename=QString(), const QString &hash=QString(), const QString &trailer=QString(), const QString &coverfile=QString(), const QString &screenshot=QString(), const QString &banner=QString(), const QString &fanart=QString(), const QString &title=QString(), const QString &sortTitle=QString(), const QString &subtitle=QString(), const QString &sortSubtitle=QString(), const QString &tagline=QString(), int year=VIDEO_YEAR_DEFAULT, QDate releasedate=QDate(), const QString &inetref=QString(), int collectionref=0, const QString &homepage=QString(), const QString &director=QString(), const QString &studio=QString(), const QString &plot=QString(), float userrating=0.0, const QString &rating=QString(), int length=0, int playcount=0, int season=0, int episode=0, QDate insertdate=QDate(), int id=0, ParentalLevel::Level showlevel=ParentalLevel::plLowest, int categoryID=0, int childID=-1, bool browse=true, bool watched=false, const QString &playcommand=QString(), const QString &category=QString(), const genre_list &genres=genre_list(), const country_list &countries=country_list(), const cast_list &cast=cast_list(), const QString &host="", bool processed=false, VideoContentType contenttype=kContentUnknown)
 
 ~VideoMetadata ()
 
 VideoMetadata (MSqlQuery &query)
 
 VideoMetadata (const VideoMetadata &rhs)
 
VideoMetadataoperator= (const VideoMetadata &rhs)
 
bool sortBefore (const VideoMetadata &rhs) const
 
void toMap (InfoMap &metadataMap)
 
QString GetText (const QString &name) const
 
void GetStateMap (InfoMap &stateMap) const
 
QString GetState (const QString &name) const
 
void GetImageMap (InfoMap &imageMap)
 
QString GetImage (const QString &name) const
 
const QString & GetPrefix () const
 
void SetPrefix (const QString &prefix)
 
const QString & GetTitle () const
 
const QString & GetSortTitle () const
 
void SetTitle (const QString &title, const QString &sortTitle="")
 
const QString & GetSubtitle () const
 
const QString & GetSortSubtitle () const
 
void SetSubtitle (const QString &subtitle, const QString &sortSubtitle="")
 
const QString & GetTagline () const
 
void SetTagline (const QString &tagline)
 
int GetYear () const
 
void SetYear (int year)
 
QDate GetReleaseDate () const
 
void SetReleaseDate (QDate releasedate)
 
const QString & GetInetRef () const
 
void SetInetRef (const QString &inetRef)
 
int GetCollectionRef () const
 
void SetCollectionRef (int collectionref)
 
const QString & GetHomepage () const
 
void SetHomepage (const QString &homepage)
 
const QString & GetDirector () const
 
void SetDirector (const QString &director)
 
const QString & GetStudio () const
 
void SetStudio (const QString &studio)
 
const QString & GetPlot () const
 
void SetPlot (const QString &plot)
 
float GetUserRating () const
 
void SetUserRating (float userRating)
 
const QString & GetRating () const
 
void SetRating (const QString &rating)
 
std::chrono::minutes GetLength () const
 
void SetLength (std::chrono::minutes length)
 
int GetSeason () const
 
void SetSeason (int season)
 
int GetEpisode () const
 
void SetEpisode (int episode)
 
QDate GetInsertdate () const
 
void SetInsertdate (QDate date)
 
unsigned int GetID () const
 
void SetID (int id)
 
int GetChildID () const
 
void SetChildID (int childID)
 
bool GetBrowse () const
 
void SetBrowse (bool browse)
 
bool GetWatched () const
 
void SetWatched (bool watched)
 
bool GetProcessed () const
 
void SetProcessed (bool processed)
 
VideoContentType GetContentType () const
 
void SetContentType (VideoContentType contenttype)
 
const QString & GetPlayCommand () const
 
void SetPlayCommand (const QString &playCommand)
 
unsigned int GetPlayCount () const
 
void SetPlayCount (int count)
 
ParentalLevel::Level GetShowLevel () const
 
void SetShowLevel (ParentalLevel::Level showLevel)
 
const QString & GetHost () const
 
void SetHost (const QString &host)
 
const QString & GetFilename () const
 
const QString & GetSortFilename () const
 
void SetFilename (const QString &filename, const QString &sortFilename="")
 
const QString & GetHash () const
 
void SetHash (const QString &hash)
 
const QString & GetTrailer () const
 
void SetTrailer (const QString &trailer)
 
const QString & GetCoverFile () const
 
void SetCoverFile (const QString &coverFile)
 
const QString & GetScreenshot () const
 
void SetScreenshot (const QString &screenshot)
 
const QString & GetBanner () const
 
void SetBanner (const QString &banner)
 
const QString & GetFanart () const
 
void SetFanart (const QString &fanart)
 
const QString & GetCategory () const
 
const genre_listGetGenres () const
 
void SetGenres (const genre_list &genres)
 
const cast_listGetCast () const
 
void SetCast (const cast_list &cast)
 
const country_listGetCountries () const
 
void SetCountries (const country_list &countries)
 
int GetCategoryID () const
 
void SetCategoryID (int id)
 
void SaveToDatabase ()
 
void UpdateDatabase ()
 
bool DeleteFromDatabase ()
 
bool FillDataFromFilename (const VideoMetadataListManager &cache)
 
bool DeleteFile ()
 
void Reset ()
 Resets to default metadata. More...
 
bool IsHostSet () const
 

Static Public Member Functions

static int UpdateHashedDBRecord (const QString &hash, const QString &file_name, const QString &host)
 
static QString VideoFileHash (const QString &file_name, const QString &host)
 
static QString FilenameToMeta (const QString &file_name, int position)
 
static QString TrimTitle (const QString &title, bool ignore_case)
 
static QString MetadataGetTextCb (const QString &name, void *data)
 
static QString MetadataGetImageCb (const QString &name, void *data)
 
static QString MetadataGetStateCb (const QString &name, void *data)
 

Private Member Functions

 Q_DECLARE_TR_FUNCTIONS (VideoMetadata)
 

Private Attributes

class VideoMetadataImpm_imp
 

Detailed Description

Definition at line 24 of file videometadata.h.

Member Typedef Documentation

◆ genre_entry

using VideoMetadata::genre_entry = std::pair<int, QString>

Definition at line 29 of file videometadata.h.

◆ country_entry

using VideoMetadata::country_entry = std::pair<int, QString>

Definition at line 30 of file videometadata.h.

◆ cast_entry

using VideoMetadata::cast_entry = std::pair<int, QString>

Definition at line 31 of file videometadata.h.

◆ genre_list

using VideoMetadata::genre_list = std::vector<genre_entry>

Definition at line 32 of file videometadata.h.

◆ country_list

Definition at line 33 of file videometadata.h.

◆ cast_list

using VideoMetadata::cast_list = std::vector<cast_entry>

Definition at line 34 of file videometadata.h.

Constructor & Destructor Documentation

◆ VideoMetadata() [1/3]

VideoMetadata::VideoMetadata ( const QString &  filename = QString(),
const QString &  sortFilename = QString(),
const QString &  hash = QString(),
const QString &  trailer = QString(),
const QString &  coverfile = QString(),
const QString &  screenshot = QString(),
const QString &  banner = QString(),
const QString &  fanart = QString(),
const QString &  title = QString(),
const QString &  sortTitle = QString(),
const QString &  subtitle = QString(),
const QString &  sortSubtitle = QString(),
const QString &  tagline = QString(),
int  year = VIDEO_YEAR_DEFAULT,
QDate  releasedate = QDate(),
const QString &  inetref = QString(),
int  collectionref = 0,
const QString &  homepage = QString(),
const QString &  director = QString(),
const QString &  studio = QString(),
const QString &  plot = QString(),
float  userrating = 0.0,
const QString &  rating = QString(),
int  length = 0,
int  playcount = 0,
int  season = 0,
int  episode = 0,
QDate  insertdate = QDate(),
int  id = 0,
ParentalLevel::Level  showlevel = ParentalLevel::plLowest,
int  categoryID = 0,
int  childID = -1,
bool  browse = true,
bool  watched = false,
const QString &  playcommand = QString(),
const QString &  category = QString(),
const genre_list genres = genre_list(),
const country_list countries = country_list(),
const cast_list cast = cast_list(),
const QString &  host = "",
bool  processed = false,
VideoContentType  contenttype = kContentUnknown 
)
explicit

Definition at line 1226 of file videometadata.cpp.

◆ ~VideoMetadata()

VideoMetadata::~VideoMetadata ( )

Definition at line 1253 of file videometadata.cpp.

◆ VideoMetadata() [2/3]

VideoMetadata::VideoMetadata ( MSqlQuery query)
explicit

Definition at line 1258 of file videometadata.cpp.

◆ VideoMetadata() [3/3]

VideoMetadata::VideoMetadata ( const VideoMetadata rhs)

Definition at line 1263 of file videometadata.cpp.

Member Function Documentation

◆ Q_DECLARE_TR_FUNCTIONS()

VideoMetadata::Q_DECLARE_TR_FUNCTIONS ( VideoMetadata  )
private

◆ UpdateHashedDBRecord()

int VideoMetadata::UpdateHashedDBRecord ( const QString &  hash,
const QString &  file_name,
const QString &  host 
)
static

Definition at line 1070 of file videometadata.cpp.

Referenced by VideoScannerThread::updateDB().

◆ VideoFileHash()

QString VideoMetadata::VideoFileHash ( const QString &  file_name,
const QString &  host 
)
static

◆ FilenameToMeta()

QString VideoMetadata::FilenameToMeta ( const QString &  file_name,
int  position 
)
static

◆ TrimTitle()

static QString VideoMetadata::TrimTitle ( const QString &  title,
bool  ignore_case 
)
static

◆ operator=()

VideoMetadata & VideoMetadata::operator= ( const VideoMetadata rhs)

Definition at line 1268 of file videometadata.cpp.

◆ sortBefore()

bool VideoMetadata::sortBefore ( const VideoMetadata rhs) const

Definition at line 2012 of file videometadata.cpp.

Referenced by VideoFilterSettings::meta_less_than().

◆ toMap()

void VideoMetadata::toMap ( InfoMap metadataMap)

◆ GetText()

QString VideoMetadata::GetText ( const QString &  name) const

Definition at line 1340 of file videometadata.cpp.

Referenced by MetadataGetTextCb().

◆ GetStateMap()

void VideoMetadata::GetStateMap ( InfoMap stateMap) const

Definition at line 1426 of file videometadata.cpp.

Referenced by toMap().

◆ GetState()

QString VideoMetadata::GetState ( const QString &  name) const

Definition at line 1437 of file videometadata.cpp.

Referenced by MetadataGetStateCb().

◆ GetImageMap()

void VideoMetadata::GetImageMap ( InfoMap imageMap)

Definition at line 1450 of file videometadata.cpp.

Referenced by AddFileNode(), and toMap().

◆ GetImage()

QString VideoMetadata::GetImage ( const QString &  name) const

Definition at line 1455 of file videometadata.cpp.

Referenced by MetadataGetImageCb().

◆ MetadataGetTextCb()

QString VideoMetadata::MetadataGetTextCb ( const QString &  name,
void *  data 
)
static

Definition at line 1504 of file videometadata.cpp.

Referenced by AddFileNode().

◆ MetadataGetImageCb()

QString VideoMetadata::MetadataGetImageCb ( const QString &  name,
void *  data 
)
static

Definition at line 1518 of file videometadata.cpp.

Referenced by AddFileNode().

◆ MetadataGetStateCb()

QString VideoMetadata::MetadataGetStateCb ( const QString &  name,
void *  data 
)
static

Definition at line 1526 of file videometadata.cpp.

Referenced by AddFileNode().

◆ GetPrefix()

const QString & VideoMetadata::GetPrefix ( ) const

Definition at line 1534 of file videometadata.cpp.

Referenced by AddMetadataToDir().

◆ SetPrefix()

void VideoMetadata::SetPrefix ( const QString &  prefix)

Definition at line 1539 of file videometadata.cpp.

◆ GetTitle()

const QString & VideoMetadata::GetTitle ( ) const

◆ GetSortTitle()

const QString & VideoMetadata::GetSortTitle ( ) const

Definition at line 1549 of file videometadata.cpp.

Referenced by GetText(), and toMap().

◆ SetTitle()

void VideoMetadata::SetTitle ( const QString &  title,
const QString &  sortTitle = "" 
)

◆ GetSubtitle()

const QString & VideoMetadata::GetSubtitle ( ) const

◆ GetSortSubtitle()

const QString & VideoMetadata::GetSortSubtitle ( ) const

Definition at line 1564 of file videometadata.cpp.

Referenced by GetText(), and toMap().

◆ SetSubtitle()

void VideoMetadata::SetSubtitle ( const QString &  subtitle,
const QString &  sortSubtitle = "" 
)

Definition at line 1569 of file videometadata.cpp.

Referenced by EditMetadataDialog::SetSubtitle().

◆ GetTagline()

const QString & VideoMetadata::GetTagline ( ) const

Definition at line 1574 of file videometadata.cpp.

Referenced by EditMetadataDialog::fillWidgets(), GetText(), and toMap().

◆ SetTagline()

void VideoMetadata::SetTagline ( const QString &  tagline)

Definition at line 1579 of file videometadata.cpp.

Referenced by EditMetadataDialog::SetTagline().

◆ GetYear()

int VideoMetadata::GetYear ( ) const

◆ SetYear()

void VideoMetadata::SetYear ( int  year)

Definition at line 1589 of file videometadata.cpp.

Referenced by EditMetadataDialog::SetYear().

◆ GetReleaseDate()

QDate VideoMetadata::GetReleaseDate ( ) const

Definition at line 1594 of file videometadata.cpp.

Referenced by GetText(), and toMap().

◆ SetReleaseDate()

void VideoMetadata::SetReleaseDate ( QDate  releasedate)

Definition at line 1599 of file videometadata.cpp.

◆ GetInetRef()

const QString & VideoMetadata::GetInetRef ( ) const

◆ SetInetRef()

void VideoMetadata::SetInetRef ( const QString &  inetRef)

Definition at line 1609 of file videometadata.cpp.

Referenced by EditMetadataDialog::SetInetRef().

◆ GetCollectionRef()

int VideoMetadata::GetCollectionRef ( ) const

Definition at line 1614 of file videometadata.cpp.

◆ SetCollectionRef()

void VideoMetadata::SetCollectionRef ( int  collectionref)

Definition at line 1619 of file videometadata.cpp.

◆ GetHomepage()

const QString & VideoMetadata::GetHomepage ( ) const

◆ SetHomepage()

void VideoMetadata::SetHomepage ( const QString &  homepage)

Definition at line 1629 of file videometadata.cpp.

Referenced by EditMetadataDialog::SetHomepage().

◆ GetDirector()

const QString & VideoMetadata::GetDirector ( ) const

◆ SetDirector()

void VideoMetadata::SetDirector ( const QString &  director)

Definition at line 1639 of file videometadata.cpp.

Referenced by EditMetadataDialog::SetDirector().

◆ GetStudio()

const QString & VideoMetadata::GetStudio ( ) const

◆ SetStudio()

void VideoMetadata::SetStudio ( const QString &  studio)

Definition at line 1649 of file videometadata.cpp.

◆ GetPlot()

const QString & VideoMetadata::GetPlot ( ) const

◆ SetPlot()

void VideoMetadata::SetPlot ( const QString &  plot)

Definition at line 1659 of file videometadata.cpp.

Referenced by EditMetadataDialog::SetPlot().

◆ GetUserRating()

float VideoMetadata::GetUserRating ( ) const

◆ SetUserRating()

void VideoMetadata::SetUserRating ( float  userRating)

Definition at line 1669 of file videometadata.cpp.

Referenced by EditMetadataDialog::SetUserRating().

◆ GetRating()

const QString & VideoMetadata::GetRating ( ) const

◆ SetRating()

void VideoMetadata::SetRating ( const QString &  rating)

Definition at line 1679 of file videometadata.cpp.

Referenced by EditMetadataDialog::SetRating().

◆ GetLength()

std::chrono::minutes VideoMetadata::GetLength ( ) const

◆ SetLength()

void VideoMetadata::SetLength ( std::chrono::minutes  length)

Definition at line 1689 of file videometadata.cpp.

Referenced by EditMetadataDialog::SetLength().

◆ GetSeason()

int VideoMetadata::GetSeason ( ) const

◆ SetSeason()

void VideoMetadata::SetSeason ( int  season)

Definition at line 1709 of file videometadata.cpp.

Referenced by EditMetadataDialog::SetSeason().

◆ GetEpisode()

int VideoMetadata::GetEpisode ( ) const

◆ SetEpisode()

void VideoMetadata::SetEpisode ( int  episode)

Definition at line 1719 of file videometadata.cpp.

Referenced by EditMetadataDialog::SetEpisode().

◆ GetInsertdate()

QDate VideoMetadata::GetInsertdate ( ) const

◆ SetInsertdate()

void VideoMetadata::SetInsertdate ( QDate  date)

Definition at line 1729 of file videometadata.cpp.

◆ GetID()

unsigned int VideoMetadata::GetID ( ) const

◆ SetID()

void VideoMetadata::SetID ( int  id)

Definition at line 1739 of file videometadata.cpp.

◆ GetChildID()

int VideoMetadata::GetChildID ( ) const

Definition at line 1744 of file videometadata.cpp.

Referenced by EditMetadataDialog::fillWidgets(), GetText(), and toMap().

◆ SetChildID()

void VideoMetadata::SetChildID ( int  childID)

Definition at line 1749 of file videometadata.cpp.

Referenced by EditMetadataDialog::SetChild().

◆ GetBrowse()

bool VideoMetadata::GetBrowse ( ) const

◆ SetBrowse()

void VideoMetadata::SetBrowse ( bool  browse)

Definition at line 1759 of file videometadata.cpp.

◆ GetWatched()

bool VideoMetadata::GetWatched ( ) const

◆ SetWatched()

void VideoMetadata::SetWatched ( bool  watched)

◆ GetProcessed()

bool VideoMetadata::GetProcessed ( ) const

◆ SetProcessed()

void VideoMetadata::SetProcessed ( bool  processed)

◆ GetContentType()

VideoContentType VideoMetadata::GetContentType ( ) const

Definition at line 1784 of file videometadata.cpp.

◆ SetContentType()

void VideoMetadata::SetContentType ( VideoContentType  contenttype)

Definition at line 1789 of file videometadata.cpp.

◆ GetPlayCommand()

const QString & VideoMetadata::GetPlayCommand ( ) const

◆ SetPlayCommand()

void VideoMetadata::SetPlayCommand ( const QString &  playCommand)

Definition at line 1799 of file videometadata.cpp.

Referenced by EditMetadataDialog::SetPlayer().

◆ GetPlayCount()

unsigned int VideoMetadata::GetPlayCount ( ) const

Definition at line 1694 of file videometadata.cpp.

Referenced by GetText(), and toMap().

◆ SetPlayCount()

void VideoMetadata::SetPlayCount ( int  count)

Definition at line 1699 of file videometadata.cpp.

◆ GetShowLevel()

ParentalLevel::Level VideoMetadata::GetShowLevel ( ) const

◆ SetShowLevel()

void VideoMetadata::SetShowLevel ( ParentalLevel::Level  showLevel)

◆ GetHost()

const QString & VideoMetadata::GetHost ( ) const

◆ SetHost()

void VideoMetadata::SetHost ( const QString &  host)

◆ GetFilename()

const QString & VideoMetadata::GetFilename ( ) const

◆ GetSortFilename()

const QString & VideoMetadata::GetSortFilename ( ) const

◆ SetFilename()

void VideoMetadata::SetFilename ( const QString &  filename,
const QString &  sortFilename = "" 
)

Definition at line 1844 of file videometadata.cpp.

◆ GetHash()

const QString & VideoMetadata::GetHash ( ) const

◆ SetHash()

void VideoMetadata::SetHash ( const QString &  hash)

Definition at line 1829 of file videometadata.cpp.

◆ GetTrailer()

const QString & VideoMetadata::GetTrailer ( ) const

◆ SetTrailer()

void VideoMetadata::SetTrailer ( const QString &  trailer)

Definition at line 1854 of file videometadata.cpp.

Referenced by EditMetadataDialog::SetTrailer().

◆ GetCoverFile()

const QString & VideoMetadata::GetCoverFile ( ) const

◆ SetCoverFile()

void VideoMetadata::SetCoverFile ( const QString &  coverFile)

◆ GetScreenshot()

const QString & VideoMetadata::GetScreenshot ( ) const

◆ SetScreenshot()

void VideoMetadata::SetScreenshot ( const QString &  screenshot)

◆ GetBanner()

const QString & VideoMetadata::GetBanner ( ) const

◆ SetBanner()

void VideoMetadata::SetBanner ( const QString &  banner)

◆ GetFanart()

const QString & VideoMetadata::GetFanart ( ) const

◆ SetFanart()

void VideoMetadata::SetFanart ( const QString &  fanart)

◆ GetCategory()

const QString & VideoMetadata::GetCategory ( ) const

Definition at line 1899 of file videometadata.cpp.

Referenced by GetText(), and toMap().

◆ GetGenres()

const VideoMetadata::genre_list & VideoMetadata::GetGenres ( ) const

Definition at line 1909 of file videometadata.cpp.

Referenced by GetDisplayGenres(), and VideoFilterSettings::matches_filter().

◆ SetGenres()

void VideoMetadata::SetGenres ( const genre_list genres)

Definition at line 1914 of file videometadata.cpp.

◆ GetCast()

const VideoMetadata::cast_list & VideoMetadata::GetCast ( ) const

◆ SetCast()

void VideoMetadata::SetCast ( const cast_list cast)

Definition at line 1924 of file videometadata.cpp.

◆ GetCountries()

const VideoMetadata::country_list & VideoMetadata::GetCountries ( ) const

Definition at line 1929 of file videometadata.cpp.

Referenced by GetDisplayCountries(), and VideoFilterSettings::matches_filter().

◆ SetCountries()

void VideoMetadata::SetCountries ( const country_list countries)

Definition at line 1934 of file videometadata.cpp.

◆ GetCategoryID()

int VideoMetadata::GetCategoryID ( ) const

◆ SetCategoryID()

void VideoMetadata::SetCategoryID ( int  id)

◆ SaveToDatabase()

void VideoMetadata::SaveToDatabase ( )

◆ UpdateDatabase()

void VideoMetadata::UpdateDatabase ( )

◆ DeleteFromDatabase()

bool VideoMetadata::DeleteFromDatabase ( )

Definition at line 1959 of file videometadata.cpp.

◆ FillDataFromFilename()

bool VideoMetadata::FillDataFromFilename ( const VideoMetadataListManager cache)

Definition at line 1981 of file videometadata.cpp.

◆ DeleteFile()

bool VideoMetadata::DeleteFile ( )

Definition at line 1997 of file videometadata.cpp.

◆ Reset()

void VideoMetadata::Reset ( )

Resets to default metadata.

Definition at line 2002 of file videometadata.cpp.

Referenced by VideoDialog::ResetMetadata().

◆ IsHostSet()

bool VideoMetadata::IsHostSet ( ) const

Member Data Documentation

◆ m_imp

class VideoMetadataImp* VideoMetadata::m_imp
private

The documentation for this class was generated from the following files: