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

Custom external links improvement for shows and episodes #40

Open
AmineI opened this issue Apr 9, 2019 · 5 comments
Open

Custom external links improvement for shows and episodes #40

AmineI opened this issue Apr 9, 2019 · 5 comments

Comments

@AmineI
Copy link

AmineI commented Apr 9, 2019

Hi there,

Just noticed that while clicking a custom external link on a TV show or Movie works fine, clicking one on an episode opens a Google search for the name of the episode, without the show title, which is unlikely to find a correct match.

It should add the show title in the search query, along with the episode, I believe.

@AmineI AmineI changed the title Custom external links : episodes searching for episode title without the show title Custom external links : should search for episode title with the show title May 28, 2019
@AmineI
Copy link
Author

AmineI commented May 28, 2019

Changed the title to clarify.

Example, currently if an episode's name is "Episode 1" the custom external link will trigger a google search for "Episode 1"

@nliautaud
Copy link
Owner

Hi, I cannot reproduce specifically that.
The search query is simply the main header content. For an episode that should be the show/episode number, the episode title and the certification.

For example https://trakt.tv/shows/the-sopranos/seasons/1/episodes/3 is returning 1x03 Denial, Anger, Acceptance TV-MA.


But, the query is not very helpful for an episode as the show title is missing.

That feature could be improved by :

  • removing the certification
  • formatting the query as Show title : Season number for a show, for example The Sopranos : Season 1
  • formatting the query as Show title : Season number Episode number "Episode title" for an episode, ex The Sopranos : Season 1 Episode 3 "Denial, Anger, Acceptance"

The lines in question :

addExternalLinks = function() {
var list = document.querySelector('.sidebar .external')
if(!list || !options.layoutExternalLinks) return
var title = document.querySelector('h1').textContent
if( list.classList.contains('is-customized') ) return
list.classList.add('is-customized')
options.layoutExternalLinks.split(',').forEach(function(domain) {
var goourl = 'http://www.google.com/search?btnI&q='
var firstlink = list.querySelector('a')
var new_el = firstlink.cloneNode(true)
new_el.href = goourl + title + ' ' + domain
new_el.innerHTML = domain
firstlink.parentElement.appendChild(new_el)
})
}

@AmineI
Copy link
Author

AmineI commented Jun 1, 2019

Hi, I cannot reproduce specifically that.
The search query is simply the main header content. For an episode that should be the show/episode number, the episode title and the certification.

For example https://trakt.tv/shows/the-sopranos/seasons/1/episodes/3 is returning 1x03 Denial, Anger, Acceptance TV-MA.

My bad, as I was on mobile when I added this comment and I didn't remember the entire string - apologies, it would indeed search for 1x01 Episode 1 TV-MA in my case !

But, the query is not very helpful for an episode as the show title is missing.

Yes, that's what I was trying to mention above indeed :) .

That feature could be improved by :

  • removing the certification
  • formatting the query as Show title : Season number for a show, for example The Sopranos : Season 1
  • formatting the query as Show title : Season number Episode number "Episode title" for an episode, ex The Sopranos : Season 1 Episode 3 "Denial, Anger, Acceptance"

Thanks for the code link, I'll have a look at how it works soonish (exams almost over ! :) )

@nliautaud nliautaud changed the title Custom external links : should search for episode title with the show title Custom external links improvement for shows and episodes Jun 1, 2019
@nliautaud nliautaud added this to the v0.5 milestone Jun 1, 2019
@nliautaud
Copy link
Owner

No problem, good luck with your exams ! :)

@AmineI
Copy link
Author

AmineI commented May 8, 2020

Well, ended up forgetting, then remembering, then failing to figure it out, then being busy, then--- well, you know how life is :) . Anyway, I have implemented and tested the logic for doing almost as we discussed, I'll write about that in a PR right now.

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

No branches or pull requests

2 participants