Personal Video Database
English => Development => Topic started by: nika-model 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.
-
Try this, maybe help.
procedure ParseMovie(MovieURL : String; HTML : String);
var
curPos, endPos : Integer;
New Name : String;
begin
.
.
.
AddFieldValueXML('title', New Name);
or
AddFieldValue(mfTitle, New Name);
-
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.
-
Try if this will work.
AddFieldValueXML('title', New Name);
or
AddFieldValue(mfTitle, New Name);
Change 'title' to 'origtitle' :
AddFieldValueXML('origtitle', New Name);
or
AddFieldValue(mfOrigTitle, New Name);
If it does not work, ask for Nostra, if you can help.
-
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. :(
-
For Year I need only 4 digits from end and unformated date i save to Custom Field.
For Year maybe this help:
//~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:
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.
-
STOP.
I haven't Problem with another Fields.
ONLY TITLE is my problem. My scripts run well.
ONLY TITLE
Date was example....
-
ONLY TITLE is my problem. My scripts run well.
ONLY TITLE
For TITLE I can not help it.