Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

tt0490773 causes Undefined offset: 0 in Title.php:967 #155

Closed
vlahde opened this issue Nov 26, 2018 · 20 comments
Closed

tt0490773 causes Undefined offset: 0 in Title.php:967 #155

vlahde opened this issue Nov 26, 2018 · 20 comments

Comments

@vlahde
Copy link

vlahde commented Nov 26, 2018

Full error report:

Stack trace:
#0 E:\Laravel\videospace\vendor\imdbphp\imdbphp\src\Imdb\Title.php(967): Illuminate\Foundation\Bootstrap\HandleExceptions->handleError(8, 'Undefined offse...', 'E:\\Laravel\\vide...', 967, Array)
#1 E:\Laravel\videospace\app\lib\Imdb.php(70): Imdb\Title->alsoknow()
#2 E:\Laravel\videospace\app\Jobs\ImdbGrab.php(44): App\lib\Imdb->imdbGrab(Object(App\Title), Array, 'overwrite')
#3 [internal function]: App\Jobs\ImdbGrab->handle()
#4 E:\Laravel\videospace\vendor\laravel\framework\src\Illuminate\Container\Container.php(508): call_user_func_array(Array, Array)
#5 E:\Laravel\videospace\vendor\laravel\framework\src\Illuminate\Bus\Dispatcher.php(94): Illuminate\Container\Container->call(Array)
#6 E:\Laravel\videospace\vendor\laravel\framework\src\Illuminate\Pipeline\Pipeline.php(151): Illuminate\Bus\Dispatcher->Illuminate\Bus\{closure}(Object(App\Jobs\ImdbGrab))
#7 E:\Laravel\videospace\vendor\laravel\framework\src\Illuminate\Pipeline\Pipeline.php(104): Illuminate\Pipeline\Pipeline->Illuminate\Pipeline\{closure}(Object(App\Jobs\ImdbGrab))
#8 E:\Laravel\videospace\vendor\laravel\framework\src\Illuminate\Bus\Dispatcher.php(98): Illuminate\Pipeline\Pipeline->then(Object(Closure))
#9 E:\Laravel\videospace\vendor\laravel\framework\src\Illuminate\Queue\CallQueuedHandler.php(47): Illuminate\Bus\Dispatcher->dispatchNow(Object(App\Jobs\ImdbGrab), false)
#10 E:\Laravel\videospace\vendor\laravel\framework\src\Illuminate\Queue\Jobs\Job.php(73): Illuminate\Queue\CallQueuedHandler->call(Object(Illuminate\Queue\Jobs\DatabaseJob), Array)
#11 E:\Laravel\videospace\vendor\laravel\framework\src\Illuminate\Queue\Worker.php(203): Illuminate\Queue\Jobs\Job->fire()
#12 E:\Laravel\videospace\vendor\laravel\framework\src\Illuminate\Queue\Worker.php(153): Illuminate\Queue\Worker->process('database', Object(Illuminate\Queue\Jobs\DatabaseJob), Object(Illuminate\Queue\WorkerOptions))
#13 E:\Laravel\videospace\vendor\laravel\framework\src\Illuminate\Queue\Worker.php(75): Illuminate\Queue\Worker->runNextJob('database', 'default', Object(Illuminate\Queue\WorkerOptions))
#14 E:\Laravel\videospace\vendor\laravel\framework\src\Illuminate\Queue\Console\WorkCommand.php(100): Illuminate\Queue\Worker->daemon('database', 'default', Object(Illuminate\Queue\WorkerOptions))
#15 E:\Laravel\videospace\vendor\laravel\framework\src\Illuminate\Queue\Console\WorkCommand.php(84): Illuminate\Queue\Console\WorkCommand->runWorker('database', 'default')
#16 [internal function]: Illuminate\Queue\Console\WorkCommand->fire()
#17 E:\Laravel\videospace\vendor\laravel\framework\src\Illuminate\Container\Container.php(508): call_user_func_array(Array, Array)
#18 E:\Laravel\videospace\vendor\laravel\framework\src\Illuminate\Console\Command.php(169): Illuminate\Container\Container->call(Array)
#19 E:\Laravel\videospace\vendor\symfony\console\Command\Command.php(261): Illuminate\Console\Command->execute(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
#20 E:\Laravel\videospace\vendor\laravel\framework\src\Illuminate\Console\Command.php(155): Symfony\Component\Console\Command\Command->run(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
#21 E:\Laravel\videospace\vendor\symfony\console\Application.php(817): Illuminate\Console\Command->run(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
#22 E:\Laravel\videospace\vendor\symfony\console\Application.php(185): Symfony\Component\Console\Application->doRunCommand(Object(Illuminate\Queue\Console\WorkCommand), Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
#23 E:\Laravel\videospace\vendor\symfony\console\Application.php(116): Symfony\Component\Console\Application->doRun(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
#24 E:\Laravel\videospace\vendor\laravel\framework\src\Illuminate\Foundation\Console\Kernel.php(121): Symfony\Component\Console\Application->run(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
#25 E:\Laravel\videospace\artisan(35): Illuminate\Foundation\Console\Kernel->handle(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
#26 {main}  ```
@jreklund jreklund changed the title tt0490773 causes Undefined offset: 0 in E:\Laravel\videospace\vendor\imdbphp\imdbphp\src\Imdb\Title.php:967 tt0490773 causes Undefined offset: 0 in Title.php:967 Nov 26, 2018
@jreklund
Copy link
Collaborator

Please test the master release. I think I already solved this in 2c181ba. I don't have any problem with this title at least.

@vlahde
Copy link
Author

vlahde commented Nov 27, 2018

Please test the master release

How to do that? I have 6.1.1 already installed

@jreklund
Copy link
Collaborator

You can download master.zip from here. And then unpack it in your vendor directory.

@duck7000
Copy link
Contributor

Just as info

This is why i suggested to do more releases to fixed problems.
In general people don't use master versions but release versions.

Certainly i don't expect a release for every fix but more often would be appreciated

@vlahde
Copy link
Author

vlahde commented Nov 28, 2018

Sorry, I was in error before. Master release is fixed on Title.php:967 error but akas do not work in Master

@vlahde
Copy link
Author

vlahde commented Nov 28, 2018

fixed this manually by inserting

if(!isset($row[0])) return array();

to Title.php in line 973. Not too fancy but works for now.

@jreklund
Copy link
Collaborator

@duck7000 We know... The latest release where 4 days ago and released after a major breakage. This problem didn't even get raised, so hard to know if it actually affected people. FYI this is a type of comment that will get people to loose interest of contributing. Please raise a separate Issue if you want to discus it further.
@vlahde On what title did you have to add that line? Works great on all tests and some random titles.

@duck7000
Copy link
Contributor

@jreklund Oke fair enough, it wasn't meant to upset anyone, no need to discus it further

@vlahde
Copy link
Author

vlahde commented Nov 29, 2018

I reinstalled release 6.1.1 over master since in master akas field returns always empty. Correct?

On 6.1.1 release title tt0490773 gives Undefined offset: 0 in E:\Laravel\videospace\vendor\imdbphp\imdbphp\src\Imdb\Title.php:967. So the original problem persists. I fixed it by returning empty array if $row[0] is not set in Title.php line 973

@jreklund
Copy link
Collaborator

If that's the case master will fix your problem. It will only return an array in case it's not empty. Will make an release later with it applied.

Before the fix Parsing::table() returned an array like this:
array(array()) and there are nothing in alsoknow() that checks for an empty array inside an array.

@vlahde
Copy link
Author

vlahde commented Nov 29, 2018

yeah but master does not contain fix to empty akas problem

@jreklund
Copy link
Collaborator

It can't fetch something that aren't there:
https://www.imdb.com/title/tt0490773/releaseinfo

@vlahde
Copy link
Author

vlahde commented Nov 29, 2018

I tried the master version on several titles that have akas. Returned empty on all occasions.

@jreklund
Copy link
Collaborator

Can you give me some examples? Everything I feed it works.

@vlahde
Copy link
Author

vlahde commented Nov 29, 2018

for example this did not return any akas for me yesterday when I had the master release installed:
https://www.imdb.com/title/tt0048667/

@jreklund
Copy link
Collaborator

Okey, you must have made an mistake when installing it I'm afraid. I have now published v6.1.2 based on master.

@vlahde
Copy link
Author

vlahde commented Nov 29, 2018

okay, It is possible that I may have made a mistake too. I will try out the new release later, Thanks!

@duck7000
Copy link
Contributor

@vlahde
If you use caching it might effect the results.
If that is the case, clear everything in the cache directory (@jreklund correct?)

@jreklund
Copy link
Collaborator

If the download are made recently and not cached for example 1 month, it won't be any issue as 6.1.1 and 6.1.2 are looking for the same ID.

But if you are grabbing a one month old cache, it won't find it at all. As they constantly are changing the layout to break this library. But this time it should still work. As the ID are the same but with a different tag.

But it's always good to clear /cache/ from time to time.

@vlahde
Copy link
Author

vlahde commented Nov 29, 2018

yes I am aware that cache should be cleared and I did. However could be that I have forgotten to do it in some cases

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants