tboothman / imdbphp

PHP library for retrieving film and tv information from IMDb
251 stars 84 forks source link

spouse() #265

Closed Thomasdouscha closed 2 years ago

Thomasdouscha commented 2 years ago

Hello,

Person object spouse() function is not working. It doesn't get data of spouse.

Thanks

Thomas

Thomasdouscha commented 2 years ago

So is it not important?

duck7000 commented 2 years ago

Well personally i don't use that method.

And i don't think it will ever be fixed here, there is not been any reaction in months and the last commit is from October 2021.. At least i'm not going to do any more work to this repo, sorry.

Thomasdouscha commented 2 years ago

I really really sorry to hear that. I wanna know whats happening here. Nobody is going to support this repo anymore? I hope it is not likr this. Thanks four your answer duck7000

duck7000 commented 2 years ago

I really don't know I created several PR requests here, a few are communicated about but that stopped suddenly months ago All other PR i didn't get a single response on so i took a drastic step and removed them all.

That doesn't mean that the maintainers are not going to do any work on this and i sure hope they will continue.

So yes, i'm in the same "boat" as you: I too want to know whats happening here..?

Thomasdouscha commented 2 years ago

Maybe "drastic step and removed them all" is not way for handling the issues. Now it's hard times for everyone, even for the whole world. Pandemic, the prospect of economic crises and wars, large and small, seriously affects people's order and life. Maybe they were also affected by these problems. I hope they are fine and all is well. You did your best, you worked hard. I think it would be better if you put those PRs you removed back in it. Of course, you know better about what to do. I thank you for your efforts. I hope your efforts continue.

duck7000 commented 2 years ago

I understand your concerns but for me there is no point in putting the PR's back if non of the maintainers are paying attention to them? Johan Eklund is the only one that did responded, communicated well about it and gave good tips. But he doesn't, for reasons i don't know, respond any more in months.

I'm doing all the work, for bugs and rewrites of some methods, but if there is no response, or at least not anymore, there is no point. I can't add those pr myself other than in my own fork.

Honestly i do want to put those PR's back if i would know that the maintainers are willing to even look at it. In one case tboothman asked for help, I did respond to that request, even with a PR but he not even bothers to give a response to the issue he created, not once. I don't understand this and makes me frustrated

duck7000 commented 2 years ago

I added back a few PR's And now we have to wait and see

Thomasdouscha commented 2 years ago

It is better way, thanks

duck7000 commented 2 years ago

@Thomasdouscha Can you give me a example movie en witch data this method should return? I'm trying to fix it for you but i don't have a clue what data should returned.

Thomasdouscha commented 2 years ago

I used method: $person->spouse(); Also you can looking for demo directory person.php of spouse part. My code is very similar. Let you check it please.

duck7000 commented 2 years ago

I used spouse method, it returns nothing, but what should it return is the question? It should include name and imdbid but what about the rest?

Thomasdouscha commented 2 years ago

mate name imdb_id married date if yes divorced date and children count. I will check my code later.

Thomasdouscha commented 2 years ago

image

Charles Bronson from imdb page.

duck7000 commented 2 years ago

Ah oke that is de info i was looking for, thanks! I will give it a try, no guaranties

Thomasdouscha commented 2 years ago

Data looks like as past. I think because of small change it does not work. May be to fix it easy or not. Thanks

duck7000 commented 2 years ago

well it is not an easy fix, and i doubt it ever has been functioned at all. This method is full of code that can't be working on the current bio page. That page has been changed a lot if the old code actually did work. I'm still trying though

Thomasdouscha commented 2 years ago

I hope that will be sucess.

duck7000 commented 2 years ago

Still working on this, it may take some time, i have more PR's that i'm working on. And that is a good thing! Tboothman has already reviewed 2 off them and eventually approved! I'm very happy about that!

Thomasdouscha commented 2 years ago

It's good!

duck7000 commented 2 years ago

I finally managed to get it fixed (i hope) and made a PR so @Thomasdouscha check it out and let me know if there are any problems left.

Thomasdouscha commented 2 years ago

Thanks a lot. i will test it tomorrow!

duck7000 commented 2 years ago

@Thomasdouscha i'll assume you tested it and it works?

Thomasdouscha commented 2 years ago

No it does not

duck7000 commented 2 years ago

what is the problem?

duck7000 commented 2 years ago

I'm getting fine results with a few persons like jack nicholson, peter fonda, charles bronson etc

This is from Hayao Miyazaki https://www.imdb.com/name/nm0594503/


> array(1) {
>   [0]=>
>   array(6) {
>     ["imdb"]=>
>     string(7) "1088112"
>     ["name"]=>
>     string(10) "Akemi Ôta"
>     ["from"]=>
>     array(4) {
>       ["day"]=>
>       string(0) ""
>       ["month"]=>
>       string(7) "October"
>       ["mon"]=>
>       string(2) "10"
>       ["year"]=>
>       string(4) "1965"
>     }
>     ["to"]=>
>     array(4) {
>       ["day"]=>
>       string(0) ""
>       ["month"]=>
>       string(0) ""
>       ["mon"]=>
>       string(0) ""
>       ["year"]=>
>       string(0) ""
>     }
>     ["comment"]=>
>     string(0) ""
>     ["children"]=>
>     string(1) "2"
>   }
> }

The output array is the same, so i don't understand.

Can you give me a example person that does not work?

Thomasdouscha commented 2 years ago

image

İt is simply return empty. When i update the person data there is no spouse information. what about person of demo in imdbphp? is it working?

Thomasdouscha commented 2 years ago

image my database picture

Thomasdouscha commented 2 years ago

sorry i did not add your pull request, i will add and try again

Thomasdouscha commented 2 years ago

image It works !!! I will try 5-6 six other person

Thomasdouscha commented 2 years ago

But wife name there is not. Marriage dates and children and marital status ok. JUst wife names ?

Thomasdouscha commented 2 years ago

image as you see in database there aren't wive names!

Thomasdouscha commented 2 years ago

I tested some persons and the result: Wife name return is empty! other datas are ok!

duck7000 commented 2 years ago

Wow.. slow down a bit and please stop using so much ! it feels like shouting

First i didn't touch anything in the demo pages so i don't know if that will work.

And second i think there is something wrong in your application? Because i get all info from charles bronson? This is my output from method spouse() in person.php and i call it like this:

$imdb = new \Imdb\Person('0000314');
$results = $imdb->spouse();
var_dump($results);

array(3) { [0]=> array(6) { ["imdb"]=> string(7) "0917331" ["name"]=> string(9) "Kim Weeks" ["from"]=> array(4) { ["day"]=> string(2) "27" ["month"]=> string(8) "December" ["mon"]=> string(2) "12" ["year"]=> string(4) "1998" } ["to"]=> array(4) { ["day"]=> string(2) "30" ["month"]=> string(6) "August" ["mon"]=> string(2) "08" ["year"]=> string(4) "2003" } ["comment"]=> string(9) "his death" ["children"]=> string(0) "" } [1]=> array(6) { ["imdb"]=> string(7) "0409866" ["name"]=> string(12) "Jill Ireland" ["from"]=> array(4) { ["day"]=> string(1) "5" ["month"]=> string(7) "October" ["mon"]=> string(2) "10" ["year"]=> string(4) "1968" } ["to"]=> array(4) { ["day"]=> string(2) "18" ["month"]=> string(3) "May" ["mon"]=> string(2) "05" ["year"]=> string(4) "1990" } ["comment"]=> string(9) "her death" ["children"]=> string(1) "1" } [2]=> array(6) { ["imdb"]=> string(0) "" ["name"]=> string(15) "Harriet Tendler" ["from"]=> array(4) { ["day"]=> string(2) "30" ["month"]=> string(9) "September" ["mon"]=> string(2) "09" ["year"]=> string(4) "1949" } ["to"]=> array(4) { ["day"]=> string(0) "" ["month"]=> string(0) "" ["mon"]=> string(0) "" ["year"]=> string(4) "1967" } ["comment"]=> string(8) "divorced" ["children"]=> string(1) "2" } }

I notice that you use, i guess, turkisch language? I only tested this with the standard English language in imdbphp config. I don't know if that makes any difference though

Thomasdouscha commented 2 years ago

may be i did not get fully true your person file. My code is simple ->spouse() and there is no data in database. Can you send me person.php file?

Thomasdouscha commented 2 years ago

no it is not about turkish i can get everything except this wife name.

duck7000 commented 2 years ago

Just replace the existing method with the one from my PR, nothing else changed or copy the whole person.php from my PR

Thomasdouscha commented 2 years ago

Thanks a lot. There is no problem! It works very well! image

Good job!

duck7000 commented 2 years ago

Thanks, glad it works. It was a pain in the ass to get it working. Now we have to hope this will get merged.

Thomasdouscha commented 2 years ago

There is one bug! If the person has not spouse data for example single never married and child , spouse() has crashed. Otherwise i mean the person has spouse data , it works perfectly

Thomasdouscha commented 2 years ago

temprorily i fixed "try{ $spouse = $imdbperson->spouse();}catch (\Exception $e) {$spouse=""; }" like this until you fix it.

duck7000 commented 2 years ago

Mm I'm not surprised that there still are bugs

Can you give me a example of where it did not work, your description is not clear enough. And what do you mean by "crash"?

duck7000 commented 2 years ago

With this person: David Bennent (0000908) i get empty array just like it suppose to do? This person has no spouse data available, i did check that, but there may be other circumstances that i didn't check perhaps

array(0) {
}
Thomasdouscha commented 2 years ago

try{ $spouse = $imdbperson->spouse();}catch (\Exception $e) {$spouse=""; } what crash means this code shows i think. spouse() funtion gives error some cases. I will give you some persons as exsamples. https://www.imdb.com/name/nm2956530 https://www.imdb.com/name/nm8033456 these persons doesn't have spouse history. So with kind of persons spouse func should gives return null or "" soethings empty. but it does not give it. That is bug in my oppinion so as a result in such cases code broken and gives error.

duck7000 commented 2 years ago

Ah okay you're right, in the above cases there is no family part on the bio page, so there will be this error: Trying to get property 'nodeValue' of non-object

I will try to fix that

Thomasdouscha commented 2 years ago

Thanks a lot

duck7000 commented 2 years ago

It is fixed in PR, test it out please

Thomasdouscha commented 2 years ago

Great! i will remove that code try{ $spouse = $imdbperson->spouse();}catch (\Exception $e) {$spouse=""; } and will test now

Thomasdouscha commented 2 years ago

and i need to have revised person.php

Sorry i dont use git and i dont know how to do.

duck7000 commented 2 years ago

Is it so hard to just copy the whole method from PR and paste it in your file?

Thomasdouscha commented 2 years ago

Ya you are right. I should learn how to do with git. now it is okay it works perfectly