Template talk:TCMDb title

(Redirected from Template talk:Tcmdb title)
Latest comment: 2 years ago by Superp in topic Links only work in limited regions

Proposal to change the link in the template edit

This follows on from two recent discussions:

The current link does not work for readers based in the Europe Union. It is most likely something to do with GDPR. However, there is an alternative link that redirects to the exact same pages that does work. Here is an example:

I am proposing that the bit in bold in the first link is replaced by the bit in bold in the second link:

  • http://tcmdb.com/title/title.jsp?stid=5764
  • http://www.tcm.turner.com/tcmdb/title/title.jsp?stid=5764

If you are not based in Europe it will be difficult to appreciate the problem, but if we replace the current link with the alternative link then in theory this should restore access for Europeans. Betty Logan (talk) 08:51, 24 August 2018 (UTC)Reply

Sounds reasonable to me! We should aim for the most widely workable versions of templates possible. —Joeyconnick (talk) 05:31, 28 August 2018 (UTC)Reply
I also agree with this proposal. Lord Sjones23 (talk - contributions) 05:59, 28 August 2018 (UTC)Reply

There seems to be unanimous agreement to alter the URL so we may as well just move ahead. The bit that needs to be changed is in the third line down:

http://tcmdb.com/title/title.jsp?stid= -> http://www.tcm.turner.com/tcmdb/title/title.jsp?stid=

You can see the transclusions at https://en.wikipedia.org/wiki/Special:WhatLinksHere/Template:TCMDb_title if you want to make sure it works. Betty Logan (talk) 19:41, 28 August 2018 (UTC)Reply

A link to a diff in the template sandbox that demonstrates the changeJoeyconnick (talk) 21:51, 28 August 2018 (UTC)Reply
  Done — JJMC89(T·C) 03:29, 29 August 2018 (UTC)Reply

The template is not rendering correctly edit

What should be

Movie title at the TCM Movie Database

is rendering as

Movie title at the TCM Movie Database

In other words, the space which should be between the external link icon and "at" is showing up between the title and the icon. It should be an easy fix.

Beyond My Ken (talk) 00:38, 27 November 2018 (UTC)Reply

  Fixed. Nardog (talk) 05:45, 27 November 2018 (UTC)Reply
Thanks. Beyond My Ken (talk) 06:14, 27 November 2018 (UTC)Reply

Template-protected edit request on 6 October 2020 edit

Please incorporate the sandbox code found here to the live template. Per a discussion at WT:FILM here, it was determined that TCMDb has gone away from the url styling http://www.tcm.com/tcmdb/title/title.jsp?stid=ID and is now using http://www.tcm.com/tcmdb/title/ID/film-title. My edits in the sandbox adjust the url in the template, and either taking the PAGENAMEBASE of the Wikipedia article and replacing spaces for "-" to account for the last bit of the url, or a new override field |url_title= to manually add. That new parameter is definitely needed for any title that has an "&" in it (like Thelma & Louise) as the url needs to be "thelma-and-louise". I could not get {{replace}} to switch an "&" to "and", so if the template editor who responds to this knows how to make that happen, we could code that into the template. - Favre1fan93 (talk) 18:33, 6 October 2020 (UTC)Reply

I'll do some testing in the sandbox and see what we can do for you here. Temporarily disabled request. Will be back shortly ... — Martin (MSGJ · talk) 18:46, 6 October 2020 (UTC)Reply
I'm getting a message "Oh no! Turner Classic Movies isn't available in your region." which is making testing impossible for me. I've reopened the request so another template editor can take a look. — Martin (MSGJ · talk) 19:48, 6 October 2020 (UTC)Reply
@MSGJ: Thanks. I did some testing on the testcase page and picking some articles and switching them to the sandbox code and checking in preview mode (not saving) and I believe everything works as it should, but definitely glad to have another check. Even if you can't view Turner Classic Movies, do you have any knowledge to make the template/{{replace}} handle the "&" / "and" situation I mentioned? - Favre1fan93 (talk) 20:06, 6 October 2020 (UTC)Reply
Not well-versed in such things, but look at the url for Thelma & Louise. The URL code is:
  • https://en.wikipedia.org/wiki/Thelma_%26_Louise
Note the "&" symbol is represented in the URL as "%26", so maybe replacing "&" with "%26" would work? P.I. Ellsworth  ed. put'r there 23:05, 6 October 2020 (UTC)Reply
@Paine Ellsworth: I thought that as well, and tried that in this attempt, and sadly it didn't work. Because it's taking the PAGENAMEBASE, not the url, it would see the title as "Thelma & Louse". - Favre1fan93 (talk) 23:22, 6 October 2020 (UTC)Reply
If I do this code {{replace|{{replace|{{PAGENAMEBASE}}|&|and}}| |-}}, which I felt would first replace the "&"s in the title with "and"s and then replace the spaces with "-", the resulting string to append to the url (with Thelma- & Louise as an example) is "Thelma-and#38;-Louise". And having that "#38;" screws up TCMDb's end. - Favre1fan93 (talk) 23:22, 6 October 2020 (UTC)Reply
Have you tried not nesting the Replace templates? that is, have you tried them separately? P.I. Ellsworth  ed. put'r there 23:39, 6 October 2020 (UTC)Reply
Is it the magic word urlencode you're looking for? --Trialpears (talk) 00:08, 7 October 2020 (UTC)Reply
Using the article title to "guess" the URL is a very bad idea, as there's no guarantee it will lead to the correct one. Too bad e.g. https://www.tcm.com/tcmdb/title/24336 doesn't redirect to https://www.tcm.com/tcmdb/title/24336/thelma-and-louise, but this strikes me as something that should be corrected by either running a bot or contacting TCM to redirect the old or partial URLs. (Wonder what Wikidata does.) Nardog (talk) 00:19, 7 October 2020 (UTC)Reply
Just realized https://www.tcm.com/tcmdb/title/24336/any_string_whatsoever redirects to https://www.tcm.com/tcmdb/title/24336/thelma-and-louise. So we don't need to do all the transformations like &and—it could even be just _ or something—at least as a tentative measure. Nardog (talk) 00:43, 7 October 2020 (UTC)Reply
I don't see how this is a very bad idea when in the small sample I've done with articles here that are using this template, all use the ID, plus "the-film-name-with-dashes-for-spaces". So firstly, this change makes the template use the correct URL for TCMDb's end, which it currently is not. And second, as you noted, as long as the ID is correct, and the title string of the url is close, it will redirect correctly. I don't believe that was working yesterday when I started this, but I have tested https://www.tcm.com/tcmdb/title/24336/thelma-&-louise and https://www.tcm.com/tcmdb/title/319298/batman-&-robin and both redirect correctly. And as well, I have added a new parameter |url_title= that will override the automatic handling if for some reason it is vastly different than expected, or not working correctly. - Favre1fan93 (talk) 15:16, 7 October 2020 (UTC)Reply
Again, there's no guarantee TCMDb uses the same title for a movie as that of the Wikipedia article, which can be in any of a variety of languages and can contain various punctuation marks—not just ampersands but colons, slashes, dashes, etc.—which you'd have to escape if you're going to use {{PAGENAMEBASE}}. as long as the ID is correct, and the title string of the url is close, it will redirect correctly Not quite; the title string can be anything, it doesn't even have to be close. Recycling the article title for guessing the URL and adding a parameter when any arbitrary placeholder works just as well strikes me as overkill. Nardog (talk) 15:55, 7 October 2020 (UTC)Reply
So then what are you suggesting as a solution, because the template is broken in its current state. - Favre1fan93 (talk) 18:30, 7 October 2020 (UTC)Reply
We can simply replace http://www.tcm.com/tcmdb/title/title.jsp?stid=... with https://www.tcm.com/tcmdb/title/.../- or whatever. Nardog (talk) 19:19, 7 October 2020 (UTC)Reply
I guess I don't fully understand how using just a "-"in the url where the title should go to force TCMDb to fix it, rather than the PAGENAMEBASE/replace code I implemented that would present the actual URL in the vast majority of cases (disregarding the &/other character situation). Because as demonstrated, in those cases, whatever was generated by the template would still get users to the correct TCMDb page. - Favre1fan93 (talk) 19:30, 7 October 2020 (UTC)Reply
So would any other arbitrary string, like -. So what's the point of using PAGENAMEBASE/replace code when there's no guarantee they will produce the canonical URL? Nardog (talk) 19:34, 7 October 2020 (UTC)Reply
It has the ability to be correct for the vast majority of articles, and not for a few, verses being incorrect for all with TCMDb fixing it on their end. - Favre1fan93 (talk) 20:25, 7 October 2020 (UTC)Reply
TCMDb is not "fixing" the URL, it's just indifferent to what you put in at the end. The more maneuvers you put in the template the more opportunities for it to break. Particularly we don't know how some punctuation marks and non-ASCII characters are handled. The simpler solution is usually the better one. Nardog (talk) 08:26, 8 October 2020 (UTC)Reply
But if TCMDb adjusts on their end to make these soft redirects not valid, then we are back to where we are now, with a template that doesn't do what it should. So being indifferent to what you put in at the end seems like only a partial solution to making the template work properly. - Favre1fan93 (talk) 13:42, 8 October 2020 (UTC)Reply
I agree with Nardog and this will be a more robust solution in the long run — Martin (MSGJ · talk) 18:23, 7 October 2020 (UTC)Reply
I have coded the sandbox so that it takes advantage of the current TCM redirect scheme. They will probably break it again in the future, but I think it works for now, without us needing to burn cycles with convoluted text replacement. Do more test cases need to be added to ensure that the sandbox works, or should we deploy it now (since the current template doesn't work at all) and wait for reports of problems? – Jonesey95 (talk) 23:26, 7 October 2020 (UTC)Reply
I definitely feel this should be tested to ensure TCM redirect scheme does work as intended. - Favre1fan93 (talk) 13:42, 8 October 2020 (UTC)Reply
Test away! Template:TCMDb title/testcases is not a protected page. You are welcome to add a wide variety of test cases. As a template editor, I love a robust test cases page, especially when I am modifying a template with which I am unfamiliar. In this particular situation, where the template transclusions are 100% not working, as far as we know, a more useful test might be deploying the sandbox code and then going to the What Links Here page and checking the template's transclusions in a few hundred articles. – Jonesey95 (talk) 15:07, 8 October 2020 (UTC)Reply
@Jonesey95: I agree we should roll out the new version first given the live version doesn't work at all. I've extracted 500 transclusions in articles (excluding those relying on Wikidata) and added them to the testcases page. Nardog (talk) 16:05, 8 October 2020 (UTC)Reply
  DoneJonesey95 (talk) 17:10, 8 October 2020 (UTC)Reply

Links only work in limited regions edit

For many people, clicking the links produced by this template is a waste of time, because these links only work in limited regions of the world. Can we update the template to flag this issue, similar to the subscription required template?

  • The links produced by this template do not work for many people
  • In large parts of the world, these links redirect to https://www.tcm.com/unavailable
  • In these cases, the TCM page can take long to render (10 seconds +)
  • The TCM page just says "Not Available – Oh no! Turner Classic Movies isn't available in your region"
  • This redirect appears to depend on location, as derived from IP address
  • The output produced by the template does not flag this issue

Superp (talk) 08:52, 11 October 2021 (UTC)Reply