Skip to content

Commit 1eddda1

Browse files
authored
Update fyk2l3vj.user.js
1 parent fa9257b commit 1eddda1

File tree

1 file changed

+8
-6
lines changed

1 file changed

+8
-6
lines changed

userscripts/src/fyk2l3vj.user.js

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
// ==UserScript==
22
// @name Trakt.tv | Enhanced Title Metadata
33
// @description Adds links of filtered search results to the metadata section (languages, genres, networks, studios, writers, certification, year) on title summary pages, similar to the vip feature. Also adds a country flag and allows for "combined" searches by clicking on the labels.
4-
// @version 0.8.18
4+
// @version 1.0.0
55
// @namespace fyk2l3vj
66
// @updateURL https://update.greasyfork.org/scripts/550076.meta.js
77
// @icon https://trakt.tv/assets/logos/logomark.square.gradient-b644b16c38ff775861b4b1f58c1230f6a097a2466ab33ae00445a505c33fcb91.svg
@@ -24,7 +24,7 @@
2424
ORed for networks and studios. For example if the genres are "Crime" and "Drama", then a label search will return a selection of other titles that also have the genres "Crime" AND "Drama".
2525
- The writers label search was mostly added as an example of how to search for filmography intersections with trakt's search engine (there's no official tutorial about this,
2626
just some vague one liner in the api docs about how `+ - && || ! ( ) { } [ ] ^ " ~ * ? : /` have "special meaning" when used in a query).
27-
It's much more intersting with actors e.g. [Movies with Will Smith and Alan Tudyk](https://trakt.tv/search/movies?query=%22Will%20Smith%22+%22Alan%20Tudyk%22&fields=people).
27+
It's much more interesting with actors e.g. [Movies with Will Smith and Alan Tudyk](https://trakt.tv/search/movies?query=%22Will%20Smith%22+%22Alan%20Tudyk%22&fields=people).
2828
- The title's certification links to the respective `/parentalguide` imdb page (which contains descriptions of nude scenes, graphic content etc.).
2929
- The title's year links to the search page for other titles from the same year.
3030
- The search results default to either the "movies" or "shows" search category depending on the type of the current title.
@@ -42,12 +42,14 @@ const logger = {
4242
_defaults: {
4343
title: GM_info.script.name.replace('Trakt.tv', 'Userscript'),
4444
toast: true,
45-
toastrOpt: { positionClass: 'toast-top-right', timeOut: 8000, progressBar: true },
45+
toastrOpt: { positionClass: 'toast-top-right', timeOut: 10000, progressBar: true },
46+
toastrStyles: '#toast-container#toast-container a { color: #fff !important; border-bottom: dotted 1px #fff; }',
4647
},
4748
_print(fnConsole, fnToastr, msg = '', opt = {}) {
48-
const { data, title = this._defaults.title, consoleStyles, toast = this._defaults.toast, toastrOpt } = opt;
49-
console[fnConsole](`%c${title}: ${msg}`, consoleStyles ?? '', ...(data !== undefined ? [data] : []));
50-
if (toast) toastr[fnToastr](msg + (data !== undefined ? ' See console for details.' : ''), title, { ...this._defaults.toastrOpt, ...toastrOpt });
49+
const { title = this._defaults.title, toast = this._defaults.toast, toastrOpt, toastrStyles = '', consoleStyles = '', data } = opt,
50+
fullToastrMsg = `${msg}${data !== undefined ? ' See console for details.' : ''}<style>${this._defaults.toastrStyles + toastrStyles}</style>`;
51+
console[fnConsole](`%c${title}: ${msg}`, consoleStyles, ...(data !== undefined ? [data] : []));
52+
if (toast) toastr[fnToastr](fullToastrMsg, title, { ...this._defaults.toastrOpt, ...toastrOpt });
5153
},
5254
info(msg, opt) { this._print('info', 'info', msg, opt) },
5355
success(msg, opt) { this._print('info', 'success', msg, { consoleStyles: 'color:#00c853;', ...opt }) },

0 commit comments

Comments
 (0)