Ticket #6346: MythVideo.TVGrabbers.31709.diff
File MythVideo.TVGrabbers.31709.diff, 9.0 KB (added by , 15 years ago) |
---|
-
mythvideo/mythvideo/globalsettings.cpp
235 235 return gc; 236 236 } 237 237 238 HostLineEdit *SearchTVListingsCommand() 239 { 240 HostLineEdit *gc = new HostLineEdit("mythvideo.TVListCommandLine"); 241 gc->setLabel(QObject::tr("Command to search for TV shows in MythVideo")); 242 gc->setValue(GetShareDir() + "mythvideo/scripts/ttvdb.py -M"); 243 gc->setHelpText(QObject::tr("This command must be " 244 "executable by the user running MythVideo.")); 245 return gc; 246 } 247 248 HostLineEdit *GetTVPostersCommand() 249 { 250 HostLineEdit *gc = new HostLineEdit("mythvideo.TVPosterCommandLine"); 251 gc->setLabel(QObject::tr("Command to search for TV Season posters")); 252 gc->setValue(GetShareDir() + "mythvideo/scripts/ttvdb.py -mP"); 253 gc->setHelpText(QObject::tr("This command must be " 254 "executable by the user running MythVideo.")); 255 return gc; 256 } 257 258 HostLineEdit *GetTVFanartCommand() 259 { 260 HostLineEdit *gc = new HostLineEdit("mythvideo.TVFanartCommandLine"); 261 gc->setLabel(QObject::tr("Command to search for movie fanart")); 262 gc->setValue(GetShareDir() + "mythvideo/scripts/ttvdb.py -tF"); 263 gc->setHelpText(QObject::tr("This command must be " 264 "executable by the user running MythVideo.")); 265 return gc; 266 } 267 268 HostLineEdit *GetTVDataCommand() 269 { 270 HostLineEdit *gc = new HostLineEdit("mythvideo.TVDataCommandLine"); 271 gc->setLabel(QObject::tr("Command to extract data for TV Episodes")); 272 gc->setValue(GetShareDir() + "mythvideo/scripts/ttvdb.py -D"); 273 gc->setHelpText(QObject::tr("This command must be " 274 "executable by the user running MythVideo.")); 275 return gc; 276 } 277 238 278 HostLineEdit *VideoStartupDirectory() 239 279 { 240 280 HostLineEdit *gc = new HostLineEdit("VideoStartupDir"); … … 782 844 VConfigPage page7(pages, false); 783 845 page7->addChild(trlr); 784 846 847 // page 8 848 VerticalConfigurationGroup *tvman = 849 new VerticalConfigurationGroup(true, false); 850 tvman->setLabel(QObject::tr("Television in MythVideo")); 851 tvman->addChild(SearchTVListingsCommand()); 852 tvman->addChild(GetTVPostersCommand()); 853 tvman->addChild(GetTVFanartCommand()); 854 tvman->addChild(GetTVDataCommand()); 855 856 VConfigPage page8(pages, false); 857 page8->addChild(tvman); 858 785 859 int page_num = 1; 786 860 for (ConfigPage::PageList::const_iterator p = pages.begin(); 787 861 p != pages.end(); ++p, ++page_num) -
mythvideo/mythvideo/videodlg.cpp
467 467 void Run(QString title, Metadata *item) 468 468 { 469 469 m_item = item; 470 int m_season, m_episode; 471 QString cmd; 472 m_season = m_item->GetSeason(); 473 m_episode = m_item->GetEpisode(); 470 474 471 QString def_cmd = QDir::cleanPath(QString("%1/%2") 475 if (m_season > 0 || m_episode > 0) 476 { 477 const QString def_cmd = QDir::cleanPath(QString("%1/%2") 472 478 .arg(GetShareDir()) 479 .arg("mythvideo/scripts/ttvdb.py -M")); 480 cmd = gContext->GetSetting("mythvideo.TVListCommandLine", 481 def_cmd); 482 } 483 else 484 { 485 QString def_cmd = QDir::cleanPath(QString("%1/%2") 486 .arg(GetShareDir()) 473 487 .arg("mythvideo/scripts/tmdb.pl -M")); 474 488 475 QStringcmd = gContext->GetSetting("MovieListCommandLine", def_cmd);476 477 QStringList args;478 args += title;479 StartRun(cmd, args, "Video Search");489 cmd = gContext->GetSetting("MovieListCommandLine", def_cmd); 490 } 491 QStringList args; 492 args += title; 493 StartRun(cmd, args, "Video Search"); 480 494 } 481 495 482 496 private: … … 525 539 void Run(QString video_uid, Metadata *item) 526 540 { 527 541 m_item = item; 528 m_video_uid = video_uid; 542 m_video_uid = video_uid; 543 int m_season, m_episode; 544 m_season = m_item->GetSeason(); 545 m_episode = m_item->GetEpisode(); 529 546 530 const QString def_cmd = QDir::cleanPath(QString("%1/%2") 547 if (m_season > 0 || m_episode > 0) 548 { 549 const QString def_cmd = QDir::cleanPath(QString("%1/%2") 531 550 .arg(GetShareDir()) 551 .arg("mythvideo/scripts/ttvdb.py -mD")); 552 const QString cmd = gContext->GetSetting("mythvideo.TVDataCommandLine", 553 def_cmd); 554 QStringList args; 555 args << video_uid << QString::number(m_season) 556 << QString::number(m_episode); 557 StartRun(cmd, args, "Video Data Query"); 558 } 559 else 560 { 561 const QString def_cmd = QDir::cleanPath(QString("%1/%2") 562 .arg(GetShareDir()) 532 563 .arg("mythvideo/scripts/tmdb.pl -D")); 533 const QString cmd = gContext->GetSetting("MovieDataCommandLine",564 const QString cmd = gContext->GetSetting("MovieDataCommandLine", 534 565 def_cmd); 535 536 StartRun(cmd, QStringList(video_uid), "Video Data Query");566 StartRun(cmd, QStringList(video_uid), "Video Data Query"); 567 } 537 568 } 538 569 539 570 private: … … 570 601 void Run(QString video_uid, Metadata *item) 571 602 { 572 603 m_item = item; 604 int m_season, m_episode; 605 m_season = m_item->GetSeason(); 606 m_episode = m_item->GetEpisode(); 573 607 574 const QString default_cmd = 608 if (m_season > 0 || m_episode > 0) 609 { 610 const QString def_cmd = QDir::cleanPath(QString("%1/%2") 611 .arg(GetShareDir()) 612 .arg("mythvideo/scripts/ttvdb.py -mP")); 613 const QString cmd = gContext->GetSetting("mythvideo.TVPosterCommandLine", 614 def_cmd); 615 QStringList args; 616 args << video_uid << QString::number(m_season) 617 << QString::number(m_episode); 618 StartRun(cmd, args, "Poster Query"); 619 } 620 else 621 { 622 const QString default_cmd = 575 623 QDir::cleanPath(QString("%1/%2") 576 624 .arg(GetShareDir()) 577 625 .arg("mythvideo/scripts/tmdb.pl -P")); 578 const QString cmd = gContext->GetSetting("MoviePosterCommandLine",626 const QString cmd = gContext->GetSetting("MoviePosterCommandLine", 579 627 default_cmd); 580 StartRun(cmd, QStringList(video_uid), "Poster Query"); 628 629 StartRun(cmd, QStringList(video_uid), "Poster Query"); 630 } 581 631 } 582 632 583 633 private: … … 627 677 void Run(QString video_uid, Metadata *item) 628 678 { 629 679 m_item = item; 680 int m_season, m_episode; 681 m_season = m_item->GetSeason(); 682 m_episode = m_item->GetEpisode(); 630 683 631 const QString default_cmd = 684 if (m_season > 0 || m_episode > 0) 685 { 686 const QString def_cmd = QDir::cleanPath(QString("%1/%2") 687 .arg(GetShareDir()) 688 .arg("mythvideo/scripts/ttvdb.py -tF")); 689 const QString cmd = gContext->GetSetting("mythvideo.TVFanartCommandLine", 690 def_cmd); 691 QStringList args; 692 args << video_uid << QString::number(m_season) 693 << QString::number(m_episode); 694 StartRun(cmd, args, "Fanart Query"); 695 } 696 else 697 { 698 const QString default_cmd = 632 699 QDir::cleanPath(QString("%1/%2") 633 700 .arg(GetShareDir()) 634 .arg("mythvideo/scripts/tmdb.pl - B"));635 const QString cmd = gContext->GetSetting("MovieFanartCommandLine",701 .arg("mythvideo/scripts/tmdb.pl -F")); 702 const QString cmd = gContext->GetSetting("MovieFanartCommandLine", 636 703 default_cmd); 637 StartRun(cmd, QStringList(video_uid), "Fanart Query"); 704 StartRun(cmd, QStringList(video_uid), "Fanart Query"); 705 } 638 706 } 639 707 640 708 private: