NOTICE: By continued use of this site you understand and agree to the binding Terms of Service and Privacy Policy.
// ==UserScript==
// @name GoMovies "My Movies" enhanced
// @namespace gomovies.page.mymovies
// @author matheusfaustino
// @description Separe movies and series in my movies page
// @include https://gostream.is/user/movies/favorite*
// @version 1
// @grant none
// ==/UserScript==
function create_div_with_title(title, items) {
// create elem
let div_html = document.createElement('div');
let title_html = document.createElement('h2');
// style
div_html.style.overflow = 'hidden';
title_html.style.margin = '0 1%';
title_html.style.borderBottom = '1px solid rgb(177, 167, 167)';
title_html.style.paddingBottom = '4px';
title_html.style.marginBottom = '10px';
// add content
title_html.appendChild(document.createTextNode(title));
div_html.appendChild(title_html);
items.map(e => div_html.appendChild(e))
return div_html;
}
function separeSeriesMovies() {
let list_items = [].slice.call(document.querySelectorAll('.movies-list .ml-item'));
let list_movies = list_items.filter((x) => x.innerHTML.toLowerCase().indexOf('eps') == -1);
let list_series = list_items.filter((x) => x.innerHTML.toLowerCase().indexOf('eps') != -1);
let movies_html = create_div_with_title('Movies', list_movies);
let series_html = create_div_with_title('Series', list_series);
document.querySelector('.movies-list').appendChild(movies_html);
document.querySelector('.movies-list').appendChild(series_html);
}
document.addEventListener('DOMContentLoaded', () => separeSeriesMovies() );