]> git.sur5r.net Git - minitube/blobdiff - src/channelview.cpp
Upload 3.9.3-2 to unstable
[minitube] / src / channelview.cpp
index 0ce9a2c313cf64137119be10248f14c2e3fadcd4..c9e1e8bf4348ac4f5c33858dc436d582a59f6b44 100644 (file)
@@ -34,6 +34,10 @@ $END_LICENSE */
 #endif
 #include "channellistview.h"
 
+#include "ivchannelsource.h"
+#include "videoapi.h"
+#include "ytjschannelsource.h"
+
 namespace {
 const QString sortByKey = "subscriptionsSortBy";
 const QString showUpdatedKey = "subscriptionsShowUpdated";
@@ -70,6 +74,8 @@ ChannelView::ChannelView(QWidget *parent) : View(parent), showUpdated(false), so
 void ChannelView::setupActions() {
     QSettings settings;
 
+    statusActions << MainWindow::instance()->getAction("importSubscriptions");
+
     sortBy = static_cast<SortBy>(settings.value(sortByKey, SortByName).toInt());
 
     QMenu *sortMenu = new QMenu(this);
@@ -168,9 +174,17 @@ void ChannelView::itemActivated(const QModelIndex &index) {
         params->setChannelId(channel->getChannelId());
         params->setSortBy(SearchParams::SortByNewest);
         params->setTransient(true);
-        YTSearch *videoSource = new YTSearch(params);
-        videoSource->setAsyncDetails(true);
-        emit activated(videoSource);
+        VideoSource *vs = nullptr;
+        if (VideoAPI::impl() == VideoAPI::YT3) {
+            YTSearch *videoSource = new YTSearch(params);
+            videoSource->setAsyncDetails(true);
+            vs = videoSource;
+        } else if (VideoAPI::impl() == VideoAPI::IV) {
+            vs = new IVChannelSource(params);
+        } else if (VideoAPI::impl() == VideoAPI::JS) {
+            vs = new YTJSChannelSource(params);
+        }
+        emit activated(vs);
         channel->updateWatched();
     } else if (itemType == ChannelModel::ItemAggregate) {
         AggregateVideoSource *videoSource = new AggregateVideoSource();