Personal Video Database
English => Support => Topic started by: afrocuban on January 04, 2024, 03:36:56 pm
-
Hello Ivek. In a new _2b script. metascore import field doesn't work. But, more importantly, when updating older PVD movie entries where I had metascore imported from the times it worked, now when I update with _2b script, the field is overwritten with empty/zero value. How to prevent this please?
-
Hello Ivek. In a new _2b script. metascore import field doesn't work. But, more importantly, when updating older PVD movie entries where I had metascore imported from the times it worked, now when I update with _2b script, the field is overwritten with empty/zero value. How to prevent this please?
Is this an additional score field or a custom Metascore field. Then I will see what can be done about this problem.
-
Custom field, here:
//Get ~Metascore~
EndPos:=Pos('</span></span><span class="label"><span class="metacritic-score-label">Metascore</span></span></span></a></li></ul>',HTML);
if EndPos>0 then begin
curPos:=PrevPos('">',HTML,EndPos)+Length('">');
EndPos:=PosFrom('</span></span><span class="label"><span class="metacritic-score-label">Metascore</span></span></span></a></li></ul>',HTML,curPos)+2;
//ItemValue:=RemoveTags(Copy(HTML,curPos,endPos-curPos),false);
ItemValue:=Copy(HTML,curPos,endPos-curPos);
LogMessage(' Get result Metascore 0:'+ItemValue+'||');
ItemValue:=StringReplace(ItemValue,'0</',',0',True,False,True);
ItemValue:=StringReplace(ItemValue,'1</',',1',True,False,True);
ItemValue:=StringReplace(ItemValue,'2</',',2',True,False,True);
ItemValue:=StringReplace(ItemValue,'3</',',3',True,False,True);
ItemValue:=StringReplace(ItemValue,'4</',',4',True,False,True);
ItemValue:=StringReplace(ItemValue,'5</',',5',True,False,True);
ItemValue:=StringReplace(ItemValue,'6</',',6',True,False,True);
ItemValue:=StringReplace(ItemValue,'7</',',7',True,False,True);
ItemValue:=StringReplace(ItemValue,'8</',',8',True,False,True);
ItemValue:=StringReplace(ItemValue,'9</',',9',True,False,True);
//curPos:=Pos('var ue_t0=ue_t0',ItemValue); //WEB_SPECIFIC.
//If 0<curPos then ItemValue:=Copy(ItemValue,0,curPos-1);
if ItemValue <> '' then AddCustomFieldValueByName('Metascore',FloatToStr((StrToFloat(ItemValue) * 1)));
if ItemValue <> '' then LogMessage(' Get result Metascore (CF~Metascore~):'+ItemValue+'||');
End;
//(*
LogMessage(#13+'');
Thank you in advance.
-
It doesn't delete anything on my old entries. Even otherwise, metascore import works without problems. In this case, unfortunately, I cannot help you solve the problem (obviously something is wrong or there is an error on your side). The code for importing metascore information has no error.
-
Thanks! This is what is weird.
For example movie
https://www.imdb.com/title/tt5827916/ (https://www.imdb.com/title/tt5827916/)
For this movie, metascore is 7.8 (that is 78)
When run in debug mode this is what I found in a log file for metascore part:
(1/6/2024 12:14:13 AM) Get result Tv Mode01:
2019, PG-13, 2h 54m||
(1/6/2024 12:14:13 AM) Get result Metascore 0:78</||
(1/6/2024 12:14:13 AM) Get result Metascore (CF~Metascore~):7,8||
(1/6/2024 12:14:13 AM)
(1/6/2024 12:14:13 AM)
(1/6/2024 12:14:13 AM) AVOIDED ALWAYS1: Get result "Plot_summary" as ~comment~:
So, it finds it properly, but doesn't parse it to base? Any clue now?
-
In the PVD settings, in the Miscellaneous section, set (check this box) Allow editing rating in view mode. Then you will be able to edit the Metascore field or all rating fields in the database in view mode. Thus, it is not necessary to open and edit a certain movie entry in the database every time and then save it.
Once you have this set up, simply set the Mtascore rating to zero and then update the movie entry again to see if it will now add the metascore rating to that field.
-
Thank you Ivek, but that didn't help, unfortunately. It was already checked. Re-did everything but no luck. A great mystery...
-
Maybe the IMDB_[EN][HTTPS]_TEST_Metascore script will just solve the problems.
IMDB_[EN][HTTPS]_TEST_Metascore script is attached.
-
Wow! How great you noticed it was about Regional format of Windows, that is decimal! Splendid, thanks! It works flawlessly. I have changed original script, so you don't need to upload it.
-
Wow! How great you noticed it was about Regional format of Windows, that is decimal! Splendid, thanks! It works flawlessly. I have changed original script, so you don't need to upload it.
Great. It's good to hear that the problem is now solved.