Ticket #3842: 3842-fixes-v4.patch
| File 3842-fixes-v4.patch, 15.9 KB (added by , 18 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
41 41 #include "cardutil.h" 42 42 #include "sourceutil.h" 43 43 #include "remoteutil.h" 44 #include "videosource.h" // for is_grabber.. 44 45 45 46 using namespace std; 46 47 … … 858 859 UpdateSourceIcons(source.id); 859 860 860 861 // Unselect channels not in users lineup for DVB, HDTV 861 if (!insert_channels && (new_channels > 0)) 862 if (!insert_channels && (new_channels > 0) && 863 is_grabber_labs(source.xmltvgrabber)) 862 864 { 863 865 bool ok0 = (logged_in == source.userid); 864 866 bool ok1 = (raw_lineup == source.id); … … 883 885 884 886 bool DataDirectUpdateChannels(Source source) 885 887 { 888 if (!is_grabber_labs(source.xmltvgrabber)) 889 { 890 VERBOSE(VB_IMPORTANT, "FillData: We only support " 891 "DataDirectUpdateChannels with TMS Labs channel editor"); 892 return false; 893 } 894 886 895 ddprocessor.SetListingsProvider(DD_ZAP2IT); 887 896 ddprocessor.SetUserID(source.userid); 888 897 ddprocessor.SetPassword(source.password); … … 2547 2556 2548 2557 if (xmltv_grabber == "datadirect") 2549 2558 return grabDDData(source, offset, *qCurrentDate, DD_ZAP2IT); 2559 else if (xmltv_grabber == "schedulesdirect1") 2560 return grabDDData(source, offset, *qCurrentDate, DD_SCHEDULES_DIRECT); 2550 2561 else if (xmltv_grabber == "technovera") 2551 2562 { 2552 2563 VERBOSE(VB_IMPORTANT, "The technovera grabber is no longer supported"); … … 2852 2863 2853 2864 bool hasprefmethod = false; 2854 2865 2855 if ( xmltv_grabber != "datadirect")2866 if (is_grabber_external(xmltv_grabber)) 2856 2867 { 2857 2868 2858 2869 QProcess grabber_capabilities_proc(xmltv_grabber); … … 2950 2961 } 2951 2962 } 2952 2963 2953 need_post_grab_proc |= (xmltv_grabber != "datadirect");2964 need_post_grab_proc |= !is_grabber_datadirect(xmltv_grabber); 2954 2965 2955 if ( (xmltv_grabber == "datadirect") && dd_grab_all)2966 if (is_grabber_labs(xmltv_grabber) && dd_grab_all) 2956 2967 { 2957 2968 if (only_update_channels) 2958 2969 DataDirectUpdateChannels(*it); … … 2967 2978 if (!grabData(*it, 0)) 2968 2979 ++failures; 2969 2980 } 2970 else if ((*it).xmltvgrabber_baseline || xmltv_grabber == "datadirect") 2981 else if ((*it).xmltvgrabber_baseline || 2982 is_grabber_datadirect(xmltv_grabber)) 2971 2983 { 2972 2984 2973 2985 QDate qCurrentDate = QDate::currentDate(); … … 2978 2990 2979 2991 if (maxDays > 0) // passed with --max-days 2980 2992 grabdays = maxDays; 2981 else if ( xmltv_grabber == "datadirect")2993 else if (is_grabber_datadirect(xmltv_grabber)) 2982 2994 grabdays = 14; 2983 2995 2984 2996 grabdays = (only_update_channels) ? 1 : grabdays; … … 2986 2998 if (grabdays == 1) 2987 2999 refresh_today = true; 2988 3000 2989 if ( (xmltv_grabber == "datadirect") && only_update_channels)3001 if (is_grabber_labs(xmltv_grabber) && only_update_channels) 2990 3002 { 2991 3003 DataDirectUpdateChannels(*it); 2992 3004 grabdays = 0; … … 3397 3409 int fromxawfile_id = 1; 3398 3410 QString fromxawfile_name; 3399 3411 3400 bool usingDataDirect = false ;3412 bool usingDataDirect = false, usingDataDirectLabs = false; 3401 3413 bool grab_data = true; 3402 3414 3403 3415 bool export_iconmap = false; … … 3932 3944 newsource.xmltvgrabber_prefmethod = ""; 3933 3945 3934 3946 sourcelist.append(newsource); 3935 if (newsource.xmltvgrabber == "datadirect") 3936 usingDataDirect = true; 3947 usingDataDirect |= 3948 is_grabber_datadirect(newsource.xmltvgrabber); 3949 usingDataDirectLabs |= 3950 is_grabber_labs(newsource.xmltvgrabber); 3937 3951 } 3938 3952 } 3939 3953 else … … 4167 4181 ddprocessor.GrabNextSuggestedTime(); 4168 4182 } 4169 4183 4184 if (usingDataDirectLabs || 4185 !gContext->GetNumSetting("MythFillFixProgramIDsHasRunOnce", 0)) 4186 { 4187 DataDirectProcessor::FixProgramIDs(); 4188 } 4189 4170 4190 VERBOSE(VB_IMPORTANT, "\n" 4171 4191 "===============================================================\n" 4172 4192 "| Attempting to contact the master backend for rescheduling. |\n"
