Try 30 days of free premium.

My userscript

Cecile wrote 7 years ago: 1

Hello,

I'm started my userscripts :

- Buttons Watchlist (https://raw.githubusercontent.com/cicelle/tvmaze/master/watchlist-buttons.user.js) The point is to add few buttons in the watchlist to avoid the select.

- Count episodes Watchlist (https://raw.githubusercontent.com/cicelle/tvmaze/master/episodes-count-watchlist.user.js) With this one, there is few adaptation of the watchlist layout, in order to lose less space.
Also, it change of the [complete le most|least] 's order. Currently it's sorting by percentage of viewed episodes. With this plugin, it's sorted by the count of remaining episodes.

Let me know if you see some change to do.
Cecile

Alex2k wrote 7 years ago: 1

Neat trick with reloading page after trigger, but after reload page's scroll position get reset. It's annoying - try to mark several episodes in the row for the same show and see.

I propose trick with replacing url with additional parameter page_y representing scrolling position :
1) replace window.location.reload(true) with

var url = window.location.href.replace(/[\?&]page_y=\d+/, "").replace(/\?$/, "") ;
window.location.href = url + (url.indexOf("?") < 0 ? "?" : "&") + 'page_y=' + $(document).scrollTop();

2) add to begin of script's anonymous function

try {
$("html, body").scrollTop(window.location.href.match(/[\?&]page_y=(\d+)/)[1]);
} catch (e) {
}

Modified script: https://gist.github.com/anonymous/637e1547666f9f6b1b771a1f260c3cc0#file-watchlist-buttons-user-js

Cecile wrote 7 years ago: 1

On the new version, there is no reload, so it's cleaner. And it's also working on the show page.
I just have a bug with a mutation observer (who doesn't want to work) for the watched episodes counter.

Thanks for your review ;)

Cecile wrote 7 years ago: 1

Some news :

- buttons watchlist : the script doesn't reload the page anymore. It's also working the shows episodes page.
- calendar buttons [NEW] : adding the buttons on the calendar page. Still got to fix the position of the page on load.

As usual, review will be much welcome.

Alex2k wrote 7 years ago: 1

Hi, Cecile.

Nice job with calendar buttons, looks very nice and works like charm. Except of course then calendar entry is skipped and episode appear as unwatched. I already left suggestion to differentiate skipped and unwatched episodes in calendar.

Buttons watchlist needs work:

1) If timeout of 0.35s isn't enough (for example then heavy downloading with many connections is in progress), columns/buttons don't appear. They are added 2nd time on timeout, but .watchlist-show reloads after timeout and they disappear.
2) If new episode state is acquired, columns/buttons are added 2nd time. That's because page doesn't refresh in that case. (learned this from tvmazecdn.com/js/watchlist.js)
3) In watchlist every show has link "View all" leading to http://www.tvmaze.com/watch/show?show_id=*, this is list very similar to episode list except reversed. Would by nice that script support such pages too.

In my own script i tried to accommodate for partial page refresh with window.setInterval trying to detect then added columns disappear (.watchlist-show reloaded) and then recreate columns/buttons and kill timer. That worked, but flashing looked ugly. After you mentioned mutation observer i read about it and tried to implement. First result - no flashing, as i understand browser have yet to repaint at the moment mutation handler called.

Cecile wrote 7 years ago: 1

1) I will try it with the mutation observer soon.
2) Indeed, to be fixed
3) Not planned on this page because i'm working on a [set all episodes as X] feature on the episode page.
4) Mutation observer ain't easy working with! I tried few stuff who worked on codepen (with a copy of tvmaze page) but there didn't worked in here.


gazza911 wrote 7 years ago: 1

I'm not sure what you're referring to about the buttons not appearing (never happened to me), but I've optimised the code and made a pull request on your github.

Cecile wrote 7 years ago: 1

All corrected.

I am considering that each script should be separated because someone might want one without the others, but do you guys thinks i should make only one ?


gazza911 wrote 7 years ago: 1

Not sure why, but you merged the pull request, then changed it again and removed the optimisations that I made.

Cecile wrote 7 years ago: 1

Because of conflicts with the new version.

Cecile wrote 6 years ago: 1

Button calendar's script removed due to site improvement. I strongly suggest former users to remove it from their browser.


Jan wrote 6 years ago: 1

Cecile wrote:
Button calendar's script removed due to site improvement. I strongly suggest former users to remove it from their browser.

Just fyi, the new watch buttons feature on the calender is currently Premium only.
If users wish to continue using your script instead of upgrading that's fine. :)
http://www.tvmaze.com/blogs/31/marking-watched-episodes-in-your-calendar

P.S. kudos to you Cecile, for providing solutions and options.

Cecile wrote 6 years ago: 1

Thanks Jan!

I'll let it this way, but I still suggest to pass Premium ^^


albedos_shadow wrote 5 years ago: 1

Site update seems to have broken the count episodes watchlist script. Or is it just me?

Cecile wrote 5 years ago: 1

no, not just you, i saw that a bit earlier. I will look into it soon

Cecile wrote 5 years ago: 1

Done

I've fixed 'Count episodes Watchlist'.

As for 'Buttons Watchlist', it shoud be removed from your script agent, it is now useless with the new interface.


albedos_shadow wrote 5 years ago: 1

Thanks, appreciate it!

While I'm here, I was wondering: would it be possible to add specials into the watchlist by way of a userscript? I know absolutely nothing about coding, so just a shot in the dark here. It's my number one most requested feature on the site.

Cecile wrote 5 years ago: 1

albedos_shadow wrote:
would it be possible to add specials into the watchlist ? [...] It's my number one most requested feature on the site.

For me too, actually.

But I never took the time to look into it.
I'll try to find some time next week to see what I can do.

bjvogel wrote 5 years ago: 1

I just noticed today that the buttons in the callendar aren't working. I don't know if it's just me or not. Could you look into that if you have the time?

Also, would you be able to rearrange the buttons to match the order in the watchlist, and make them visible on episodes that are already marked as watched, acquired, or skipped?

Thanks for your awesome scripts.

Try 30 days of free premium.