2 Copyright 2014 Marten Richter
4 This file is part of VOMP.
6 VOMP is free software; you can redistribute it and/or modify
7 it under the terms of the GNU General Public License as published by
8 the Free Software Foundation; either version 2 of the License, or
9 (at your option) any later version.
11 VOMP is distributed in the hope that it will be useful,
12 but WITHOUT ANY WARRANTY; without even the implied warranty of
13 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 GNU General Public License for more details.
16 You should have received a copy of the GNU General Public License
17 along with VOMP; if not, write to the Free Software
18 Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
22 #include "movieinfo.h"
23 #include "seriesinfo.h"
26 TVMediaInfo::TVMediaInfo()
28 type=2; // movie or series
29 primary_id=0; //movie or series_id
30 secondary_id=0; //0 or episode id
31 type_pict=-1; // 0 full info, 1 poster, 2 poster banner, 3 poster thumb
32 container=-1; // indices the dataelements with picture in movieinfo or seriesinfo
33 container_member=-1; // index into the container
38 TVMediaInfo::TVMediaInfo(const TVMediaInfo& info)
40 type=info.type; // movie or series
41 primary_id=info.primary_id; //movie or series_id
42 secondary_id=info.secondary_id; //0 or episode id
43 type_pict=info.type_pict; // 0 full info, 1 poster, 2 poster banner, 3 poster thumb
44 container=info.container; // indices the dataelements with picture in movieinfo or seriesinfo
45 container_member=info.container_member; // index into the container
49 void TVMediaInfo::setMovieInfo(const MovieInfo * mi)
51 type=1; // movie or series
52 primary_id=mi->id; //movie or series_id
53 secondary_id=0; //0 or episode id
56 void TVMediaInfo::setSeriesInfo(const SeriesInfo * si)
58 type=0; // movie or series
59 primary_id=si->id; //movie or series_id
60 secondary_id=si->episode.episodeid; //0 or episode id
63 bool operator<(const TVMediaInfo& rhs, const TVMediaInfo& lhs)
65 if (rhs.type==lhs.type) {
66 if (rhs.primary_id==lhs.primary_id) {
67 if (rhs.secondary_id==lhs.secondary_id) {
68 if (rhs.type_pict==lhs.type_pict) {
69 if (rhs.container==lhs.container) {
70 return rhs.container_member<lhs.container_member;
72 return rhs.container<lhs.container;
77 return rhs.type_pict<lhs.type_pict;
81 return rhs.secondary_id<lhs.secondary_id;
85 return rhs.primary_id<lhs.primary_id;
89 return rhs.type < lhs.type;