Author Topic: TITLE UPDATE  (Read 12392 times)

0 Members and 1 Guest are viewing this topic.

Offline nika-model

  • Member
  • *
  • Posts: 5
    • View Profile
TITLE UPDATE
« on: December 09, 2013, 02:52:17 pm »
Hi all,
i want speak about theme "TITLE UPDATE".

Example:
Push Button PLUS(New Item), Set Name ("Test Name Title") and Apply Changes.

Now I have script who take from field URL. Then from this URL extrac Site Name, Movie Name, Release, TITLE.....
When I used

mfTitle := 1;

AddFieldValueXML('title', 'New Name');
or
AddFieldValue(mfTitle, 'New Name');

nothing happen. Title (Name of Movie) is still  ("Test Name Title").
How can I update this Field.

Online Ivek23

  • Global Moderator
  • *****
  • Posts: 2737
    • View Profile
Re: TITLE UPDATE
« Reply #1 on: December 09, 2013, 03:39:49 pm »
Try this, maybe help.

Code: [Select]
procedure ParseMovie(MovieURL : String; HTML : String);
var
curPos, endPos : Integer;
New Name : String;
begin

.
.
.

AddFieldValueXML('title', New Name);
or
AddFieldValue(mfTitle, New Name);
Ivek23
Win 10 64bit (32bit)   PVD v0.9.9.21, PVD v1.0.2.7, PVD v1.0.2.7 + MOD


Offline nika-model

  • Member
  • *
  • Posts: 5
    • View Profile
Re: TITLE UPDATE
« Reply #2 on: December 09, 2013, 03:48:58 pm »
This is the same what I wrote.

variable

newname := 'New Name Movie';


procedure....

Add..

I can update all others fields, but only TITLE I can't.
example:

       desc := TextBetween(HTML, '<p class="para-class t-para">', '</p>', False, iEndPos);
       LogMessage('-------> ParseMovie - Popis : ' + desc);   
       AddFieldValue(mfDescription, desc);   

This works.



Online Ivek23

  • Global Moderator
  • *****
  • Posts: 2737
    • View Profile
Re: TITLE UPDATE
« Reply #3 on: December 09, 2013, 05:55:09 pm »
Try if this will work.

Code: [Select]
AddFieldValueXML('title', New Name);
or
AddFieldValue(mfTitle, New Name);

Change 'title' to 'origtitle' :

Code: [Select]
AddFieldValueXML('origtitle', New Name);
or
AddFieldValue(mfOrigTitle, New Name);

If it does not work, ask for Nostra, if you can help.
« Last Edit: December 09, 2013, 05:59:47 pm by Ivek23 »
Ivek23
Win 10 64bit (32bit)   PVD v0.9.9.21, PVD v1.0.2.7, PVD v1.0.2.7 + MOD


Offline nika-model

  • Member
  • *
  • Posts: 5
    • View Profile
Re: TITLE UPDATE
« Reply #4 on: December 09, 2013, 06:06:50 pm »
 This is a problem. Original Title you can update. But TITLE is a Name for your "Movie Tree" (left side tree). Then you need to know first right title of yours movie and then you can edit with script other fields. Field TITLE can't you updated. This was my problem. I can do Custom Field too. I did it for unformated date. Onetime is Oct 15, 2013 second time is Friday Oct 15, 2013 ... For Year I need only 4 digits from end and unformated date i save to Custom Field.

Field TITLE
for XML      'title'
for AField   '1'

is for nothing. You can't there write data with script. :(


Online Ivek23

  • Global Moderator
  • *****
  • Posts: 2737
    • View Profile
Re: TITLE UPDATE
« Reply #5 on: December 09, 2013, 07:24:05 pm »
For Year I need only 4 digits from end and unformated date i save to Custom Field.

For Year maybe this help:

Code: [Select]
//~mfYear~ or ~Year~

endPos := PosFrom('</span></h1>', HTML, curPos);
curPos := endPos - 5;
TmpStr2 := IntToStr(StrToInt(Copy(HTML, curPos, 4)));

if TmpStr2 = '0' then
TmpStr2 := '';

AddFieldValue(mfYear, TmpStr2);
AddCustomFieldValueByName('Year', TmpStr2);

if TmpStr2 = '' then
TmpStr2 := 'year unknown';

LogMessage(' Parsing: ' + TmpStr1 + '(' + TmpStr2 + ')');

For Date maybe this help:

Code: [Select]
procedure ParseMovie(MovieURL : String; HTML : String);
var
curPos, endPos : Integer;
Date, TmpStr, TmpStr1, TmpStr2, TmpStr3, TmpStr4, TmpStr5 : String;
DateParts: TWideArray;
begin

//Date ~Updated~ (choose simple or verbose version)
Date := DateToStr(CurrentDateTime);
if Date <> '' then
  begin
    ExplodeString(Date, DateParts, '-');
Date := DateParts[2] +'.'+ DateParts[1] +'.'+ DateParts[0];
AddCustomFieldValueByName('Updated', Date);  // Simple
  end else
    LogMessage('date not found');

For the rest a little harder to help.
Ivek23
Win 10 64bit (32bit)   PVD v0.9.9.21, PVD v1.0.2.7, PVD v1.0.2.7 + MOD


Offline nika-model

  • Member
  • *
  • Posts: 5
    • View Profile
Re: TITLE UPDATE
« Reply #6 on: December 10, 2013, 12:47:10 pm »
STOP.
I haven't Problem with another Fields.
ONLY TITLE is my problem. My scripts run well.

ONLY TITLE 

Date was example....

Online Ivek23

  • Global Moderator
  • *****
  • Posts: 2737
    • View Profile
Re: TITLE UPDATE
« Reply #7 on: December 10, 2013, 02:02:31 pm »
ONLY TITLE is my problem. My scripts run well.

ONLY TITLE

For TITLE I can not help it.
Ivek23
Win 10 64bit (32bit)   PVD v0.9.9.21, PVD v1.0.2.7, PVD v1.0.2.7 + MOD


 

anything