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

Covers not showing, URL is different #2637

Open
tehsu opened this issue Sep 19, 2019 · 15 comments
Open

Covers not showing, URL is different #2637

tehsu opened this issue Sep 19, 2019 · 15 comments

Comments

@tehsu
Copy link

tehsu commented Sep 19, 2019

###Expected behaviour
Covers should appear

###Actual behaviour
Covers do not show up, the URL for the cover is /covers/movies/06105098-cover.jpg however, if I was to change the URL to /covers/movies/6105098-cover.jpg it works. Is there a reason why the URL doesn't match

###Steps to reproduce the behaviour
Fresh install on Debian

@DariusIII
Copy link
Contributor

Issue is because of the zerofilled imdbid column in releases table.

@brewmarsh
Copy link

This issue seems to persist even after the 10-07-2019 release. I just reinstalled clean and this issue is still happening.

@Bart39
Copy link
Contributor

Bart39 commented Oct 17, 2019

The new issue is that TRIM(LEADING ‘0’ FROM ..... will remove ALL leading zero’s.
Some imdbid’s genuinely begin with 0 (as in stored value begins 00)

E.g. https://www.imdb.com/title/tt0103262/

@Bart39
Copy link
Contributor

Bart39 commented Oct 17, 2019

Will need to use something like
CASE WHEN m.imdbid like ‘00%’ then RIGHT(m.imdbid, LENGTH(m.imdbid) -1) ELSE TRIM(LEADING ‘0’ FROM m.imdbid) END AS imdbid

@Wally73
Copy link
Contributor

Wally73 commented Oct 17, 2019

to fix it completely there shouldn't be zerofill at all on numbers with 7 or 8 characters already

@DariusIII
Copy link
Contributor

ImdbId column should be varchar and all issues would be solved, no zerofill, no removal of anything, store the value as it should be.

@brewmarsh
Copy link

Is there an easy way to make this change to an existing install? I'm not a SQL expert.

@niel
Copy link
Contributor

niel commented Oct 18, 2019

@brewmarsh So long as you're comfortable editing the source files... .../nzedb/Movies.php line 314 needs to be changed. Currently I'm thinking the following will work, but I've not been able to test it with running code yet - works fine in a simple SELECT with MySQL Workbench.

IF(m.imdbid LIKE '0%', RIGHT(m.imdbid, LENGTH(m.imdbid) - 1), m.imdbid) as imdbid,

@brewmarsh
Copy link

OK, the code seems to compile.

I'm getting errors from the "getMovieCovers.php" script still:

Fetching IMDB info from TMDB using IMDB ID: 00056869
IMDb Found The Birds
WTF, no URL!!

This seems to be using a valid IMDB ID now, so that's good.

@Bart39
Copy link
Contributor

Bart39 commented Oct 18, 2019

not quite - releases.imdbid also has the leading zero so:
LEFT JOIN releases r USING (imdbid) (line 317)
will never match

EDIT: the rest of the function also needs a huge rewrite as there are multiple instances where the "trimmed" imdbid is matched against the original (causing no matching)

niel added a commit that referenced this issue Oct 19, 2019
…hat covers and other image files are saved with the correctly padded id. Issue #2637.
@niel
Copy link
Contributor

niel commented Oct 19, 2019

@Bart39 JOINS shouldn't be affected by the leading zeroes. The field is an integer and the zerofill is simply a formatting option that doesn't change the value in any way.

@JReming85
Copy link
Contributor

JReming85 commented Oct 23, 2019

I solved this by going into the themes movies.tpl and changing the movie cover to
{ltrim($result.imdbid,0)}-cover.jpg

(substr($result.imdbid,1)}-cover.jpg
would also work by just removing the 1st char

Basically let php fix it on display, the extra 0 does not prevent the imdb site from knowing what movie you want.

Upcoming PR with my theme fixes/tweaks/additions should be made soon

@niel
Copy link
Contributor

niel commented Oct 24, 2019

@JReming85, dev branch has the beginnings of a fix for this that will work across all themes (I believe). It changes the saving of the image files to add the expected zero(es) in the name. There will also be a separate script to fix an currnetly existing files to the same format.

@niel niel closed this as completed Oct 24, 2019
@niel niel reopened this Oct 24, 2019
@nductiv
Copy link

nductiv commented Dec 30, 2019

IMDB Covers now hosted by Amazon. Changed server to https://m.media-amazon.com

This fixes: WTF, no URL!!

In nZEDb/nzedb/Movie.php change line 955 from:
'cover' => '/<link rel=\'image_src\' href="(http:\/\/ia\.media-imdb\.com.+\.jpg)">/'

to:
'cover' => '/<link rel=\'image_src\' href="(https:\/\/m\.media-amazon\.com.+\.jpg)">/'

@niel
Copy link
Contributor

niel commented Dec 31, 2019

Updated the url on dev branch.

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

8 participants