@@ -142,12 +142,14 @@ MediaSeries::MediaSeries(const jellyfin::Item& item) : seriesId(item.Id) {
142142 this ->people ->registerCell (" Cell" , MediaCardCell::create);
143143 this ->similar ->registerCell (" Cell" , VideoCardCell::create);
144144 this ->nextUp ->registerCell (" Cell" , VideoCardCell::create);
145+ this ->special ->registerCell (" Cell" , VideoCardCell::create);
145146 this ->tabFrame ->registerTabAction (this );
146147
147148 this ->doSeason ();
148149 this ->doSeries ();
149150 this ->doNextup ();
150151 this ->doSimilar ();
152+ this ->doSpecial ();
151153
152154 // loading Logo
153155 auto logo = item.ImageTags .find (jellyfin::imageTypePrimary);
@@ -284,6 +286,7 @@ void MediaSeries::doSimilar() {
284286 std::string query = HTTP::encode_form ({
285287 {" userId" , AppConfig::instance ().getUserId ()},
286288 {" limit" , " 12" },
289+ {" enableImageTypes" , " Primary" },
287290 {" fields" , " ItemCounts" },
288291 });
289292
@@ -308,4 +311,28 @@ void MediaSeries::doSimilar() {
308311 brls::Application::notify (ex);
309312 },
310313 jellyfin::apiSimilar, this ->seriesId , query);
314+ }
315+
316+ void MediaSeries::doSpecial () {
317+ ASYNC_RETAIN
318+ jellyfin::getJSON<std::vector<jellyfin::Episode>>(
319+ [ASYNC_TOKEN](const std::vector<jellyfin::Episode>& r) {
320+ ASYNC_RELEASE
321+ if (r.size () > 0 ) {
322+ this ->special ->setDataSource (new VideoDataSource (r));
323+ this ->special ->setVisibility (brls::Visibility::VISIBLE);
324+ this ->labelSpecial ->setVisibility (brls::Visibility::VISIBLE);
325+ } else {
326+ this ->special ->setVisibility (brls::Visibility::GONE);
327+ this ->labelSpecial ->setVisibility (brls::Visibility::GONE);
328+ this ->special ->clearData ();
329+ }
330+ },
331+ [ASYNC_TOKEN](const std::string& ex) {
332+ ASYNC_RELEASE
333+ this ->special ->setVisibility (brls::Visibility::GONE);
334+ this ->labelSpecial ->setSubtitle (ex);
335+ brls::Application::notify (ex);
336+ },
337+ jellyfin::apiItemSpecial, AppConfig::instance ().getUserId (), this ->seriesId );
311338}
0 commit comments