OK, now I understand what and how the thing looked like. I'm sorry, last night I did not 100% of the stuff because I night vision a little teases (I see worse because the eyes are too tired).
OK, now could be the right solution:
not this oneHello Ivek23,
Is there a way NOT to import year as a part of Title, just Title?
Thank you in advance.
Why?
That's already in the script is done so that the Title-free year in the normal field as well as in the "Title" custom field.
//~mfTitle~ or ~Title~
curPos := Pos('<title>', HTML) + Length('<title>');
if Pos(') - ', HTML) > 0 then
endPos := PosFrom(') - ', HTML, curPos)-6
else
endPos := PosFrom(' - | ', HTML, curPos);
TmpStr1 := Copy(HTML, curPos, endPos - curPos);
AddFieldValue(mfTitle, TmpStr1);
AddFieldValue(mfOrigTitle, TmpStr1);
Title := Copy(HTML, curPos, endPos - curPos);
Title1 := Copy(HTML, curPos, endPos - curPos);
if Pos(') - ', HTML) > 0 then
endPos := PosFrom(') - ', HTML, curPos)+1
else
endPos := PosFrom(' - | ', HTML, curPos);
TmpStr1 := Copy(HTML, curPos, endPos - curPos);
AddCustomFieldValueByName('Title', TmpStr1);
The year has also done the same way as Title.
// ~mfYear~ or ~Year~
curPos := Pos('<span class="release-year">', HTML) + Length('<span class="release-year">');
if Pos('</span> </h2>', HTML) > 0 then
endPos := PosFrom('</span> </h2>', HTML, curPos);
TmpStr2 := Copy(HTML, curPos, endPos - curPos);
if TmpStr2 = '0' then
TmpStr2 := '';
TmpStr2 := StringReplace(TmpStr2, '(', '', True, True, True);
TmpStr2 := StringReplace(TmpStr2, ')', '', True, True, True);
AddFieldValue(mfYear, TmpStr2);
AddCustomFieldValueByName('Year', TmpStr2);
if TmpStr2 = '' then
TmpStr2 := 'year unknown';
LogMessage(' Parsing: ' + TmpStr1 + '(' + TmpStr2 + ')');
If this is not what we would like, then please give an example to make it easier to explain and help.
even this does notTry like this:
AddCustomFieldValueByName('Title', TmpStr1 + '(' + TmpStr2 + ')');
This is how it should be in the script:
//~mfTitle~ or ~Title~
curPos := Pos('<title>', HTML) + Length('<title>');
if Pos(') - ', HTML) > 0 then
endPos := PosFrom(') - ', HTML, curPos)-6
else
endPos := PosFrom(' - | ', HTML, curPos);
TmpStr1 := Copy(HTML, curPos, endPos - curPos);
AddFieldValue(mfTitle, TmpStr1);
AddFieldValue(mfOrigTitle, TmpStr1);
Title := Copy(HTML, curPos, endPos - curPos);
Title1 := Copy(HTML, curPos, endPos - curPos);
if Pos(') - ', HTML) > 0 then
endPos := PosFrom(') - ', HTML, curPos)+1
else
endPos := PosFrom(' - | ', HTML, curPos);
TmpStr1 := Copy(HTML, curPos, endPos - curPos);
//AddCustomFieldValueByName('Title', TmpStr1);
.
.
.
// ~mfYear~ or ~Year~
curPos := Pos('<span class="release-year">', HTML) + Length('<span class="release-year">');
if Pos('</span> </h2>', HTML) > 0 then
endPos := PosFrom('</span> </h2>', HTML, curPos);
TmpStr2 := Copy(HTML, curPos, endPos - curPos);
if TmpStr2 = '0' then
TmpStr2 := '';
TmpStr2 := StringReplace(TmpStr2, '(', '', True, True, True);
TmpStr2 := StringReplace(TmpStr2, ')', '', True, True, True);
AddFieldValue(mfYear, TmpStr2);
// AddCustomFieldValueByName('Year', TmpStr2);
if TmpStr2 = '' then
TmpStr2 := 'year unknown';
LogMessage(' Parsing: ' + TmpStr1 + '(' + TmpStr2 + ')');
AddCustomFieldValueByName('Title', TmpStr1 + '(' + TmpStr2 + ')');
I did not tested, but it should work.
but this should however be fine //~mfTitle~ or ~Title~
curPos := Pos('<title>', HTML) + Length('<title>');
if Pos(') - ', HTML) > 0 then
endPos := PosFrom(') - ', HTML, curPos)-6
else
endPos := PosFrom(' - | ', HTML, curPos);
TmpStr1 := Copy(HTML, curPos, endPos - curPos);
AddFieldValue(mfTitle, TmpStr1);
AddFieldValue(mfOrigTitle, TmpStr1);
Title := Copy(HTML, curPos, endPos - curPos);
Title1 := Copy(HTML, curPos, endPos - curPos);
// if Pos(') - ', HTML) > 0 then
// endPos := PosFrom(') - ', HTML, curPos)+1
// else
// endPos := PosFrom(' - | ', HTML, curPos);
// TmpStr1 := Copy(HTML, curPos, endPos - curPos);
AddCustomFieldValueByName('Title', TmpStr1);
This is how it should be in the script:Try like this:
AddCustomFieldValueByName('Title', TmpStr1 + '(' + TmpStr2 + ')');
This is how it should be in the script:
//~mfTitle~ or ~Title~
curPos := Pos('<title>', HTML) + Length('<title>');
if Pos(') - ', HTML) > 0 then
endPos := PosFrom(') - ', HTML, curPos)-6
else
endPos := PosFrom(' - | ', HTML, curPos);
TmpStr1 := Copy(HTML, curPos, endPos - curPos);
AddFieldValue(mfTitle, TmpStr1);
AddFieldValue(mfOrigTitle, TmpStr1);
Title := Copy(HTML, curPos, endPos - curPos);
Title1 := Copy(HTML, curPos, endPos - curPos);
// if Pos(') - ', HTML) > 0 then
// endPos := PosFrom(') - ', HTML, curPos)+1
// else
// endPos := PosFrom(' - | ', HTML, curPos);
// TmpStr1 := Copy(HTML, curPos, endPos - curPos);
AddCustomFieldValueByName('Title', TmpStr1);
.
.
.
// ~mfYear~ or ~Year~
curPos := Pos('<span class="release-year">', HTML) + Length('<span class="release-year">');
if Pos('</span> </h2>', HTML) > 0 then
endPos := PosFrom('</span> </h2>', HTML, curPos);
TmpStr2 := Copy(HTML, curPos, endPos - curPos);
if TmpStr2 = '0' then
TmpStr2 := '';
TmpStr2 := StringReplace(TmpStr2, '(', '', True, True, True);
TmpStr2 := StringReplace(TmpStr2, ')', '', True, True, True);
AddFieldValue(mfYear, TmpStr2);
// AddCustomFieldValueByName('Year', TmpStr2);
if TmpStr2 = '' then
TmpStr2 := 'year unknown';
LogMessage(' Parsing: ' + TmpStr1 + '(' + TmpStr2 + ')');