mirror of
https://github.com/JasonHHouse/gaps.git
synced 2026-05-25 04:18:33 -05:00
Merge pull request #237 from JasonHHouse/improvement/improved_logging
Improvement/improved logging
This commit is contained in:
@@ -53,3 +53,5 @@ GapsAsJar/*
|
||||
!GapsAsJar/start.bat
|
||||
!GapsAsJar/gaps.nsi
|
||||
.DS_Store
|
||||
|
||||
coverage/
|
||||
|
||||
+1
-1
@@ -5,7 +5,7 @@
|
||||
<parent>
|
||||
<artifactId>Gaps</artifactId>
|
||||
<groupId>com.jasonhhouse</groupId>
|
||||
<version>0.9.5</version>
|
||||
<version>0.9.6</version>
|
||||
</parent>
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
|
||||
|
||||
+1
-1
@@ -32,7 +32,7 @@ RUN mkdir -p /usr/app && chmod 777 /usr/data
|
||||
|
||||
WORKDIR /usr/app
|
||||
|
||||
COPY GapsWeb/target/GapsWeb-0.9.5.jar /usr/app/gaps.jar
|
||||
COPY GapsWeb/target/GapsWeb-0.9.6.jar /usr/app/gaps.jar
|
||||
|
||||
COPY start.sh /usr/app/
|
||||
|
||||
|
||||
+1
-1
@@ -36,7 +36,7 @@ RUN mkdir -p /usr/app && chmod 777 /usr/data
|
||||
|
||||
WORKDIR /usr/app
|
||||
|
||||
COPY GapsWeb/target/GapsWeb-0.9.5.jar /usr/app/gaps.jar
|
||||
COPY GapsWeb/target/GapsWeb-0.9.6.jar /usr/app/gaps.jar
|
||||
|
||||
COPY start.sh /usr/app/
|
||||
|
||||
|
||||
+1
-1
@@ -32,7 +32,7 @@ RUN mkdir -p /usr/app && chmod 777 /usr/data
|
||||
|
||||
WORKDIR /usr/app
|
||||
|
||||
COPY GapsWeb/target/GapsWeb-0.9.5.jar /usr/app/gaps.jar
|
||||
COPY GapsWeb/target/GapsWeb-0.9.6.jar /usr/app/gaps.jar
|
||||
|
||||
COPY start.sh /usr/app/
|
||||
|
||||
|
||||
+1
-1
@@ -32,7 +32,7 @@ RUN mkdir -p /usr/app && chmod 777 /usr/data
|
||||
|
||||
WORKDIR /usr/app
|
||||
|
||||
COPY GapsWeb/target/GapsWeb-0.9.5.jar /usr/app/gaps.jar
|
||||
COPY GapsWeb/target/GapsWeb-0.9.6.jar /usr/app/gaps.jar
|
||||
|
||||
COPY start.sh /usr/app/
|
||||
|
||||
|
||||
+1
-1
@@ -36,7 +36,7 @@ RUN mkdir -p /usr/app && chmod 777 /usr/data
|
||||
|
||||
WORKDIR /usr/app
|
||||
|
||||
COPY GapsWeb/target/GapsWeb-0.9.5.jar /usr/app/gaps.jar
|
||||
COPY GapsWeb/target/GapsWeb-0.9.6.jar /usr/app/gaps.jar
|
||||
|
||||
COPY start.sh /usr/app/
|
||||
|
||||
|
||||
+1
-1
@@ -48,4 +48,4 @@ RMDIR /r $INSTDIR
|
||||
SectionEnd
|
||||
|
||||
# name the installer
|
||||
OutFile "gaps-0.9.5-installer.exe"
|
||||
OutFile "gaps-0.9.6-installer.exe"
|
||||
+1
-1
@@ -5,7 +5,7 @@
|
||||
<parent>
|
||||
<artifactId>Gaps</artifactId>
|
||||
<groupId>com.jasonhhouse</groupId>
|
||||
<version>0.9.5</version>
|
||||
<version>0.9.6</version>
|
||||
</parent>
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
|
||||
|
||||
@@ -53,40 +53,27 @@ public class WebSecurityConfig extends WebSecurityConfigurerAdapter {
|
||||
|
||||
if (gapsConfiguration.getLoginEnabled() && gapsConfiguration.getSslEnabled()) {
|
||||
LOGGER.info("Login Enabled. Configuring site security with ssl.");
|
||||
http.cors().and().csrf().disable()
|
||||
.authorizeRequests().antMatchers("/images/gaps.ico",
|
||||
"/css/bootstrap.min.css",
|
||||
"/css/input.min.css",
|
||||
"/js/jquery-3.4.1.min.js",
|
||||
"/js/bootstrap.bundle.min.js",
|
||||
"/js/index.min.js",
|
||||
|
||||
"/images/final-2.svg",
|
||||
"/images/final-gaps.svg").permitAll()
|
||||
.anyRequest().fullyAuthenticated()
|
||||
http.cors().and().csrf().disable()
|
||||
.authorizeRequests()
|
||||
.antMatchers("/rss/**").permitAll()
|
||||
.anyRequest()
|
||||
.authenticated()
|
||||
.and()
|
||||
.formLogin()
|
||||
.loginPage("/login")
|
||||
.permitAll()
|
||||
.and()
|
||||
.logout()
|
||||
.permitAll();
|
||||
.httpBasic();
|
||||
} else if (Boolean.TRUE.equals(gapsConfiguration.getLoginEnabled()) && Boolean.FALSE.equals(gapsConfiguration.getSslEnabled())) {
|
||||
LOGGER.info("Login Enabled. Configuring site security without ssl.");
|
||||
|
||||
http.cors().and().csrf().disable()
|
||||
.authorizeRequests()
|
||||
.anyRequest().fullyAuthenticated()
|
||||
.antMatchers("/rss/**").permitAll()
|
||||
.anyRequest()
|
||||
.authenticated()
|
||||
.and()
|
||||
.formLogin()
|
||||
.loginPage("/login")
|
||||
.defaultSuccessUrl("/home")
|
||||
.permitAll()
|
||||
.and()
|
||||
.logout()
|
||||
.permitAll();
|
||||
|
||||
.httpBasic();
|
||||
} else {
|
||||
//TODO
|
||||
//Test needing cors and csrf disabled
|
||||
http.cors().and().csrf().disable();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -94,13 +94,6 @@ public class GapsController {
|
||||
return modelAndView;
|
||||
}
|
||||
|
||||
@GetMapping(value = "/login",
|
||||
produces = MediaType.TEXT_HTML_VALUE)
|
||||
public ModelAndView getLogin() {
|
||||
LOGGER.info("getLogin()");
|
||||
return new ModelAndView("login");
|
||||
}
|
||||
|
||||
@GetMapping(value = "/updates",
|
||||
produces = MediaType.TEXT_HTML_VALUE)
|
||||
public ModelAndView getUpdates() {
|
||||
|
||||
@@ -50,7 +50,7 @@ info:
|
||||
app:
|
||||
name: Gaps
|
||||
description: Gaps searches through your Plex Server or local folders for all movies, then queries for known movies in the same collection. If those movies don't exist in your library, Gaps will recommend getting those movies, legally of course.
|
||||
version: 0.9.5
|
||||
version: 0.9.6
|
||||
storageFolder: /usr/data
|
||||
properties:
|
||||
rssFeed: rssFeed.json
|
||||
|
||||
@@ -18,6 +18,21 @@ export function getContextPath(url) {
|
||||
return url;
|
||||
}
|
||||
|
||||
export function getYear(year) {
|
||||
if ((year && year !== -1) && (year && year !== 0)) {
|
||||
return ` (${year})`;
|
||||
}
|
||||
return '';
|
||||
}
|
||||
|
||||
export function isEqual(a, b) {
|
||||
return a === b;
|
||||
}
|
||||
|
||||
export function isNotOwned(value) {
|
||||
return !value;
|
||||
}
|
||||
|
||||
export async function getOwnedMoviesForTable(url, movieContainer, noMovieContainer, moviesTable) {
|
||||
const response = await fetch(getContextPath(url), {
|
||||
method: 'get',
|
||||
|
||||
@@ -12,7 +12,9 @@
|
||||
/* global Handlebars, SockJS, Stomp */
|
||||
/* eslint no-undef: "error" */
|
||||
|
||||
import { getContextPath, getRecommendedMoviesForTable } from '../modules/common.min.js';
|
||||
import {
|
||||
getContextPath, getRecommendedMoviesForTable, getYear, isEqual, isNotOwned,
|
||||
} from '../modules/common.min.js';
|
||||
import Payload from '../modules/payload.min.js';
|
||||
|
||||
let libraryTitle;
|
||||
@@ -118,18 +120,9 @@ function copyToClipboard() {
|
||||
|
||||
jQuery(($) => {
|
||||
Handlebars.registerHelper({
|
||||
isNotOwned(value) {
|
||||
return !value;
|
||||
},
|
||||
isEqual(a, b) {
|
||||
return a === b;
|
||||
},
|
||||
getYear(year) {
|
||||
if (year && (year !== -1 || year !== 0)) {
|
||||
return ` (${year})`;
|
||||
}
|
||||
return '';
|
||||
},
|
||||
isNotOwned,
|
||||
isEqual,
|
||||
getYear,
|
||||
});
|
||||
|
||||
libraryTitle = $('#libraryTitle');
|
||||
@@ -227,7 +220,4 @@ jQuery(($) => {
|
||||
window.copyToClipboard = copyToClipboard;
|
||||
});
|
||||
|
||||
window.onbeforeunload = function () {
|
||||
disconnect();
|
||||
// return false;
|
||||
};
|
||||
window.onbeforeunload = disconnect;
|
||||
|
||||
@@ -29,7 +29,7 @@
|
||||
<img loading="lazy" th:src="@{/images/final-2.svg}" alt="Gaps Logo" style="width:50%;height:50%;" class="center">
|
||||
|
||||
<h3 class="top-margin">About</h3>
|
||||
<h4 class="top-margin text-primary">v0.9.5</h4>
|
||||
<h4 class="top-margin text-primary">v0.9.6</h4>
|
||||
|
||||
<p class="text-muted">Gaps searches through your Plex Server. It then queries
|
||||
for known
|
||||
|
||||
@@ -27,7 +27,7 @@
|
||||
<div class="container bottom-margin">
|
||||
<img loading="lazy" th:src="@{/images/final-2.svg}" alt="Gaps Logo" style="width:50%;height:50%;" class="center">
|
||||
|
||||
<h3 class="top-margin">v0.9.5</h3>
|
||||
<h3 class="top-margin">v0.9.6</h3>
|
||||
|
||||
<p class="text-muted">Gaps searches through your Plex Server. It then queries
|
||||
for known
|
||||
|
||||
@@ -1,57 +0,0 @@
|
||||
<!--
|
||||
- Copyright 2020 Jason H House
|
||||
-
|
||||
- Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
|
||||
-
|
||||
- The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
|
||||
-
|
||||
- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||
-->
|
||||
<!DOCTYPE html SYSTEM "http://www.thymeleaf.org/dtd/xhtml1-strict-thymeleaf-spring4-4.dtd">
|
||||
<html lang="en" xmlns="http://www.w3.org/1999/xhtml" xmlns:th="http://www.thymeleaf.org">
|
||||
|
||||
<head>
|
||||
<title>Gaps</title>
|
||||
<meta content="text/html; charset=UTF-8" http-equiv="Content-Type"/>
|
||||
<link rel="shortcut icon" th:href="@{/images/gaps.ico}"/>
|
||||
<link rel="stylesheet" th:href="@{/css/libraries/bootstrap.min.css}"/>
|
||||
<link rel="stylesheet" th:href="@{/css/input.min.css}">
|
||||
|
||||
<!--Let browser know website is optimized for mobile-->
|
||||
<meta content="width=device-width, initial-scale=1.0" name="viewport"/>
|
||||
</head>
|
||||
|
||||
<body>
|
||||
<nav class="navbar navbar-expand-lg navbar-dark bg-primary">
|
||||
<a class="" href=".">
|
||||
<img alt="" class="d-inline-block align-top" height="96" loading="lazy" th:src="@{/images/final-gaps.svg}"
|
||||
width="96">
|
||||
</a>
|
||||
</nav>
|
||||
<div class="container bottom-margin">
|
||||
<img alt="Gaps Logo" class="center" loading="lazy" style="width:50%;height:50%;" th:src="@{/images/final-2.svg}">
|
||||
|
||||
<div th:if="${param.error}">
|
||||
Invalid username and password.
|
||||
</div>
|
||||
<div th:if="${param.logout}">
|
||||
You have been logged out.
|
||||
</div>
|
||||
<form method="post" th:action="@{/login}">
|
||||
<div class="form-group">
|
||||
<label for="username">Username</label>
|
||||
<input class="form-control" id="username" name="username" type="text"/>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label for="password">Password</label>
|
||||
<input class="form-control" id="password" name="password" type="password"/>
|
||||
</div>
|
||||
<button class="btn btn-primary" type="submit">Log In</button>
|
||||
</form>
|
||||
</div>
|
||||
|
||||
<script th:src="@{/js/libraries/jquery-3.4.1.min.js}" type="text/javascript"></script>
|
||||
<script th:src="@{/js/libraries/bootstrap.bundle.min.js}" type="text/javascript"></script>
|
||||
<script th:src="@{/js/page/index.min.js}" type="text/javascript"></script>
|
||||
</body>
|
||||
</html>
|
||||
@@ -28,6 +28,13 @@
|
||||
<img loading="lazy" th:src="@{/images/final-2.svg}" alt="Gaps Logo" style="width:50%;height:50%;" class="center">
|
||||
|
||||
<h3 class="top-margin">Updates</h3>
|
||||
<h4 class="top-margin text-primary">v0.9.6</h4>
|
||||
<ul class="text-muted">
|
||||
<li>Switching to Basic Login, removing login page</li>
|
||||
<li>Adding Jest unit tests</li>
|
||||
<li>Hibernate-Validator 6.1.5-Final</li>
|
||||
</ul>
|
||||
|
||||
<h4 class="top-margin text-primary">v0.9.5</h4>
|
||||
<ul class="text-muted">
|
||||
<li>Adding years collection movies</li>
|
||||
|
||||
+1
-1
@@ -5,7 +5,7 @@
|
||||
<parent>
|
||||
<artifactId>Gaps</artifactId>
|
||||
<groupId>com.jasonhhouse</groupId>
|
||||
<version>0.9.5</version>
|
||||
<version>0.9.6</version>
|
||||
</parent>
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
|
||||
|
||||
+1
-1
@@ -5,7 +5,7 @@
|
||||
<parent>
|
||||
<artifactId>Gaps</artifactId>
|
||||
<groupId>com.jasonhhouse</groupId>
|
||||
<version>0.9.5</version>
|
||||
<version>0.9.6</version>
|
||||
</parent>
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
|
||||
|
||||
@@ -0,0 +1,230 @@
|
||||
// __mocks__/request.js
|
||||
const pass = {
|
||||
"code": 50, "reason": "Recommended movies found.", "extras": [{
|
||||
"name": "Saw II",
|
||||
"year": 2005,
|
||||
"posterUrl": "https://image.tmdb.org/t/p/w185//gTnaTysN8HsvVQqTRUh8m35mmUA.jpg",
|
||||
"language": "en",
|
||||
"overview": "When a new murder victim is discovered with all the signs of Jigsaw's hand, Detective Eric Matthews begins a full investigation and apprehends Jigsaw with little effort. But for Jigsaw, getting caught is just another part of his plan. Eight more of his victims are already fighting for their lives and now it's time for Matthews to join the game.",
|
||||
"moviesInCollection": [{ "title": "Saw", "tmdbId": 176, "owned": true, "year": 2004 }, { "title": "Saw II", "tmdbId": 215, "owned": false, "year": 2005 }, {
|
||||
"title": "Saw III",
|
||||
"tmdbId": 214,
|
||||
"owned": false,
|
||||
"year": 2006
|
||||
}, { "title": "Saw IV", "tmdbId": 663, "owned": false, "year": 2007 }, { "title": "Saw V", "tmdbId": 11917, "owned": false, "year": 2008 }, {
|
||||
"title": "Saw VI",
|
||||
"tmdbId": 22804,
|
||||
"owned": false,
|
||||
"year": 2009
|
||||
}, { "title": "Saw: The Final Chapter", "tmdbId": 41439, "owned": false, "year": 2010 }, {
|
||||
"title": "Jigsaw",
|
||||
"tmdbId": 298250,
|
||||
"owned": false,
|
||||
"year": 2017
|
||||
}, { "title": "Saw X", "tmdbId": 816240, "owned": false, "year": 0 }],
|
||||
"ratingKey": -1,
|
||||
"key": "",
|
||||
"imdbId": "tt0432348",
|
||||
"collectionTitle": "Saw Collection",
|
||||
"collectionId": 656,
|
||||
"backdropPathUrl": "https://image.tmdb.org/t/p/original//oLfS1lOmN2KIU2IQ200SDEPVEZe.jpg",
|
||||
"tmdbId": 215,
|
||||
"genres": ["Horror"]
|
||||
}, {
|
||||
"name": "Saw III",
|
||||
"year": 2006,
|
||||
"posterUrl": "https://image.tmdb.org/t/p/w185//dfl7ti4ataetiyoOg3SI0FA9KeP.jpg",
|
||||
"language": "en",
|
||||
"overview": "Jigsaw has disappeared. Along with his new apprentice Amanda, the puppet-master behind the cruel, intricate games that have terrified a community and baffled police has once again eluded capture and vanished. While city detective scramble to locate him, Doctor Lynn Denlon and Jeff Reinhart are unaware that they are about to become the latest pawns on his vicious chessboard.",
|
||||
"moviesInCollection": [{ "title": "Saw", "tmdbId": 176, "owned": true, "year": 2004 }, { "title": "Saw II", "tmdbId": 215, "owned": false, "year": 2005 }, {
|
||||
"title": "Saw III",
|
||||
"tmdbId": 214,
|
||||
"owned": false,
|
||||
"year": 2006
|
||||
}, { "title": "Saw IV", "tmdbId": 663, "owned": false, "year": 2007 }, { "title": "Saw V", "tmdbId": 11917, "owned": false, "year": 2008 }, {
|
||||
"title": "Saw VI",
|
||||
"tmdbId": 22804,
|
||||
"owned": false,
|
||||
"year": 2009
|
||||
}, { "title": "Saw: The Final Chapter", "tmdbId": 41439, "owned": false, "year": 2010 }, {
|
||||
"title": "Jigsaw",
|
||||
"tmdbId": 298250,
|
||||
"owned": false,
|
||||
"year": 2017
|
||||
}, { "title": "Saw X", "tmdbId": 816240, "owned": false, "year": 0 }],
|
||||
"ratingKey": -1,
|
||||
"key": "",
|
||||
"imdbId": "tt0489270",
|
||||
"collectionTitle": "Saw Collection",
|
||||
"collectionId": 656,
|
||||
"backdropPathUrl": "https://image.tmdb.org/t/p/original//oLfS1lOmN2KIU2IQ200SDEPVEZe.jpg",
|
||||
"tmdbId": 214,
|
||||
"genres": ["Horror", "Thriller", "Crime"]
|
||||
}, {
|
||||
"name": "Saw IV",
|
||||
"year": 2007,
|
||||
"posterUrl": "https://image.tmdb.org/t/p/w185//obMbqhbkPIsdffNkEV97AE5D5ng.jpg",
|
||||
"language": "en",
|
||||
"overview": "Jigsaw and his apprentice Amanda are dead. Now, upon the news of Detective Kerry's murder, two seasoned FBI profilers, Agent Strahm and Agent Perez, arrive in the terrified community to assist the veteran Detective Hoffman in sifting through Jigsaw's latest grisly remains and piecing together the puzzle. However, when SWAT Commander Rigg is abducted and thrust into a game, the last officer untouched by Jigsaw has but ninety minutes to overcome a series of demented traps and save an old friend...or face the deadly consequences.",
|
||||
"moviesInCollection": [{ "title": "Saw", "tmdbId": 176, "owned": true, "year": 2004 }, { "title": "Saw II", "tmdbId": 215, "owned": false, "year": 2005 }, {
|
||||
"title": "Saw III",
|
||||
"tmdbId": 214,
|
||||
"owned": false,
|
||||
"year": 2006
|
||||
}, { "title": "Saw IV", "tmdbId": 663, "owned": false, "year": 2007 }, { "title": "Saw V", "tmdbId": 11917, "owned": false, "year": 2008 }, {
|
||||
"title": "Saw VI",
|
||||
"tmdbId": 22804,
|
||||
"owned": false,
|
||||
"year": 2009
|
||||
}, { "title": "Saw: The Final Chapter", "tmdbId": 41439, "owned": false, "year": 2010 }, {
|
||||
"title": "Jigsaw",
|
||||
"tmdbId": 298250,
|
||||
"owned": false,
|
||||
"year": 2017
|
||||
}, { "title": "Saw X", "tmdbId": 816240, "owned": false, "year": 0 }],
|
||||
"ratingKey": -1,
|
||||
"key": "",
|
||||
"imdbId": "tt0890870",
|
||||
"collectionTitle": "Saw Collection",
|
||||
"collectionId": 656,
|
||||
"backdropPathUrl": "https://image.tmdb.org/t/p/original//oLfS1lOmN2KIU2IQ200SDEPVEZe.jpg",
|
||||
"tmdbId": 663,
|
||||
"genres": ["Horror", "Thriller", "Crime"]
|
||||
}, {
|
||||
"name": "Saw V",
|
||||
"year": 2008,
|
||||
"posterUrl": "https://image.tmdb.org/t/p/w185//9O1PDgz8hats6MYg48dBiTtnUSy.jpg",
|
||||
"language": "en",
|
||||
"overview": "Detective Hoffman is seemingly the last person alive to carry on the Jigsaw legacy. But when his secret is threatened, he must go on the hunt to eliminate all the loose ends.",
|
||||
"moviesInCollection": [{ "title": "Saw", "tmdbId": 176, "owned": true, "year": 2004 }, { "title": "Saw II", "tmdbId": 215, "owned": false, "year": 2005 }, {
|
||||
"title": "Saw III",
|
||||
"tmdbId": 214,
|
||||
"owned": false,
|
||||
"year": 2006
|
||||
}, { "title": "Saw IV", "tmdbId": 663, "owned": false, "year": 2007 }, { "title": "Saw V", "tmdbId": 11917, "owned": false, "year": 2008 }, {
|
||||
"title": "Saw VI",
|
||||
"tmdbId": 22804,
|
||||
"owned": false,
|
||||
"year": 2009
|
||||
}, { "title": "Saw: The Final Chapter", "tmdbId": 41439, "owned": false, "year": 2010 }, {
|
||||
"title": "Jigsaw",
|
||||
"tmdbId": 298250,
|
||||
"owned": false,
|
||||
"year": 2017
|
||||
}, { "title": "Saw X", "tmdbId": 816240, "owned": false, "year": 0 }],
|
||||
"ratingKey": -1,
|
||||
"key": "",
|
||||
"imdbId": "tt1132626",
|
||||
"collectionTitle": "Saw Collection",
|
||||
"collectionId": 656,
|
||||
"backdropPathUrl": "https://image.tmdb.org/t/p/original//oLfS1lOmN2KIU2IQ200SDEPVEZe.jpg",
|
||||
"tmdbId": 11917,
|
||||
"genres": ["Horror", "Thriller", "Crime"]
|
||||
}, {
|
||||
"name": "Saw VI",
|
||||
"year": 2009,
|
||||
"posterUrl": "https://image.tmdb.org/t/p/w185//cM9G0mKHFYbXMiJPyUBUjbwKuda.jpg",
|
||||
"language": "en",
|
||||
"overview": "Special Agent Strahm is dead, and Detective Hoffman has emerged as the unchallenged successor to Jigsaw's legacy. However, when the FBI draws closer to Hoffman, he is forced to set a game into motion, and Jigsaw's grand scheme is finally understood.",
|
||||
"moviesInCollection": [{ "title": "Saw", "tmdbId": 176, "owned": true, "year": 2004 }, { "title": "Saw II", "tmdbId": 215, "owned": false, "year": 2005 }, {
|
||||
"title": "Saw III",
|
||||
"tmdbId": 214,
|
||||
"owned": false,
|
||||
"year": 2006
|
||||
}, { "title": "Saw IV", "tmdbId": 663, "owned": false, "year": 2007 }, { "title": "Saw V", "tmdbId": 11917, "owned": false, "year": 2008 }, {
|
||||
"title": "Saw VI",
|
||||
"tmdbId": 22804,
|
||||
"owned": false,
|
||||
"year": 2009
|
||||
}, { "title": "Saw: The Final Chapter", "tmdbId": 41439, "owned": false, "year": 2010 }, {
|
||||
"title": "Jigsaw",
|
||||
"tmdbId": 298250,
|
||||
"owned": false,
|
||||
"year": 2017
|
||||
}, { "title": "Saw X", "tmdbId": 816240, "owned": false, "year": 0 }],
|
||||
"ratingKey": -1,
|
||||
"key": "",
|
||||
"imdbId": "tt1233227",
|
||||
"collectionTitle": "Saw Collection",
|
||||
"collectionId": 656,
|
||||
"backdropPathUrl": "https://image.tmdb.org/t/p/original//oLfS1lOmN2KIU2IQ200SDEPVEZe.jpg",
|
||||
"tmdbId": 22804,
|
||||
"genres": ["Horror", "Mystery"]
|
||||
}, {
|
||||
"name": "Saw: The Final Chapter",
|
||||
"year": 2010,
|
||||
"posterUrl": "https://image.tmdb.org/t/p/w185//qHCZ6LjtmqWDfXXN28TlIC9OppK.jpg",
|
||||
"language": "en",
|
||||
"overview": "As a deadly battle rages over Jigsaw's brutal legacy, a group of Jigsaw survivors gathers to seek the support of self-help guru and fellow survivor Bobby Dagen, a man whose own dark secrets unleash a new wave of terror.",
|
||||
"moviesInCollection": [{ "title": "Saw", "tmdbId": 176, "owned": true, "year": 2004 }, { "title": "Saw II", "tmdbId": 215, "owned": false, "year": 2005 }, {
|
||||
"title": "Saw III",
|
||||
"tmdbId": 214,
|
||||
"owned": false,
|
||||
"year": 2006
|
||||
}, { "title": "Saw IV", "tmdbId": 663, "owned": false, "year": 2007 }, { "title": "Saw V", "tmdbId": 11917, "owned": false, "year": 2008 }, {
|
||||
"title": "Saw VI",
|
||||
"tmdbId": 22804,
|
||||
"owned": false,
|
||||
"year": 2009
|
||||
}, { "title": "Saw: The Final Chapter", "tmdbId": 41439, "owned": false, "year": 2010 }, {
|
||||
"title": "Jigsaw",
|
||||
"tmdbId": 298250,
|
||||
"owned": false,
|
||||
"year": 2017
|
||||
}, { "title": "Saw X", "tmdbId": 816240, "owned": false, "year": 0 }],
|
||||
"ratingKey": -1,
|
||||
"key": "",
|
||||
"imdbId": "tt1477076",
|
||||
"collectionTitle": "Saw Collection",
|
||||
"collectionId": 656,
|
||||
"backdropPathUrl": "https://image.tmdb.org/t/p/original//oLfS1lOmN2KIU2IQ200SDEPVEZe.jpg",
|
||||
"tmdbId": 41439,
|
||||
"genres": ["Horror", "Crime"]
|
||||
}, {
|
||||
"name": "Jigsaw",
|
||||
"year": 2017,
|
||||
"posterUrl": "https://image.tmdb.org/t/p/w185//2mUqHJG7ZiGwZYIylczFCsRPbXM.jpg",
|
||||
"language": "en",
|
||||
"overview": "Dead bodies begin to turn up all over the city, each meeting their demise in a variety of grisly ways. All investigations begin to point the finger at deceased killer John Kramer.",
|
||||
"moviesInCollection": [{ "title": "Saw", "tmdbId": 176, "owned": true, "year": 2004 }, { "title": "Saw II", "tmdbId": 215, "owned": false, "year": 2005 }, {
|
||||
"title": "Saw III",
|
||||
"tmdbId": 214,
|
||||
"owned": false,
|
||||
"year": 2006
|
||||
}, { "title": "Saw IV", "tmdbId": 663, "owned": false, "year": 2007 }, { "title": "Saw V", "tmdbId": 11917, "owned": false, "year": 2008 }, {
|
||||
"title": "Saw VI",
|
||||
"tmdbId": 22804,
|
||||
"owned": false,
|
||||
"year": 2009
|
||||
}, { "title": "Saw: The Final Chapter", "tmdbId": 41439, "owned": false, "year": 2010 }, {
|
||||
"title": "Jigsaw",
|
||||
"tmdbId": 298250,
|
||||
"owned": false,
|
||||
"year": 2017
|
||||
}, { "title": "Saw X", "tmdbId": 816240, "owned": false, "year": 0 }],
|
||||
"ratingKey": -1,
|
||||
"key": "",
|
||||
"imdbId": "tt3348730",
|
||||
"collectionTitle": "Saw Collection",
|
||||
"collectionId": 656,
|
||||
"backdropPathUrl": "https://image.tmdb.org/t/p/original//oLfS1lOmN2KIU2IQ200SDEPVEZe.jpg",
|
||||
"tmdbId": 298250,
|
||||
"genres": ["Horror", "Crime", "Mystery", "Thriller"]
|
||||
}]
|
||||
};
|
||||
|
||||
const fail = {
|
||||
'code': 41,
|
||||
'reason': 'Plex\'s library movies not found.',
|
||||
'extras': []
|
||||
}
|
||||
|
||||
export default function request(url) {
|
||||
return new Promise((resolve, reject) => {
|
||||
if (url === '/recommended/1/1') {
|
||||
process.nextTick(() => resolve(pass));
|
||||
} else {
|
||||
process.nextTick(() => reject(fail));
|
||||
}
|
||||
);
|
||||
}
|
||||
@@ -0,0 +1,43 @@
|
||||
/* global test, expect */
|
||||
|
||||
import {
|
||||
getYear, isEqual, isNotOwned,
|
||||
} from '../GapsWeb/src/main/resources/static/js/modules/common.js';
|
||||
|
||||
test('Checks for valid year', () => {
|
||||
expect(getYear(2005)).toBe(' (2005)');
|
||||
});
|
||||
|
||||
test('Checks for year 0', () => {
|
||||
expect(getYear(0)).toBe('');
|
||||
});
|
||||
|
||||
test('Checks for year -1', () => {
|
||||
expect(getYear(-1)).toBe('');
|
||||
});
|
||||
|
||||
test('Checks for no year', () => {
|
||||
expect(getYear()).toBe('');
|
||||
});
|
||||
|
||||
test('Two equal TMDB IDs', () => {
|
||||
expect(isEqual(1234567, 1234567)).toBe(true);
|
||||
});
|
||||
|
||||
test('Two unequal TMDB IDs', () => {
|
||||
expect(isEqual(1234567, 7654321)).toBe(false);
|
||||
});
|
||||
|
||||
test('Should be owned', () => {
|
||||
expect(isNotOwned(true)).toBe(false);
|
||||
});
|
||||
|
||||
test('Should not be owned', () => {
|
||||
expect(isNotOwned(false)).toBe(true);
|
||||
});
|
||||
|
||||
// async/await can also be used with `.resolves`.
|
||||
it('works with async/await and resolves', async () => {
|
||||
expect.assertions(1);
|
||||
await expect(getRecommendedMoviesForTable()).resolves.toEqual();
|
||||
});
|
||||
@@ -44,7 +44,7 @@ info:
|
||||
app:
|
||||
name: Gaps
|
||||
description: Gaps searches through your Plex Server or local folders for all movies, then queries for known movies in the same collection. If those movies don't exist in your library, Gaps will recommend getting those movies, legally of course.
|
||||
version: 0.9.5
|
||||
version: 0.9.6
|
||||
storageFolder: /{CUSTOM_FOLDER} #Change to folder that gaps has permission to read, write, and delete in.
|
||||
properties:
|
||||
rssFeed: rssFeed.json
|
||||
|
||||
@@ -11,11 +11,12 @@
|
||||
##
|
||||
|
||||
set -e
|
||||
VERSION=0.9.5
|
||||
VERSION=0.9.6
|
||||
JAR_VERSION="GapsWeb/target/GapsWeb-$VERSION.jar"
|
||||
ZIP_VERSION="GapsAsJar-$VERSION.zip"
|
||||
npm ci
|
||||
./minify
|
||||
npm run test
|
||||
mvn clean install
|
||||
docker buildx build --platform linux/s390x,linux/amd64 -t housewrecker/gaps:latest -f Dockerfile --push .
|
||||
#docker buildx build --platform linux/riscv64 -t housewrecker/gaps:risc-latest -f Dockerfile.riscv64 --push .
|
||||
|
||||
@@ -7,7 +7,7 @@ call npm run uglifyjs-pages
|
||||
call mvn clean install
|
||||
del GapsOnWindows\*.jar
|
||||
del GapsOnWindows\README.md
|
||||
copy GapsWeb\target\GapsWeb-0.9.5.jar GapsOnWindows\gaps.jar
|
||||
copy GapsWeb\target\GapsWeb-0.9.6.jar GapsOnWindows\gaps.jar
|
||||
copy README.md GapsOnWindows\
|
||||
cd GapsOnWindows
|
||||
makensis gaps.nsi
|
||||
@@ -21,7 +21,7 @@ describe('Verify About Page', () => {
|
||||
.should('have.text', 'About');
|
||||
|
||||
cy.get('.container > :nth-child(3)')
|
||||
.should('have.text', 'v0.9.5');
|
||||
.should('have.text', 'v0.9.6');
|
||||
|
||||
cy.get('.container > :nth-child(6)')
|
||||
.should('have.text', 'Software');
|
||||
|
||||
@@ -1,45 +0,0 @@
|
||||
/*
|
||||
* Copyright 2019 Jason H House
|
||||
*
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
|
||||
*
|
||||
* The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
|
||||
*
|
||||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||
*/
|
||||
|
||||
/* global cy, it, describe */
|
||||
/* eslint no-undef: "error" */
|
||||
|
||||
import { BASE_URL, spyOnAddEventListener } from '../common.spec.js';
|
||||
|
||||
describe('Verify Log In Page', () => {
|
||||
it('Default page', () => {
|
||||
cy.visit(`${BASE_URL}/login`, { onBeforeLoad: spyOnAddEventListener });
|
||||
|
||||
cy.get(':nth-child(1) > label')
|
||||
.should('have.text', 'Username');
|
||||
|
||||
cy.get(':nth-child(2) > label')
|
||||
.should('have.text', 'Password');
|
||||
|
||||
cy.get('.btn')
|
||||
.should('have.text', 'Log In');
|
||||
|
||||
cy.get('#username')
|
||||
.clear()
|
||||
.type('badUser')
|
||||
.should('have.value', 'badUser');
|
||||
|
||||
cy.get('#password')
|
||||
.clear()
|
||||
.type('password')
|
||||
.should('have.value', 'password');
|
||||
|
||||
cy.get('.btn')
|
||||
.click();
|
||||
|
||||
cy.get('.card-img-top')
|
||||
.should('be.visible');
|
||||
});
|
||||
});
|
||||
@@ -0,0 +1,12 @@
|
||||
{
|
||||
"collectCoverage": true,
|
||||
"moduleFileExtensions": [
|
||||
"js",
|
||||
"mjs"
|
||||
],
|
||||
"transform": {
|
||||
"^.+\\.js$": "babel-jest",
|
||||
"^.+\\.mjs$": "babel-jest"
|
||||
},
|
||||
"testRegex": "((\\.|/*.)(test))\\.js?$"
|
||||
}
|
||||
Generated
+4711
-1
File diff suppressed because it is too large
Load Diff
+8
-3
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "gaps",
|
||||
"version": "0.9.5",
|
||||
"version": "0.9.6",
|
||||
"description": "Gaps searches through your Plex Server or local folders for all movies, then queries for known movies in the same collection. If those movies don't exist in your library, Gaps will recommend getting those movies, legally of course.",
|
||||
"main": "/",
|
||||
"dependencies": {
|
||||
@@ -12,10 +12,14 @@
|
||||
"uglifyjs-folder": "^2.0.0"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@babel/core": "^7.14.3",
|
||||
"@babel/node": "^7.14.2",
|
||||
"@babel/preset-env": "^7.14.4",
|
||||
"cypress": "^7.4.0",
|
||||
"eslint": "^7.10.0",
|
||||
"eslint-config-airbnb-base": "^14.2.0",
|
||||
"eslint-plugin-import": "^2.22.1"
|
||||
"eslint-plugin-import": "^2.22.1",
|
||||
"jest": "^27.0.3"
|
||||
},
|
||||
"scripts": {
|
||||
"e2e": "cypress open",
|
||||
@@ -23,7 +27,8 @@
|
||||
"uglifyjs-modules": "rm -f GapsWeb/src/main/resources/static/js/modules/*.min.js && uglifyjs-folder GapsWeb/src/main/resources/static/js/modules/ -eo GapsWeb/src/main/resources/static/js/modules/\n",
|
||||
"uglifyjs-pages": "rm -f GapsWeb/src/main/resources/static/js/page/*.min.js && uglifyjs-folder GapsWeb/src/main/resources/static/js/page/ -eo GapsWeb/src/main/resources/static/js/page/\n",
|
||||
"eslint-cypress": "./node_modules/.bin/eslint --fix cypress/integration",
|
||||
"eslint-gaps": "./node_modules/.bin/eslint --fix GapsWeb/src/main/resources/static/js"
|
||||
"eslint-gaps": "./node_modules/.bin/eslint --fix GapsWeb/src/main/resources/static/js",
|
||||
"test": "jest --verbose __tests__"
|
||||
},
|
||||
"repository": {
|
||||
"type": "git",
|
||||
|
||||
@@ -17,7 +17,7 @@
|
||||
</parent>
|
||||
<groupId>com.jasonhhouse</groupId>
|
||||
<artifactId>Gaps</artifactId>
|
||||
<version>0.9.5</version>
|
||||
<version>0.9.6</version>
|
||||
<name>Gaps</name>
|
||||
<description>Demo project for Spring Boot</description>
|
||||
|
||||
@@ -26,11 +26,11 @@
|
||||
<apache.commons.lang3>3.9</apache.commons.lang3>
|
||||
<apache.commons.text>1.9</apache.commons.text>
|
||||
<commons.io>2.8.0</commons.io>
|
||||
<gaps.version>0.9.5</gaps.version>
|
||||
<gaps.version>0.9.6</gaps.version>
|
||||
<google.findbugs>3.0.0</google.findbugs>
|
||||
<guava>30.1-jre</guava>
|
||||
<hibernate.core>5.2.12.Final</hibernate.core>
|
||||
<hibernate.validator>6.1.0.Final</hibernate.validator>
|
||||
<hibernate.validator>6.1.5.Final</hibernate.validator>
|
||||
<jackson.version>2.12.1</jackson.version>
|
||||
<jakarta.xml.bind.api>2.3.2</jakarta.xml.bind.api>
|
||||
<java.version>11</java.version>
|
||||
|
||||
Reference in New Issue
Block a user