Skip to content

Commit

Permalink
Updated to 1.3.0.0
Browse files Browse the repository at this point in the history
Made changes to JS framework: titling, finding, and matching.
Made small changes to style (added common.css).
  • Loading branch information
Ephellon committed Jul 23, 2018
1 parent 6a4d8a4 commit 2aa9695
Show file tree
Hide file tree
Showing 25 changed files with 57 additions and 420 deletions.
Binary file modified hhkmjeeccipbolailpomhjhmccnnjhkj.crx
Binary file not shown.
Binary file modified hhkmjeeccipbolailpomhjhmccnnjhkj.zip
Binary file not shown.
16 changes: 8 additions & 8 deletions src/background.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ function generateHeaders(auth) {
function changeStatus({ id, tt, ty, tv, pv, tl, yr }) {

id = id && !/^tt-?$/i.test(id)? id: null;
tl = tt.replace(/\-/g, ' ').replace(/\s{2,}/g, ' - ');
tl = tt.replace(/\-/g, ' ').replace(/[\s\:]{2,}/g, ' - ');
tt = tt.replace(/[\-\s]+/g, '-').replace(/[^\w\-]+/g, '');

external = { P: pv, Q: id, T: tt, Y: ty };
Expand Down Expand Up @@ -281,31 +281,31 @@ function $searchPlex(connection, headers, options) {
let Hub = data.MediaContainer.Hub.find(hub => hub.type === type);

if (!Hub || !Hub.Metadata) {
return {
found: false
};
return { found: false };
}

// We only want to search in Plex libraries with the type "Movie", i.e. not the type "Other Videos".
// Weirdly enough Plex doesn't seem to have an easy way to filter those libraries so we invent our own hack.
let movies = Hub.Metadata.filter(
meta =>
meta.Country ||
meta.Directory ||
meta.Genre ||
meta.Country ||
meta.Role ||
meta.Writer
);
),
strip = (string) => string.replace(/\W+/g, '').toLowerCase();

// This is messed up, but Plex's definition of a year is year when it was available,
// not when it was released (which is Movieo's definition).
// For examples, see Bone Tomahawk, The Big Short, The Hateful Eight.
// So we'll first try to find the movie with the given year, and then + 1 it.
let media = movies.find(meta => meta.year === +options.year),
// Added [strip] to prevent mix-ups, see: "Kingsman: The Golden Circle" v. "The Circle"
let media = movies.find(meta => ((meta.year === +options.year) && strip(meta.title) === strip(options.title))),
key = null;

if (!media) {
media = movies.find(meta => meta.year === +options.year + 1);
media = movies.find(meta => ((meta.year === +options.year + 1) && strip(meta.title) === strip(options.title)));
} else {
key = media.key.replace('/children', '');
}
Expand Down
20 changes: 0 additions & 20 deletions src/deps/amazon/cs.css
Original file line number Diff line number Diff line change
Expand Up @@ -29,23 +29,3 @@
#tt--0-0:hover {
background: linear-gradient(180deg, #70767d 0, #696f78 0, #3d444e 100%)!important;
}

.web-to-plex-notification {
cursor: pointer;
display: block;
position: fixed;
top: 80px;
left: 50%;
margin-left: -175px;
width: 350px;
background: #21262e;
color: #fff;
font-size: 20px;
padding: 10px;
border-radius: 4px;
z-index: 999000;
}

.web-to-plex-warning {
background: #fd6a00;
}
24 changes: 24 additions & 0 deletions src/deps/common.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
/** Common CSS
* Web to Plex+
*/

.web-to-plex-notification {
cursor: pointer;
display: block;
position: fixed;
top: 80px;
left: 50%;
margin-left: -175px;
width: 350px;
background: #21262e;
color: #fff;
font-size: 20px;
padding: 10px;
border-radius: 4px;
z-index: 999000;
font-family: arial, verdana, sans-serif;
}

.web-to-plex-warning {
background: #fd6a00;
}
20 changes: 0 additions & 20 deletions src/deps/couchpotato/cs.css
Original file line number Diff line number Diff line change
Expand Up @@ -21,23 +21,3 @@
#tt--0-0:hover {
color: #888!important;
}

.web-to-plex-notification {
cursor: pointer;
display: block;
position: fixed;
top: 80px;
left: 50%;
margin-left: -175px;
width: 350px;
background: #21262e;
color: #fff;
font-size: 20px;
padding: 10px;
border-radius: 4px;
z-index: 999000;
}

.web-to-plex-warning {
background: #fd6a00;
}
21 changes: 0 additions & 21 deletions src/deps/fandango/cs.css
Original file line number Diff line number Diff line change
Expand Up @@ -25,24 +25,3 @@
#tt--0-0:hover {
color: #888!important;
}

.web-to-plex-notification {
cursor: pointer;
display: block;
position: fixed;
top: 80px;
left: 50%;
margin-left: -175px;
width: 350px;
background: #e5a00d;
color: #fff;
font-size: 13px;
padding: 10px;
border-radius: 4px;
z-index: 999000;
font-family: Verdana, Arial, sans-serif;
}

.web-to-plex-warning {
background: #fd6a00;
}
20 changes: 0 additions & 20 deletions src/deps/flenix/cs.css
Original file line number Diff line number Diff line change
Expand Up @@ -42,23 +42,3 @@
#tt--0-0:hover {
background: #888!important;
}

.web-to-plex-notification {
cursor: pointer;
display: block;
position: fixed;
top: 80px;
left: 50%;
margin-left: -175px;
width: 350px;
background: #21262e;
color: #fff;
font-size: 20px;
padding: 10px;
border-radius: 4px;
z-index: 999000;
}

.web-to-plex-warning {
background: #fd6a00;
}
21 changes: 0 additions & 21 deletions src/deps/google/cs.css
Original file line number Diff line number Diff line change
Expand Up @@ -67,24 +67,3 @@
#tt--0-0:hover {
color: #888!important;
}

.web-to-plex-notification {
cursor: pointer;
display: block;
position: fixed;
top: 80px;
left: 50%;
margin-left: -175px;
width: 350px;
background: #e5a00d;
color: #fff;
font-size: 13px;
padding: 10px;
border-radius: 4px;
z-index: 999000;
font-family: Verdana, Arial, sans-serif;
}

.web-to-plex-warning {
background: #fd6a00;
}
21 changes: 0 additions & 21 deletions src/deps/hulu/cs.css
Original file line number Diff line number Diff line change
Expand Up @@ -37,24 +37,3 @@
#tt--0-0:hover {
color: #888!important;
}

.web-to-plex-notification {
cursor: pointer;
display: block;
position: fixed;
top: 80px;
left: 50%;
margin-left: -175px;
width: 350px;
background: #e5a00d;
color: #fff;
font-size: 13px;
padding: 10px;
border-radius: 4px;
z-index: 999000;
font-family: Verdana, Arial, sans-serif;
}

.web-to-plex-warning {
background: #fd6a00;
}
21 changes: 0 additions & 21 deletions src/deps/imdb/cs.css
Original file line number Diff line number Diff line change
Expand Up @@ -38,24 +38,3 @@
#tt--0-0:hover {
background: #888!important;
}

.web-to-plex-notification {
cursor: pointer;
display: block;
position: fixed;
top: 80px;
left: 50%;
margin-left: -175px;
width: 350px;
background: #e5a00d;
color: #fff;
font-size: 13px;
padding: 10px;
border-radius: 4px;
z-index: 999000;
font-family: Verdana, Arial, sans-serif;
}

.web-to-plex-warning {
background: #fd6a00;
}
21 changes: 0 additions & 21 deletions src/deps/itunes/cs.css
Original file line number Diff line number Diff line change
Expand Up @@ -36,24 +36,3 @@
#tt--0-0:hover {
background: #888!important;
}

.web-to-plex-notification {
cursor: pointer;
display: block;
position: fixed;
top: 80px;
left: 50%;
margin-left: -175px;
width: 350px;
background: #e5a00d;
color: #fff;
font-size: 13px;
padding: 10px;
border-radius: 4px;
z-index: 999000;
font-family: Verdana, Arial, sans-serif;
}

.web-to-plex-warning {
background: #fd6a00;
}
20 changes: 0 additions & 20 deletions src/deps/letterboxd/cs.css
Original file line number Diff line number Diff line change
Expand Up @@ -8,23 +8,3 @@
.web-to-plex-button:hover {
color: #f67e56!important;
}

.web-to-plex-notification {
cursor: pointer;
display: block;
position: fixed;
top: 80px;
left: 50%;
margin-left: -175px;
width: 350px;
background: #21262e;
color: #fff;
font-size: 20px;
padding: 10px;
border-radius: 4px;
z-index: 999000;
}

.web-to-plex-warning {
background: #fd6a00;
}
20 changes: 0 additions & 20 deletions src/deps/metacritic/cs.css
Original file line number Diff line number Diff line change
Expand Up @@ -32,23 +32,3 @@
background: #888!important;
border-color: #888!important;
}

.web-to-plex-notification {
cursor: pointer;
display: block;
position: fixed;
top: 80px;
left: 50%;
margin-left: -175px;
width: 350px;
background: #21262e;
color: #fff;
font-size: 20px;
padding: 10px;
border-radius: 4px;
z-index: 999000;
}

.web-to-plex-warning {
background: #fd6a00;
}
20 changes: 0 additions & 20 deletions src/deps/movieo/cs.css
Original file line number Diff line number Diff line change
Expand Up @@ -33,23 +33,3 @@
background: #888!important;
border-color: #888!important;
}

.web-to-plex-notification {
cursor: pointer;
display: block;
position: fixed;
top: 80px;
left: 50%;
margin-left: -175px;
width: 350px;
background: #21262e;
color: #fff;
font-size: 20px;
padding: 10px;
border-radius: 4px;
z-index: 999000;
}

.web-to-plex-warning {
background: #fd6a00;
}
20 changes: 0 additions & 20 deletions src/deps/rottentomatoes/cs.css
Original file line number Diff line number Diff line change
Expand Up @@ -53,23 +53,3 @@
background-color: #888!important;
border-color: #888!important;
}

.web-to-plex-notification {
cursor: pointer;
display: block;
position: fixed;
top: 80px;
left: 50%;
margin-left: -175px;
width: 350px;
background: #21262e;
color: #fff;
font-size: 20px;
padding: 10px;
border-radius: 4px;
z-index: 999000;
}

.web-to-plex-warning {
background: #fd6a00;
}
20 changes: 0 additions & 20 deletions src/deps/tmdb/cs.css
Original file line number Diff line number Diff line change
Expand Up @@ -32,23 +32,3 @@
background: #888!important;
border-color: #888!important;
}

.web-to-plex-notification {
cursor: pointer;
display: block;
position: fixed;
top: 80px;
left: 50%;
margin-left: -175px;
width: 350px;
background: #21262e;
color: #fff;
font-size: 20px;
padding: 10px;
border-radius: 4px;
z-index: 999000;
}

.web-to-plex-warning {
background: #fd6a00;
}

0 comments on commit 2aa9695

Please sign in to comment.