MythTV  master
upnpcdsvideo.h
Go to the documentation of this file.
1 // Program Name: upnpcdsvideo.h
3 //
4 // Purpose - UPnP Content Directory Extention for Videos
5 //
6 // Created By : David Blain Created On : Jan. 24, 2005
7 // Modified By : Modified On:
8 //
10 
11 #ifndef UPnpCDSVIDEO_H_
12 #define UPnpCDSVIDEO_H_
13 
14 #include "mainserver.h"
15 #include "upnpcds.h"
16 
17 using IntMap = QMap<int, QString>;
18 
20 //
22 
24 {
25  public:
26 
27  UPnpCDSVideo( );
28  virtual ~UPnpCDSVideo() = default;
29 
30  protected:
31 
32  bool IsBrowseRequestForUs( UPnpCDSRequest *pRequest ) override; // UPnpCDSExtension
33  bool IsSearchRequestForUs( UPnpCDSRequest *pRequest ) override; // UPnpCDSExtension
34 
35  void CreateRoot ( ) override; // UPnpCDSExtension
36 
37  bool LoadMetadata( const UPnpCDSRequest *pRequest,
38  UPnpCDSExtensionResults *pResults,
39  const IDTokenMap& tokens,
40  const QString& currentToken ) override; // UPnpCDSExtension
41  bool LoadChildren( const UPnpCDSRequest *pRequest,
42  UPnpCDSExtensionResults *pResults,
43  const IDTokenMap& tokens,
44  const QString& currentToken ) override; // UPnpCDSExtension
45  private:
46  bool LoadSeries( const UPnpCDSRequest *pRequest,
47  UPnpCDSExtensionResults *pResults,
48  const IDTokenMap& tokens );
49 
50  bool LoadSeasons( const UPnpCDSRequest *pRequest,
51  UPnpCDSExtensionResults *pResults,
52  const IDTokenMap& tokens );
53 
54  bool LoadMovies( const UPnpCDSRequest *pRequest,
55  UPnpCDSExtensionResults *pResults,
56  IDTokenMap tokens );
57 
58  static bool LoadGenres( const UPnpCDSRequest *pRequest,
59  UPnpCDSExtensionResults *pResults,
60  const IDTokenMap& tokens );
61 
62  bool LoadVideos( const UPnpCDSRequest *pRequest,
63  UPnpCDSExtensionResults *pResults,
64  const IDTokenMap& tokens );
65 
66 
67  static void PopulateArtworkURIS( CDSObject *pItem, int nVidID,
68  const QUrl &URIBase );
69 
70  // Common code helpers
71  static QString BuildWhereClause( QStringList clauses,
72  IDTokenMap tokens );
73  static void BindValues ( MSqlQuery &query,
74  IDTokenMap tokens );
75 
77  QMap<QString, int> m_mapBackendPort;
78 
79  QUrl m_URIBase;
80 
81 };
82 
83 #endif
QMap< QString, QString > QStringMap
Definition: upnputil.h:40
static void PopulateArtworkURIS(CDSObject *pItem, int nVidID, const QUrl &URIBase)
QStringMap m_mapBackendIp
Definition: upnpcdsvideo.h:76
QSqlQuery wrapper that fetches a DB connection from the connection pool.
Definition: mythdbcon.h:125
bool LoadMovies(const UPnpCDSRequest *pRequest, UPnpCDSExtensionResults *pResults, IDTokenMap tokens)
virtual ~UPnpCDSVideo()=default
bool IsSearchRequestForUs(UPnpCDSRequest *pRequest) override
void CreateRoot() override
bool IsBrowseRequestForUs(UPnpCDSRequest *pRequest) override
bool LoadVideos(const UPnpCDSRequest *pRequest, UPnpCDSExtensionResults *pResults, const IDTokenMap &tokens)
QMap< QString, int > m_mapBackendPort
Definition: upnpcdsvideo.h:77
QMap< QString, QString > IDTokenMap
Definition: upnpcds.h:195
bool LoadChildren(const UPnpCDSRequest *pRequest, UPnpCDSExtensionResults *pResults, const IDTokenMap &tokens, const QString &currentToken) override
Fetch the children of the container identified in the request.
static QString BuildWhereClause(QStringList clauses, IDTokenMap tokens)
bool LoadSeasons(const UPnpCDSRequest *pRequest, UPnpCDSExtensionResults *pResults, const IDTokenMap &tokens)
static bool LoadGenres(const UPnpCDSRequest *pRequest, UPnpCDSExtensionResults *pResults, const IDTokenMap &tokens)
bool LoadSeries(const UPnpCDSRequest *pRequest, UPnpCDSExtensionResults *pResults, const IDTokenMap &tokens)
QMap< int, QString > IntMap
Definition: upnpcdsvideo.h:17
bool LoadMetadata(const UPnpCDSRequest *pRequest, UPnpCDSExtensionResults *pResults, const IDTokenMap &tokens, const QString &currentToken) override
Fetch just the metadata for the item identified in the request.
static void BindValues(MSqlQuery &query, IDTokenMap tokens)