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

#include <videometadata.h>

Collaboration diagram for VideoMetadata:
Collaboration graph
[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, const 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, const 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)
 
void GetStateMap (InfoMap &stateMap)
 
void GetImageMap (InfoMap &imageMap)
 
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)
 
int GetLength () const
 
void SetLength (int 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)
 

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,
const 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,
const 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 
)

Definition at line 1163 of file videometadata.cpp.

◆ ~VideoMetadata()

VideoMetadata::~VideoMetadata ( )

Definition at line 1190 of file videometadata.cpp.

◆ VideoMetadata() [2/3]

VideoMetadata::VideoMetadata ( MSqlQuery query)
explicit

Definition at line 1195 of file videometadata.cpp.

◆ VideoMetadata() [3/3]

VideoMetadata::VideoMetadata ( const VideoMetadata rhs)

Definition at line 1200 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 1008 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 1205 of file videometadata.cpp.

◆ sortBefore()

bool VideoMetadata::sortBefore ( const VideoMetadata rhs) const

Definition at line 1810 of file videometadata.cpp.

Referenced by VideoFilterSettings::meta_less_than().

◆ toMap()

void VideoMetadata::toMap ( InfoMap metadataMap)

◆ GetStateMap()

void VideoMetadata::GetStateMap ( InfoMap stateMap)

Definition at line 1274 of file videometadata.cpp.

Referenced by AddFileNode(), and toMap().

◆ GetImageMap()

void VideoMetadata::GetImageMap ( InfoMap imageMap)

Definition at line 1283 of file videometadata.cpp.

Referenced by AddFileNode(), and toMap().

◆ GetPrefix()

const QString & VideoMetadata::GetPrefix ( ) const

Definition at line 1332 of file videometadata.cpp.

Referenced by AddMetadataToDir().

◆ SetPrefix()

void VideoMetadata::SetPrefix ( const QString &  prefix)

Definition at line 1337 of file videometadata.cpp.

◆ GetTitle()

const QString & VideoMetadata::GetTitle ( void  ) const

◆ GetSortTitle()

const QString & VideoMetadata::GetSortTitle ( void  ) const

Definition at line 1347 of file videometadata.cpp.

Referenced by toMap().

◆ SetTitle()

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

◆ GetSubtitle()

const QString & VideoMetadata::GetSubtitle ( void  ) const

◆ GetSortSubtitle()

const QString & VideoMetadata::GetSortSubtitle ( void  ) const

Definition at line 1362 of file videometadata.cpp.

Referenced by toMap().

◆ SetSubtitle()

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

Definition at line 1367 of file videometadata.cpp.

Referenced by EditMetadataDialog::SetSubtitle().

◆ GetTagline()

const QString & VideoMetadata::GetTagline ( ) const

Definition at line 1372 of file videometadata.cpp.

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

◆ SetTagline()

void VideoMetadata::SetTagline ( const QString &  tagline)

Definition at line 1377 of file videometadata.cpp.

Referenced by EditMetadataDialog::SetTagline().

◆ GetYear()

int VideoMetadata::GetYear ( ) const

◆ SetYear()

void VideoMetadata::SetYear ( int  year)

Definition at line 1387 of file videometadata.cpp.

Referenced by EditMetadataDialog::SetYear().

◆ GetReleaseDate()

QDate VideoMetadata::GetReleaseDate ( ) const

Definition at line 1392 of file videometadata.cpp.

Referenced by toMap().

◆ SetReleaseDate()

void VideoMetadata::SetReleaseDate ( QDate  releasedate)

Definition at line 1397 of file videometadata.cpp.

◆ GetInetRef()

const QString & VideoMetadata::GetInetRef ( void  ) const

◆ SetInetRef()

void VideoMetadata::SetInetRef ( const QString &  inetRef)

Definition at line 1407 of file videometadata.cpp.

Referenced by EditMetadataDialog::SetInetRef().

◆ GetCollectionRef()

int VideoMetadata::GetCollectionRef ( ) const

Definition at line 1412 of file videometadata.cpp.

◆ SetCollectionRef()

void VideoMetadata::SetCollectionRef ( int  collectionref)

Definition at line 1417 of file videometadata.cpp.

◆ GetHomepage()

const QString & VideoMetadata::GetHomepage ( ) const

◆ SetHomepage()

void VideoMetadata::SetHomepage ( const QString &  homepage)

Definition at line 1427 of file videometadata.cpp.

Referenced by EditMetadataDialog::SetHomepage().

◆ GetDirector()

const QString & VideoMetadata::GetDirector ( ) const

◆ SetDirector()

void VideoMetadata::SetDirector ( const QString &  director)

Definition at line 1437 of file videometadata.cpp.

Referenced by EditMetadataDialog::SetDirector().

◆ GetStudio()

const QString & VideoMetadata::GetStudio ( ) const

Definition at line 1442 of file videometadata.cpp.

Referenced by VideoListImp::buildGroupList(), and toMap().

◆ SetStudio()

void VideoMetadata::SetStudio ( const QString &  studio)

Definition at line 1447 of file videometadata.cpp.

◆ GetPlot()

const QString & VideoMetadata::GetPlot ( ) const

◆ SetPlot()

void VideoMetadata::SetPlot ( const QString &  plot)

Definition at line 1457 of file videometadata.cpp.

Referenced by EditMetadataDialog::SetPlot().

◆ GetUserRating()

float VideoMetadata::GetUserRating ( ) const

◆ SetUserRating()

void VideoMetadata::SetUserRating ( float  userRating)

Definition at line 1467 of file videometadata.cpp.

Referenced by EditMetadataDialog::SetUserRating().

◆ GetRating()

const QString & VideoMetadata::GetRating ( ) const

◆ SetRating()

void VideoMetadata::SetRating ( const QString &  rating)

Definition at line 1477 of file videometadata.cpp.

Referenced by EditMetadataDialog::SetRating().

◆ GetLength()

int VideoMetadata::GetLength ( ) const

◆ SetLength()

void VideoMetadata::SetLength ( int  length)

Definition at line 1487 of file videometadata.cpp.

Referenced by EditMetadataDialog::SetLength().

◆ GetSeason()

int VideoMetadata::GetSeason ( void  ) const

◆ SetSeason()

void VideoMetadata::SetSeason ( int  season)

Definition at line 1507 of file videometadata.cpp.

Referenced by EditMetadataDialog::SetSeason().

◆ GetEpisode()

int VideoMetadata::GetEpisode ( void  ) const

◆ SetEpisode()

void VideoMetadata::SetEpisode ( int  episode)

Definition at line 1517 of file videometadata.cpp.

Referenced by EditMetadataDialog::SetEpisode().

◆ GetInsertdate()

QDate VideoMetadata::GetInsertdate ( ) const

◆ SetInsertdate()

void VideoMetadata::SetInsertdate ( QDate  date)

Definition at line 1527 of file videometadata.cpp.

◆ GetID()

unsigned int VideoMetadata::GetID ( ) const

◆ SetID()

void VideoMetadata::SetID ( int  id)

Definition at line 1537 of file videometadata.cpp.

◆ GetChildID()

int VideoMetadata::GetChildID ( ) const

Definition at line 1542 of file videometadata.cpp.

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

◆ SetChildID()

void VideoMetadata::SetChildID ( int  childID)

Definition at line 1547 of file videometadata.cpp.

Referenced by EditMetadataDialog::SetChild().

◆ GetBrowse()

bool VideoMetadata::GetBrowse ( ) const

◆ SetBrowse()

void VideoMetadata::SetBrowse ( bool  browse)

Definition at line 1557 of file videometadata.cpp.

◆ GetWatched()

bool VideoMetadata::GetWatched ( ) const

◆ SetWatched()

void VideoMetadata::SetWatched ( bool  watched)

Definition at line 1567 of file videometadata.cpp.

Referenced by VideoDialog::ToggleWatched().

◆ GetProcessed()

bool VideoMetadata::GetProcessed ( ) const

◆ SetProcessed()

void VideoMetadata::SetProcessed ( bool  processed)

◆ GetContentType()

VideoContentType VideoMetadata::GetContentType ( ) const

Definition at line 1582 of file videometadata.cpp.

◆ SetContentType()

void VideoMetadata::SetContentType ( VideoContentType  contenttype)

Definition at line 1587 of file videometadata.cpp.

◆ GetPlayCommand()

const QString & VideoMetadata::GetPlayCommand ( ) const

◆ SetPlayCommand()

void VideoMetadata::SetPlayCommand ( const QString &  playCommand)

Definition at line 1597 of file videometadata.cpp.

Referenced by EditMetadataDialog::SetPlayer().

◆ GetPlayCount()

unsigned int VideoMetadata::GetPlayCount ( ) const

Definition at line 1492 of file videometadata.cpp.

Referenced by toMap().

◆ SetPlayCount()

void VideoMetadata::SetPlayCount ( int  count)

Definition at line 1497 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)

Definition at line 1637 of file videometadata.cpp.

Referenced by Video::AddVideo(), and VideoScannerThread::updateDB().

◆ 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 1642 of file videometadata.cpp.

◆ GetHash()

const QString & VideoMetadata::GetHash ( ) const

◆ SetHash()

void VideoMetadata::SetHash ( const QString &  hash)

Definition at line 1627 of file videometadata.cpp.

◆ GetTrailer()

const QString & VideoMetadata::GetTrailer ( ) const

◆ SetTrailer()

void VideoMetadata::SetTrailer ( const QString &  trailer)

Definition at line 1652 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 ( void  ) const

Definition at line 1697 of file videometadata.cpp.

Referenced by VideoListImp::buildGroupList(), and toMap().

◆ GetGenres()

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

◆ SetGenres()

void VideoMetadata::SetGenres ( const genre_list genres)

Definition at line 1712 of file videometadata.cpp.

◆ GetCast()

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

◆ SetCast()

void VideoMetadata::SetCast ( const cast_list cast)

Definition at line 1722 of file videometadata.cpp.

◆ GetCountries()

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

Definition at line 1727 of file videometadata.cpp.

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

◆ SetCountries()

void VideoMetadata::SetCountries ( const country_list countries)

Definition at line 1732 of file videometadata.cpp.

◆ GetCategoryID()

int VideoMetadata::GetCategoryID ( ) const

◆ SetCategoryID()

void VideoMetadata::SetCategoryID ( int  id)

◆ SaveToDatabase()

void VideoMetadata::SaveToDatabase ( )

Definition at line 1747 of file videometadata.cpp.

Referenced by Video::AddVideo(), and VideoScannerThread::updateDB().

◆ UpdateDatabase()

void VideoMetadata::UpdateDatabase ( )

◆ DeleteFromDatabase()

bool VideoMetadata::DeleteFromDatabase ( )

Definition at line 1757 of file videometadata.cpp.

◆ FillDataFromFilename()

bool VideoMetadata::FillDataFromFilename ( const VideoMetadataListManager cache)

Definition at line 1779 of file videometadata.cpp.

◆ DeleteFile()

bool VideoMetadata::DeleteFile ( )

Definition at line 1795 of file videometadata.cpp.

◆ Reset()

void VideoMetadata::Reset ( void  )

Resets to default metadata.

Definition at line 1800 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: