While working on v4 of IMDb Movie and People scripts, I have defined and we now finally have all the starting positions for IMDb scripts:
//Field Overwrite Options position in pvdconf.ini------------------------------------------------------------------------
//0=Do nothing,1=Set if Empty,2=Overwrite. The Length of 'IMDB_People_[EN][HTTPS].psf=' is 28
opName = 29-28;
opTransName = 30-28;
opAltNames = 31-28;
opBirthday = 32-28;
opBirthplace = 34-28;
opGenre = 43-28;
opFilmography = 45-28;
opAwards = 47-28;
opDeath = 33-28;
opPhoto = 48-28;
opBio = 39-28;
opCareer = 46-28;
//Field Overwrite Options position in pvdconf.ini------------------------------------------------------------------------
//0=Do nothing,1=Set if Empty,2=Overwrite. The Length of 'IMDB_[EN][HTTPS].psf=' is 21.
opPoster = 87-21;
opTitle = 23-21;
opOrigTitle = 24-21;
opAKA = 25-21;
opYear = 26-21;
opGenre = 68-21;
opCategory = 70-21;
opDirector = 76-21;
opProducer = 79-21;
opWriter = 77-21;
opComposer = 78-21;
opActors = 75-21;
opCountry = 69-21;
opOrigLang = 44-21;
opStudio = 73-21;
opMPAA = 27-21;
opORating = 32-21;
opTags = 74-21;
opRDate = 40-21;
opBudget = 41-21;
opMoney = 42-21;
opTagline = 35-21;
opDescription = 36-21;
opLength = 46-21;
opAwards = 85-21;
opConnections = 84-21;
opFeatures = 55-21;
opEpisodes = 92-21;
and I also corrected part of the code that it relates to in ParsePage function:
//Parse with the Person URL 'smNormal'------------------------------------------------------------------------------------
If (Mode=smNormal) Then Begin
//Get the script Overwrite Options saved in pvdconf.ini (Remember that PVD only save the options on exit)
//0=Do nothing,1=Set if Empty,2=Overwrite
PVDConfigOptions := TextBetWeenFirst(FileToString(GetAppPath+'pvdconf.ini'), SCRIPT_NAME + '.psf=', Chr(13));
LogMessage('PVDConfigOptions: ' + PVDConfigOptions);
so now using
PVDConfigOptions makes sense.Some of those opXXX were already applied in existing scripts, but...
I learned that they will not work after setting them as one might expect before PVD is restarted!I could bet very few users of the very few that probably left are aware of this.
Since we are now using multiple pages download which takes probably most of the time to process the record, I'm looking for ways to optimize the process, so using these would be perfect down to the case when some field is set to "none" we wouldn't even download that page (for example not to download "awards" page at all if "Awards" is set to "None" - blank checkbox in PVD).That would dramatically speed up the process.But it has it's cons, and those are huge ones I'd say. Imagine user doesn't want to refresh or add Awards at all, and sets Awards to "None" in PVD, downloads and populate rest of the data for the record(s) and exits PVD. After few days user gets back to PVD, wanting to add new record. User opens PVD, downloads the data for the new record, only to see awards weren't added. After probably first trying several times to download, and visiting site to ensure record has awards, next thing user finally probably does is to check if the field is set to "None", and yes it was "None". User checks it to "Overwrite" or "Set If Empty", and tries to download data again.
But - nothing happens again! Because PARSING WILL NOT HAPPEN!Will user recall that it is needed to restart PVD now in order "Overwrite" or "Set If Empty" to take effect, or the user would rather think that script "isn't working once again"? I could bet on the latter one!So, this is very usefull tool but at the same time
very dangerous tool WHEN IT IS SET TO "NONE" and I'm not clear whether to use it or not, for optimizing the process. Even already applied PvdConfigOptions (for photo in both scripts and AKA, Credit, MPAA and Features in movie script) are already questionable regarding this... I didn't try, but most probably as it is the case in the current working scripts, none of those would work if before starting PVD they woud be set to "None" on the last exit, regardless the fact we set it to "Overwrite" upon most recent PVD start!!!
Luckily enough in the current
state PvdConfigOptions didn't work at all since we had different script names, and in the script this line remained in its initial state:PVDConfigOptions:=TextBetWeenFirst(FileToString(GetAppPath+'pvdconf.ini'),'IMDB_[EN][HTTPS].psf=',Chr(13));
so using it while script name is differen
t than IMDB_[EN][HTTPS].psf was even wrong and misleading if there was entry for IMDB_[EN][HTTPS].psf in pvdconfig.ini while we were using script with different name (because the script with the different name for the PVDConfigOptions would take the values that were set for the IMDB_[EN][HTTPS].psf God knows when last time), or at best it is actually useless if we don't have an entry for IMDB_[EN][HTTPS].psf in pvdconfig.ini (because PVDConfigOptions will always be empty then, thus it will always be <>0 in If (GET_FULL_AKA and Not(USE_SAVED_PVDCONFIG and (Copy(PVDConfigOptions,opAKA,1)='0'))) Then Begin...).Or people were/are aware of this all and I'm just now discovering "warm water"? If that's the case, for which I hope, than I will be more than ha
ppy to apply it immediately and without a question!Your thoughts?