]> git.sur5r.net Git - minitube/blobdiff - src/ytfeedreader.cpp
Merge tag 'upstream/2.1.5'
[minitube] / src / ytfeedreader.cpp
index 117f92bf891cf5d91a225b8ec0ddd8e135319ce8..9aaacf0a1d1209b678dec7d1270aa3d8b7430ac5 100644 (file)
@@ -1,3 +1,23 @@
+/* $BEGIN_LICENSE
+
+This file is part of Minitube.
+Copyright 2009, Flavio Tordini <flavio.tordini@gmail.com>
+
+Minitube is free software: you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation, either version 3 of the License, or
+(at your option) any later version.
+
+Minitube is distributed in the hope that it will be useful,
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+GNU General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with Minitube.  If not, see <http://www.gnu.org/licenses/>.
+
+$END_LICENSE */
+
 #include "ytfeedreader.h"
 #include "video.h"
 
@@ -42,11 +62,9 @@ void YTFeedReader::readEntry() {
                     if (name() == QLatin1String("name")) {
                         QString author = readElementText();
                         video->setAuthor(author);
-                    } else if (name() == QLatin1String("uri")) {
-                        QString uri = readElementText();
-                        int i = uri.lastIndexOf('/');
-                        if (i != -1) uri = uri.mid(i+1);
-                        video->setAuthorUri(uri);
+                    } else if (name() == QLatin1String("userId")) {
+                        QString userId = readElementText();
+                        video->setUserId(userId);
                     } else skipCurrentElement();
             } else if (name() == QLatin1String("published")) {
                 video->setPublished(QDateTime::fromString(readElementText(), Qt::ISODate));
@@ -88,6 +106,12 @@ void YTFeedReader::readEntry() {
                             // qDebug() << "Duration: " << duration;
                             video->setDuration(duration.toInt());
                         }
+                        else if (name() == QLatin1String("license")) {
+                            QString license = readElementText();
+                            // qDebug() << "License: " << license;
+                            if (license == QLatin1String("cc"))
+                                video->setLicense(Video::LicenseCC);
+                        }
                     }
                 }
             }