• R/O
  • HTTP
  • SSH
  • HTTPS

Commit

Frequently used words (click to add to your profile)

javac++androidlinuxc#objective-cqt誰得windowscocoapythonphprubygameguibathyscaphec翻訳omegat計画中(planning stage)frameworktwittertestdomvb.netdirectxbtronarduinopreviewerゲームエンジン

Commit MetaInfo

Revision8f7362bf81c809ca5079cd85856b8d9b3feaf7c8 (tree)
Zeit2019-04-30 22:53:42
Autorkdrama_fansub <kdrama_funsub@yaho...>
Commiterkdrama_funsub

Log Message

ボキャブライダーのDL対象ロジック変更

Ändern Zusammenfassung

Diff

--- a/downloadthread.cpp
+++ b/downloadthread.cpp
@@ -530,7 +530,7 @@ QString DownloadThread::formatName( QString format, QString kouza, QString hdate
530530
531531 //--------------------------------------------------------------------------------
532532
533-bool DownloadThread::captureStream( QString kouza, QString hdate, QString file ) {
533+bool DownloadThread::captureStream( QString kouza, QString hdate, QString file, QString nendo, QString kon_nendo ) {
534534 QString outputDir = MainWindow::outputDir + kouza;
535535 if ( !checkOutputDir( outputDir ) )
536536 return false;
@@ -556,39 +556,42 @@ bool DownloadThread::captureStream( QString kouza, QString hdate, QString file )
556556
557557 int month = hdate.left( 2 ).toInt();
558558 int year = 2000 + file.left( 2 ).toInt();
559+ int fiscal_year = QDate::currentDate().year();
560+ if (QDate::currentDate().month() < 4 ) fiscal_year -= 1;
559561 int year1 = 2000 + file.left( 2 ).toInt();
560- if ( month <= 4 && QDate::currentDate().year() > year )
561- if ( !QString::compare( kouza , english_vr ) == 0 ) year += 1;
562- if ( QString::compare( kouza , english_vr ) == 0 && month < 4 ) year += 1;
562+ if (month < 4 ) year1 -= 1;
563+// if ( month <= 4 && QDate::currentDate().year() > year )
564+// if ( !QString::compare( kouza , english_vr ) == 0 ) year += 1;
565+// if ( QString::compare( kouza , english_vr ) == 0 && month < 4 ) year += 1;
563566 int day = hdate.mid( 3, 2 ).toInt();
564567 QDate onair( year, month, day );
565568 QString yyyymmdd = onair.toString( "yyyy_MM_dd" );
566569
567570
568571 if ( QString::compare( kouza , english_vr ) ==0 ){
569- QDate d1;
570- d1.setDate(QDate::currentDate().year(),QDate::currentDate().month(),QDate::currentDate().day());
571- int d2 = d1.dayOfWeek();
572+ QDate today;
573+ today.setDate(QDate::currentDate().year(),QDate::currentDate().month(),QDate::currentDate().day());
574+ int d2 = today.dayOfWeek();
575+ int day2 = onair.daysTo(QDate::currentDate())-today.dayOfWeek();
572576
573- if ( !ui->toolButton_vrradio1->isChecked() ){
577+ if ( !ui->toolButton_vrradio1->isChecked() && !ui->toolButton_vrradio2->isChecked() ){
574578 if ( d2 > 3 ) {
575- if ( onair.daysTo(QDate::currentDate())-d2 > 0 ) return false;
576- if ( onair.daysTo(QDate::currentDate())-d2 < -14 ) return false;
579+ if ( day2 > 0 || day2 < -14 ) return false;
577580 } else {
578- if ( onair.daysTo(QDate::currentDate())-d2 > 0 ) return false;
579- if ( onair.daysTo(QDate::currentDate())-d2 < -7 ) return false;
580- }
581-// if ( onair.daysTo(QDate::currentDate())-d2 > 7 ) return false;
582-// if ( onair.daysTo(QDate::currentDate())-d2 < 0 ) return false;
583- } else {
584- if ( ui->toolButton_vrradio2->isChecked() ){
585- if ( QDate::currentDate().year() > year1 ) return false;
581+ if ( day2 > 0 || day2 < -7 ) return false;
586582 }
583+ }
584+ if ( ui->toolButton_vrradio1->isChecked() && !ui->toolButton_vrradio2->isChecked() ){
585+ if ( day2 > 7 || day2 < 0 ) return false;
586+ }
587+ if ( !ui->toolButton_vrradio1->isChecked() && ui->toolButton_vrradio2->isChecked() ){
588+ if ( kon_nendo != nendo ) return false;
587589 if ( d2 > 3 ) {
588- if ( onair.daysTo(QDate::currentDate())-d2 < -14 ) return false;
590+ if ( day2 < -14 ) return false;
589591 } else {
590- if ( onair.daysTo(QDate::currentDate())-d2 < -7 ) return false;
591- }}
592+ if ( day2 < -7 ) return false;
593+ }
594+ }
592595 }
593596
594597
@@ -716,12 +719,14 @@ void DownloadThread::run() {
716719 if ( checkbox[i]->isChecked() ) {
717720 QStringList fileList = getAttribute( prefix + paths[i] + "/" + suffix, "@file" );
718721 QStringList kouzaList = getAttribute( prefix + paths[i] + "/" + suffix, "@kouza" );
722+ QStringList nendoList = getAttribute( prefix + paths[i] + "/" + suffix, "@nendo" );
723+ QStringList kon_nendoList = getAttribute( prefix + paths[1] + "/" + suffix, "@nendo" );
719724 QStringList hdateList = one2two( getAttribute( prefix + paths[i] + "/" + suffix, "@hdate" ) );
720725
721726 if ( fileList.count() && fileList.count() == kouzaList.count() && fileList.count() == hdateList.count() ) {
722727 if ( true /*ui->checkBox_this_week->isChecked()*/ ) {
723728 for ( int j = 0; j < fileList.count() && !isCanceled; j++ )
724- captureStream( kouzaList[j], hdateList[j], fileList[j] );
729+ captureStream( kouzaList[j], hdateList[j], fileList[j], nendoList[j], kon_nendoList[1] );
725730 }
726731 }
727732 }
--- a/downloadthread.h
+++ b/downloadthread.h
@@ -52,7 +52,7 @@ private:
5252 bool checkOutputDir( QString dirPath );
5353 void downloadENews( bool re_read );
5454
55- bool captureStream( QString kouza, QString hdate, QString file );
55+ bool captureStream( QString kouza, QString hdate, QString file, QString nendo, QString kon_nendo );
5656
5757 QString formatName( QString format, QString kouza, QString hdate, QString file, bool checkIllegal );
5858 QStringList getElements( QString url, QString path );
--- a/mainwindow.ui
+++ b/mainwindow.ui
@@ -869,7 +869,7 @@
869869 </font>
870870 </property>
871871 <property name="text">
872- <string>ボキャブライダー(過去)</string>
872+ <string>ボキャブライダー(先週)</string>
873873 </property>
874874 <property name="checkable">
875875 <bool>true</bool>