Author Topic: Year, Country, Duration for in the movie or people script  (Read 7472 times)

0 Members and 1 Guest are viewing this topic.

Online Ivek23

  • Global Moderator
  • *****
  • Posts: 2700
    • View Profile
Year, Country, Duration for in the movie or people script
« on: December 13, 2011, 06:47:37 pm »
Sorry if already posted the same topic.

I help edit the script (for people), but they are certain problems about data transfer for the year.

I know it helps me a part of this code for example 
Code: [Select]
if Pos('1978', TmpStr) > 0 then TmpStr1 := TmpStr1 + 'b. 1978';
TmpStr := StringReplace(TmpStr, '1978', '', true, true, true);
 
but it is quite time-consuming work by Whereas this piece of code re-need to write at least a hundred times.
It is necessary to insert all years between 1900 and 2000 .
I wonder if this is possible to edit in a different and more simple way.
« Last Edit: January 14, 2012, 10:06:08 am by Ivek23 »
Ivek23
Win 10 64bit (32bit)   PVD v0.9.9.21, PVD v1.0.2.7, PVD v1.0.2.7 + MOD


Offline nostra

  • Administrator
  • *****
  • Posts: 2852
    • View Profile
    • Personal Video Database
Re: Year for in the people script
« Reply #1 on: December 15, 2011, 01:30:46 am »
I do not understand the question :/
Do you need to find years in the source code of a web page or do you need to produce years from 1900 to 2000 for some other purpose?
Gentlemen, you can’t fight in here! This is the War Room!

Online Ivek23

  • Global Moderator
  • *****
  • Posts: 2700
    • View Profile
Re: Year, Country, Duration for in the movie or people script
« Reply #2 on: January 15, 2012, 07:46:29 am »
I do not understand the question :/
Do you need to find years in the source code of a web page or do you need to produce years from 1900 to 2000 for some other purpose?

For both mentioned.

It would need to function of year for birthday and death fields.
When it appears in the info data for example, such data   b. 1911   and  d. 1986  then transferred to the above mentioned fields.
Ivek23
Win 10 64bit (32bit)   PVD v0.9.9.21, PVD v1.0.2.7, PVD v1.0.2.7 + MOD


Online Ivek23

  • Global Moderator
  • *****
  • Posts: 2700
    • View Profile
Re: Year, Country, Duration for in the movie or people script
« Reply #3 on: January 15, 2012, 07:46:53 am »
The question of different records for the length of the movies:

Example 1:
The source code the length of the movie the web site:
Code: [Select]
<tr><td valign="top">Notes: </td><td width="100%" class="notes">72 mins</td>or
Code: [Select]
<tr><td valign="top">Notes: </td><td width="100%" class="notes">72 minutes</td>or
Code: [Select]
<tr><td valign="top">Notes: </td><td width="100%" class="notes">1 hr 12 mins</td>or
Code: [Select]
<tr><td valign="top">Notes: </td><td width="100%" class="notes">Doll Prod., 72 mins.</td>or
Code: [Select]
<tr><td valign="top">Notes: </td><td width="100%" class="notes">Doll Prod., 1 hr 12 mins.</td>
Example 2:
The source code the length of the movie the web site:
Code: [Select]
<tr><td valign="top">Notes: </td><td width="100%" class="notes">112 mins</td>or
Code: [Select]
<tr><td valign="top">Notes: </td><td width="100%" class="notes">112 minutes</td>or
Code: [Select]
<tr><td valign="top">Notes: </td><td width="100%" class="notes">1 hr 52 mins</td>or
Code: [Select]
<tr><td valign="top">Notes: </td><td width="100%" class="notes">Video, 112 mins.</td>or
Code: [Select]
<tr><td valign="top">Notes: </td><td width="100%" class="notes">Video, 1 hr 52 mins.</td>
This code
Code: [Select]
//Duration
curpos := Pos('<td valign="top">Notes: ' , HTML);
LogMessage('getting durations')
EndPos := PosFrom(' min', HTML, curPos);
curPos := EndPos - 2;
Tmp := IntToStr(StrToInt(Copy(HTML, curPos, 2)));
LogMessage('Duration: ' + Tmp);
If Tmp <> '' then AddFieldValue(mfDuration, Tmp);

in example 1 works only for first source code, the second source code and for the fourth source code, in example 2 works only for first source code, the second source code and for the fourth source code, but there appears only what is in minutes.
I wonder or it may be in one piece of code, if it is of course possible to do.

Ivek23
Win 10 64bit (32bit)   PVD v0.9.9.21, PVD v1.0.2.7, PVD v1.0.2.7 + MOD


 

anything