]> git.vomp.tv Git - vompclient.git/blob - wseriesview.cc
Compile fixes for stretch
[vompclient.git] / wseriesview.cc
1 /*
2     Copyright 2014 Marten Richter
3
4     This file is part of VOMP.
5
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.
10
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.
15
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.
19 */
20
21 #include "wseriesview.h"
22 #include "i18n.h"
23 #include <sstream>
24
25
26 WSeriesView::WSeriesView(SeriesInfo* series):
27 WTextbox(NULL)
28 {
29         // portions from nopacity plugin by Louis Braun
30         if (series)
31         {
32                 std::stringstream info;
33             info << tr("TheTVDB Information") << ":\n\n";
34
35             if (!series->episode.name.empty()) {
36                 info << tr("Episode") << ": " << series->episode.name << " (" << tr("Season") << " " << series->episode.season << ", " << tr("Episode") << " " << series->episode.number << ")\n\n";
37             }
38             if (!series->episode.overview.empty()) {
39                 info << tr("Episode Overview") << ": " << series->episode.overview << "\n\n";
40             }
41             if (!series->episode.firstAired.empty()) {
42                 info << tr("First aired") << ": " << series->episode.firstAired << "\n\n";
43             }
44             if (!series->episode.guestStars.empty()) {
45                 info << tr("Guest Stars") << ": " << series->episode.guestStars << "\n\n";
46             }
47             if (series->episode.rating > 0) {
48                 info << tr("TheMovieDB Rating") << ": " << series->episode.rating << "\n\n";
49             }
50             if (!series->overview.empty()) {
51                 info << tr("Series Overview") << ": " << series->overview << "\n\n";
52             }
53             if (!series->firstAired.empty()) {
54                 info << tr("First aired") << ": " << series->firstAired << "\n\n";
55             }
56             if (!series->genre.empty()) {
57                 info << tr("Genre") << ": " << series->genre << "\n\n";
58             }
59             if (!series->network.empty()) {
60                 info << tr("Network") << ": " << series->network << "\n\n";
61             }
62             if (series->rating > 0) {
63                 info << tr("TheMovieDB Rating") << ": " << series->rating << "\n\n";
64             }
65             if (!series->status.empty()) {
66                 info << tr("Status") << ": " << series->status << "\n\n";
67             }
68             setText(info.str().c_str());
69         } else {
70                 setText("This is a bug!");
71         }
72
73 }