]> Some of my projects - localmylist.git/commitdiff
Import the new data from MyList exports
authorAPTX <marek321@gmail.com>
Mon, 23 Jul 2012 23:28:22 +0000 (01:28 +0200)
committerAPTX <marek321@gmail.com>
Mon, 23 Jul 2012 23:28:22 +0000 (01:28 +0200)
localmylist/mylistexportparsetask.cpp

index 63172602ddaaf90d25c8968ba8d31942f685e0fd..daf6f706d9aca31e4c27b1b9ab4971ede8f08dc5 100644 (file)
@@ -265,6 +265,10 @@ qDebug() << "Updating Anime" << current.aid;
                        current.endDate = a.endDate;
                if (!a.type.isEmpty())
                        current.type = a.type;
+               if (a.totalEpisodeCount)
+                       current.totalEpisodeCount = a.totalEpisodeCount;
+               if (a.highestEpno)
+                       current.highestEpno = a.highestEpno;
        }else{qDebug() << "No update required" << current.aid;}
 
        current.entryUpdate = QDateTime::currentDateTime();
@@ -317,7 +321,14 @@ void MyListExportParseTask::readEpisode()
                                e.anidbUpdate = QDateTime::fromString(readElementText(), dateTimeFormat);
                        }
                        else if (name() == "EpNo") {
-                               e.epno = readElementText().toInt();
+                               QString epno = readElementText();
+                               if (epno.length() && !epno[0].isNumber())
+                               {
+                                       // For some reason, the Trailer type is only in epno...
+                                       e.type = epno.left(1);
+                                       epno = epno.mid(1);
+                               }
+                               e.epno = epno.toInt();
                        }
                        else if (name() == "EpNameRomaji") {
                                e.titleRomaji = readElementText();