#endif
#include "channellistview.h"
+#include "ivchannelsource.h"
+#include "videoapi.h"
+#include "ytjschannelsource.h"
+
namespace {
const QString sortByKey = "subscriptionsSortBy";
const QString showUpdatedKey = "subscriptionsShowUpdated";
void ChannelView::setupActions() {
QSettings settings;
+ statusActions << MainWindow::instance()->getAction("importSubscriptions");
+
sortBy = static_cast<SortBy>(settings.value(sortByKey, SortByName).toInt());
QMenu *sortMenu = new QMenu(this);
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();