Ticket #3842: 3842-fixes-v3.patch
File 3842-fixes-v3.patch, 16.1 KB (added by , 17 years ago) |
---|
-
libs/libmythtv/videosource.h
11 11 class SignalTimeout; 12 12 class ChannelTimeout; 13 13 class UseEIT; 14 class VideoSource; 14 15 15 class VideoSource; 16 static inline bool is_grabber_external(const QString &grabber) 17 { 18 return !(grabber == "datadirect" || 19 grabber == "eitonly" || 20 grabber == "schedulesdirect1" || 21 grabber == "/bin/true"); 22 } 23 24 static inline bool is_grabber_datadirect(const QString &grabber) 25 { 26 return (grabber == "datadirect") || (grabber == "schedulesdirect1"); 27 } 28 29 static inline bool is_grabber_labs(const QString &grabber) 30 { 31 return grabber == "datadirect"; 32 } 33 16 34 class VSSetting: public SimpleDBStorage { 17 35 protected: 18 36 VSSetting(const VideoSource& _parent, QString name): … … 62 80 { 63 81 Q_OBJECT 64 82 public: 65 DataDirect_config(const VideoSource& _parent, int _ source = DD_ZAP2IT);83 DataDirect_config(const VideoSource& _parent, int _ddsource); 66 84 67 85 virtual void load(void); 68 86 -
libs/libmythtv/dbcheck.cpp
8 8 9 9 #include "mythcontext.h" 10 10 #include "mythdbcon.h" 11 #include "datadirect.h" // for DataDirectProcessor::FixProgramIDs 11 12 12 13 /// This is the DB schema version expected by the running MythTV instance. 13 14 const QString currentDatabaseVersion = "1160"; … … 424 425 425 426 VERBOSE(VB_IMPORTANT, QString("Current Schema Version: %1").arg(dbver)); 426 427 428 if (!gContext->GetNumSetting("MythFillFixProgramIDsHasRunOnce", 0)) 429 DataDirectProcessor::FixProgramIDs(); 430 427 431 if (dbver == currentDatabaseVersion) 428 432 return true; 429 433 -
libs/libmythtv/datadirect.h
11 11 12 12 enum DD_PROVIDERS 13 13 { 14 DD_ZAP2IT = 0, 15 DD_PROVIDER_COUNT, 14 DD_ZAP2IT = 0, 15 DD_SCHEDULES_DIRECT = 1, 16 DD_PROVIDER_COUNT = 2, 16 17 }; 17 18 18 19 class DataDirectURLs … … 315 316 static int UpdateChannelsSafe(uint sourceid, bool insert_channels); 316 317 static bool UpdateChannelsUnsafe(uint sourceid); 317 318 319 // static command, makes Labs and Schedules Direct ProgramIDs compatible. 320 static void FixProgramIDs(void); 321 318 322 private: 319 323 void CreateTempTables(void); 320 324 void CreateATempTable(const QString &ptablename, -
libs/libmythtv/datadirect.cpp
542 542 "http://datadirect.webservices.zap2it.com/tvlistings/xtvdService", 543 543 "http://labs.zap2it.com", 544 544 "/ztvws/ztvws_login/1,1059,TMS01-1,00.html"); 545 DataDirectURLs urls1( 546 "Schedules Direct", 547 "http://webservices.schedulesdirect.tmsdatadirect.com" 548 "/schedulesdirect/tvlistings/xtvdService", 549 "http://schedulesdirect.org", 550 "/login/index.php"); 545 551 providers.push_back(urls0); 552 providers.push_back(urls1); 546 553 547 554 QString tmpDir = "/tmp"; 548 555 tmpPostFile = makeTempFile(tmpDir + "/mythtv_post_XXXXXX"); … … 723 730 return true; 724 731 } 725 732 733 void DataDirectProcessor::FixProgramIDs(void) 734 { 735 VERBOSE(VB_GENERAL, "DataDirectProcessor::FixProgramIDs() -- begin"); 736 737 MSqlQuery query(MSqlQuery::DDCon()); 738 query.prepare( 739 "UPDATE recorded " 740 "SET programid=CONCAT(SUBSTRING(programid, 1, 2), " 741 " '00', SUBSTRING(programid, 3)) " 742 "WHERE length(programid) = 12"); 743 744 if (!query.exec()) 745 { 746 MythContext::DBError("Fixing program ids in recorded", query); 747 return; 748 } 749 750 query.prepare( 751 "UPDATE oldrecorded " 752 "SET programid=CONCAT(SUBSTRING(programid, 1, 2), " 753 " '00', SUBSTRING(programid, 3)) " 754 "WHERE length(programid) = 12"); 755 756 if (!query.exec()) 757 { 758 MythContext::DBError("Fixing program ids in oldrecorded", query); 759 return; 760 } 761 762 query.prepare( 763 "UPDATE program " 764 "SET programid=CONCAT(SUBSTRING(programid, 1, 2), " 765 " '00', SUBSTRING(programid, 3)) " 766 "WHERE length(programid) = 12"); 767 768 if (!query.exec()) 769 { 770 MythContext::DBError("Fixing program ids in program", query); 771 return; 772 } 773 774 gContext->SaveSetting("MythFillFixProgramIDsHasRunOnce", "1"); 775 776 VERBOSE(VB_GENERAL, "DataDirectProcessor::FixProgramIDs() -- end"); 777 } 778 726 779 FILE *DataDirectProcessor::DDPost( 727 780 QString ddurl, 728 781 QString postFilename, QString inputFile, … … 1018 1071 " channelMinor char(3) )"; 1019 1072 1020 1073 dd_tables["dd_schedule"] = 1021 "( programid char( 12), stationid char(12), "1074 "( programid char(40), stationid char(12), " 1022 1075 " scheduletime datetime, duration time, " 1023 1076 " isrepeat bool, stereo bool, " 1024 1077 " subtitled bool, hdtv bool, " … … 1028 1081 "INDEX progidx (programid) )"; 1029 1082 1030 1083 dd_tables["dd_program"] = 1031 "( programid char( 12) NOT NULL, seriesid char(12), "1084 "( programid char(40) NOT NULL, seriesid char(12), " 1032 1085 " title varchar(120), subtitle varchar(150), " 1033 1086 " description text, mpaarating char(5), " 1034 1087 " starrating char(5), runtime time, " … … 1050 1103 " partnumber int, parttotal int, " 1051 1104 " seriesid char(12), originalairdate date, " 1052 1105 " showtype varchar(30), colorcode varchar(20), " 1053 " syndicatedepisodenumber varchar(20), programid char( 12), "1106 " syndicatedepisodenumber varchar(20), programid char(40), " 1054 1107 " tvrating char(5), mpaarating char(5), " 1055 1108 "INDEX progidx (programid))"; 1056 1109 1057 1110 dd_tables["dd_productioncrew"] = 1058 "( programid char( 12), role char(30), "1111 "( programid char(40), role char(30), " 1059 1112 " givenname char(20), surname char(20), " 1060 1113 " fullname char(41), " 1061 1114 "INDEX progidx (programid), " 1062 1115 "INDEX nameidx (fullname))"; 1063 1116 1064 1117 dd_tables["dd_genre"] = 1065 "( programid char( 12) NOT NULL, class char(30), "1118 "( programid char(40) NOT NULL, class char(30), " 1066 1119 " relevance char(1), " 1067 1120 "INDEX progidx (programid))"; 1068 1121 -
libs/libmythtv/videosource.cpp
19 19 #include <qmap.h> 20 20 #include <qdir.h> 21 21 #include <qprocess.h> 22 #include <qdatetime.h> 22 23 23 24 // MythTV headers 24 25 #include "mythconfig.h" … … 148 149 class DataDirectPassword: public LineEditSetting, public VSSetting { 149 150 public: 150 151 DataDirectPassword(const VideoSource& parent): 151 VSSetting(parent, "password") { 152 VSSetting(parent, "password") 153 { 154 SetPasswordEcho(true); 152 155 setLabel(QObject::tr("Password")); 153 156 }; 154 157 }; … … 159 162 { 160 163 (void) uid; 161 164 (void) pwd; 162 (void) _source;163 165 #ifdef USING_BACKEND 164 166 if (uid.isEmpty() || pwd.isEmpty()) 165 167 return; … … 200 202 void DataDirect_config::load() 201 203 { 202 204 VerticalConfigurationGroup::load(); 203 if ((userid->getValue() != lastloadeduserid) || 204 (password->getValue() != lastloadedpassword)) 205 bool is_sd_userid = userid->getValue().contains("@") > 0; 206 bool match = ((is_sd_userid && (source == DD_SCHEDULES_DIRECT)) || 207 (!is_sd_userid && (source == DD_ZAP2IT))); 208 if (((userid->getValue() != lastloadeduserid) || 209 (password->getValue() != lastloadedpassword)) && match) 205 210 { 206 211 lineupselector->fillSelections(userid->getValue(), 207 212 password->getValue(), … … 296 301 "instead of just 'mythfilldatabase'.\nYour grabber does not provide " 297 302 "channel numbers, so you have to set them manually."); 298 303 299 if (grabber != "datadirect" && grabber != "eitonly" && 300 grabber != "/bin/true") 304 if (is_grabber_external(grabber)) 301 305 { 302 306 VERBOSE(VB_IMPORTANT, "\n" << err_msg); 303 307 MythPopupBox::showOkPopup( … … 365 369 // only save settings for the selected grabber 366 370 setSaveAll(false); 367 371 368 addTarget("datadirect", new DataDirect_config(parent)); 369 grabber->addSelection("North America (DataDirect) (Internal)", "datadirect"); 372 addTarget("schedulesdirect1", 373 new DataDirect_config(parent, DD_SCHEDULES_DIRECT)); 374 grabber->addSelection("North America (SchedulesDirect.org) " 375 "(Internal)", "schedulesdirect1"); 370 376 377 #if 1 378 addTarget("datadirect", new DataDirect_config(parent, DD_ZAP2IT)); 379 grabber->addSelection( 380 "North America (TMS Labs) (Internal)", "datadirect"); 381 #endif 382 371 383 addTarget("eitonly", new EITOnly_config(parent)); 372 384 grabber->addSelection("Transmitted guide only (EIT)", "eitonly"); 373 385 -
libs/libmyth/settings.cpp
494 494 connect(edit, SIGNAL(changeHelpText(QString)), cg, 495 495 SIGNAL(changeHelpText(QString))); 496 496 497 edit->setRW(rw); 497 setRW(rw); 498 SetPasswordEcho(password_echo); 498 499 499 500 return widget; 500 501 } … … 519 520 } 520 521 } 521 522 523 void LineEditSetting::SetPasswordEcho(bool b) 524 { 525 password_echo = b; 526 if (edit) 527 edit->setEchoMode(b ? QLineEdit::Password : QLineEdit::Normal); 528 } 529 522 530 QWidget* SliderSetting::configWidget(ConfigurationGroup *cg, QWidget* parent, 523 531 const char* widgetName) { 524 532 QHBox* widget; -
libs/libmyth/mythcontext.h
224 224 225 225 /// Update this whenever the plug-in API changes. 226 226 /// Including changes in the libmythtv class methods used by plug-ins. 227 #define MYTH_BINARY_VERSION "0.20.200 60828-4"227 #define MYTH_BINARY_VERSION "0.20.20070818-1" 228 228 229 229 /** \brief Increment this whenever the MythTV network protocol changes. 230 230 * -
libs/libmyth/settings.h
276 276 277 277 class LineEditSetting: virtual public Setting { 278 278 protected: 279 LineEditSetting(bool readwrite = true) : edit(NULL) { rw = readwrite; }; 279 LineEditSetting(bool readwrite = true) : 280 edit(NULL), rw(readwrite), password_echo(false) { } 280 281 public: 281 282 virtual QWidget* configWidget(ConfigurationGroup *cg, QWidget* parent, 282 283 const char* widgetName = 0); … … 292 293 293 294 virtual void setEnabled(bool b); 294 295 virtual void setVisible(bool b); 296 virtual void SetPasswordEcho(bool b); 295 297 296 298 private: 297 299 MythLineEdit* edit; 298 300 bool rw; 301 bool password_echo; 299 302 }; 300 303 301 304 // TODO: set things up so that setting the value as a string emits -
programs/mythfilldatabase/filldata.cpp
40 40 #include "cardutil.h" 41 41 #include "sourceutil.h" 42 42 #include "remoteutil.h" 43 #include "videosource.h" // for is_grabber.. 43 44 44 45 using namespace std; 45 46 … … 852 853 UpdateSourceIcons(source.id); 853 854 854 855 // Unselect channels not in users lineup for DVB, HDTV 855 if (!insert_channels && (new_channels > 0)) 856 if (!insert_channels && (new_channels > 0) && 857 is_grabber_labs(source.xmltvgrabber)) 856 858 { 857 859 bool ok0 = (logged_in == source.userid); 858 860 bool ok1 = (raw_lineup == source.id); … … 877 879 878 880 bool DataDirectUpdateChannels(Source source) 879 881 { 882 if (!is_grabber_labs(source.xmltvgrabber)) 883 { 884 VERBOSE(VB_IMPORTANT, "FillData: We only support " 885 "DataDirectUpdateChannels with TMS Labs channel editor"); 886 return false; 887 } 888 880 889 ddprocessor.SetListingsProvider(DD_ZAP2IT); 881 890 ddprocessor.SetUserID(source.userid); 882 891 ddprocessor.SetPassword(source.password); … … 2531 2540 2532 2541 if (xmltv_grabber == "datadirect") 2533 2542 return grabDDData(source, offset, *qCurrentDate, DD_ZAP2IT); 2543 else if (xmltv_grabber == "schedulesdirect1") 2544 return grabDDData(source, offset, *qCurrentDate, DD_SCHEDULES_DIRECT); 2534 2545 else if (xmltv_grabber == "technovera") 2535 2546 { 2536 2547 VERBOSE(VB_ALL, "This grabber is no longer supported"); … … 2857 2868 .arg((*it).xmltvgrabber)); 2858 2869 2859 2870 QString xmltv_grabber = (*it).xmltvgrabber; 2860 need_post_grab_proc |= (xmltv_grabber != "datadirect");2871 need_post_grab_proc |= !is_grabber_datadirect(xmltv_grabber); 2861 2872 2862 2873 if (xmltv_grabber == "tv_grab_uk" || xmltv_grabber == "tv_grab_uk_rt" || 2863 2874 xmltv_grabber == "tv_grab_fi" || xmltv_grabber == "tv_grab_es" || … … 2872 2883 if (!grabData(*it, 0)) 2873 2884 ++failures; 2874 2885 } 2875 else if ( (xmltv_grabber == "datadirect") && dd_grab_all)2886 else if (is_grabber_labs(xmltv_grabber) && dd_grab_all) 2876 2887 { 2877 2888 if (only_update_channels) 2878 2889 DataDirectUpdateChannels(*it); … … 2882 2893 grabData(*it, 0, &qCurrentDate); 2883 2894 } 2884 2895 } 2885 else if ( xmltv_grabber == "datadirect"||2896 else if (is_grabber_datadirect(xmltv_grabber) || 2886 2897 xmltv_grabber == "tv_grab_se_swedb" || 2887 2898 xmltv_grabber == "tv_grab_no" || 2888 2899 xmltv_grabber == "tv_grab_de_tvtoday" || … … 2906 2917 // often decided by the person maintaining the grabbers. 2907 2918 if (maxDays > 0) // passed with --max-days 2908 2919 grabdays = maxDays; 2909 else if ( xmltv_grabber == "datadirect")2920 else if (is_grabber_datadirect(xmltv_grabber)) 2910 2921 grabdays = 14; 2911 2922 else if (xmltv_grabber == "tv_grab_se_swedb") 2912 2923 grabdays = 10; … … 2922 2933 if (grabdays == 1) 2923 2934 refresh_today = true; 2924 2935 2925 if ( (xmltv_grabber == "datadirect") && only_update_channels)2936 if (is_grabber_labs(xmltv_grabber) && only_update_channels) 2926 2937 { 2927 2938 DataDirectUpdateChannels(*it); 2928 2939 grabdays = 0; … … 3330 3341 int fromxawfile_id = 1; 3331 3342 QString fromxawfile_name; 3332 3343 3333 bool usingDataDirect = false ;3344 bool usingDataDirect = false, usingDataDirectLabs = false; 3334 3345 bool grab_data = true; 3335 3346 3336 3347 bool export_iconmap = false; … … 3860 3871 newsource.lineupid = sourcequery.value(5).toString(); 3861 3872 3862 3873 sourcelist.append(newsource); 3863 if (newsource.xmltvgrabber == "datadirect") 3864 usingDataDirect = true; 3874 usingDataDirect |= 3875 is_grabber_datadirect(newsource.xmltvgrabber); 3876 usingDataDirectLabs |= 3877 is_grabber_labs(newsource.xmltvgrabber); 3865 3878 } 3866 3879 } 3867 3880 else … … 4095 4108 ddprocessor.GrabNextSuggestedTime(); 4096 4109 } 4097 4110 4111 if (usingDataDirectLabs || 4112 !gContext->GetNumSetting("MythFillFixProgramIDsHasRunOnce", 0)) 4113 { 4114 DataDirectProcessor::FixProgramIDs(); 4115 } 4116 4098 4117 VERBOSE(VB_IMPORTANT, "\n" 4099 4118 "===============================================================\n" 4100 4119 "| Attempting to contact the master backend for rescheduling. |\n"