Compare commits
1
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
95ea5da248 |
No files matched your search
@@ -21,6 +21,12 @@ ColumnLayout {
|
||||
anchors.right: parent.right
|
||||
height: maximized ? applicationWindow().height : player.preferredHeight
|
||||
|
||||
Image {
|
||||
Layout.fillWidth: true
|
||||
Layout.fillHeight: true
|
||||
source: info.thumbnail
|
||||
}
|
||||
|
||||
Controls.ScrollView {
|
||||
Layout.fillHeight: footerLayout.maximized
|
||||
Layout.fillWidth: true
|
||||
|
||||
@@ -8,7 +8,7 @@
|
||||
|
||||
int main() {
|
||||
const auto ytm = YTMusic();
|
||||
const auto results = ytm.search("leoniden");
|
||||
const auto results = ytm.search("Syd Matters");
|
||||
|
||||
std::cout << "Found " << results.size() << " results." << std::endl;
|
||||
|
||||
|
||||
@@ -26,6 +26,7 @@ VideoInfoExtractor::VideoInfoExtractor(QObject *parent)
|
||||
Q_EMIT audioUrlChanged();
|
||||
Q_EMIT titleChanged();
|
||||
Q_EMIT songChanged();
|
||||
Q_EMIT thumbnailChanged();
|
||||
});
|
||||
}
|
||||
|
||||
@@ -76,6 +77,12 @@ QString VideoInfoExtractor::title() const
|
||||
return QString::fromStdString(m_videoInfo.title);
|
||||
}
|
||||
|
||||
QString VideoInfoExtractor::thumbnail() const
|
||||
{
|
||||
qDebug() << "thumb" << QString::fromStdString(m_videoInfo.thumnnail);
|
||||
return QString::fromStdString(m_videoInfo.thumnnail);
|
||||
}
|
||||
|
||||
bool VideoInfoExtractor::loading() const
|
||||
{
|
||||
return m_loading;
|
||||
|
||||
@@ -17,6 +17,7 @@ class VideoInfoExtractor : public QObject
|
||||
|
||||
Q_PROPERTY(QUrl audioUrl READ audioUrl NOTIFY audioUrlChanged)
|
||||
Q_PROPERTY(QString title READ title NOTIFY titleChanged)
|
||||
Q_PROPERTY(QString thumbnail READ thumbnail NOTIFY thumbnailChanged)
|
||||
Q_PROPERTY(bool loading READ loading WRITE setLoading NOTIFY loadingChanged)
|
||||
|
||||
public:
|
||||
@@ -32,6 +33,9 @@ public:
|
||||
QString title() const;
|
||||
Q_SIGNAL void titleChanged();
|
||||
|
||||
QString thumbnail() const;
|
||||
Q_SIGNAL void thumbnailChanged();
|
||||
|
||||
bool loading() const;
|
||||
void setLoading(bool loading);
|
||||
Q_SIGNAL void loadingChanged();
|
||||
|
||||
+2
-1
@@ -420,7 +420,8 @@ video_info::VideoInfo YTMusic::extract_video_info(const std::string &video_id) c
|
||||
return {
|
||||
info["id"].cast<std::string>(),
|
||||
info["title"].cast<std::string>(),
|
||||
extract_py_list<video_info::Format>(info["formats"])
|
||||
extract_py_list<video_info::Format>(info["formats"]),
|
||||
info["thumbnail"].cast<std::string>()
|
||||
};
|
||||
}
|
||||
|
||||
|
||||
@@ -240,6 +240,7 @@ struct VideoInfo {
|
||||
std::string id;
|
||||
std::string title;
|
||||
std::vector<Format> formats;
|
||||
std::string thumnnail;
|
||||
|
||||
// More, but not interesting for us right now
|
||||
};
|
||||
|
||||
Reference in new issue
Block a user