<!--
- 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.
-->

<!DOCTYPE html SYSTEM "http://www.thymeleaf.org/dtd/xhtml1-strict-thymeleaf-spring4-4.dtd">
<html lang="en" xmlns="http://www.w3.org/1999/xhtml">
<head>
    <title>Gaps</title>
    <meta content="text/html; charset=UTF-8" http-equiv="Content-Type"/>
    <link href="../static/images/gaps.ico" rel="shortcut icon"/>
    <link href="https://fonts.googleapis.com/icon?family=Material+Icons" rel="stylesheet">
    <link href="../static/css/materialize.min.css" media="screen,projection" rel="stylesheet" type="text/css"/>

    <!--Let browser know website is optimized for mobile-->
    <meta content="width=device-width, initial-scale=1.0" name="viewport"/>
</head>
<body class="grey lighten-4">
<main>
    <nav>
        <div class="nav-wrapper blue lighten-1">
            <div class="brand-logo center white-text">Gaps for Plex</div>
        </div>
    </nav>

    <br>

    <div class="container">

        <div class="fixed-action-btn">
            <a class="btn-floating btn-large teal">
                <i class="large material-icons" onclick="onSubmitGapsSearch()">send</i>
            </a>
        </div>

        <div class="row grey lighten-3">
            <form class="col s12">
                <div class="row blue lighten-2 white-text">
                    <h5 class="col s12">Gaps</h5>

                    <p class="col s12">Gaps searches through your Plex Server or 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.</p>
                </div>
                <div class="row">
                    <p class="col s12">Sets address for Gaps backend. Only change if the container doesn't run in
                        localhost.</p>
                    <div class="input-field col s2">
                        <input class="validate" id="address"
                               placeholder="8080" type="text" type="text" value="localhost">
                        <label for="address">Address*</label>
                    </div>

                    <p class="col s12">Sets port for Gaps backend. Only change if 8080 was already taken. Make sure to
                        update docker to expose the same port.</p>
                    <div class="input-field col s2">
                        <input class="validate" id="port"
                               placeholder="8080" type="text" type="number" value="8080">
                        <label for="port">Port*</label>
                    </div>

                    <p class="col s12">Go to <a href="https://www.themoviedb.org">The Movie DB</a> and make a custom
                        list
                        for Gaps https://www.themoviedb.org/list/{id_number} <br>Enter the {id_number} below if you want
                        Gaps to populate the list</p>
                    <div class="input-field col s6">
                        <input class="validate"
                               id="movie_db_list_id" placeholder="List Id" type="text">
                        <label for="movie_db_list_id">Movie Database List Id</label>
                    </div>

                    <div class="col s12">
                        <label>
                            <input checked="checked" class="filled-in" id="write_to_file" type="checkbox"/>
                            <span>Write To File</span>
                        </label>
                    </div>
                </div>
            </form>
        </div>

        <div class="row grey lighten-3">
            <form class="col s12">
                <div class="row blue lighten-2 white-text">
                    <h5 class="col s12">Plex</h5>
                    <p class="col s12">Search using Plex Movie Urls</p>
                    <label class="col s12">
                        <input checked="checked" class="filled-in" id="search_plex" onclick="searchPlexChanged(this);"
                               type="checkbox"/>
                        <span class="grey-text text-darken-3">Search Plex</span>
                    </label>
                    <p class="col s12"></p>
                </div>

                <div class="row">

                    <div class="input-field col s12">
                        <textarea
                                class="materialize-textarea"
                                id="plex_movie_urls" placeholder="Gaps supports a single movie Url or multiple. Put each Url on a new line."></textarea>
                        <label for="plex_movie_urls">Plex Movie Urls*</label>
                    </div>

                    <p class="col s12">Sets the default connect timeout for new connections. A value of 0 means no
                        timeout,
                        otherwise values must be between 1 and Integer.MAX_VALUE when converted to milliseconds.</p>
                    <div class="input-field col s2">
                        <input class="validate" id="connect_timeout" placeholder="Api Key"
                               type="text" type="number" value="180">
                        <label for="connect_timeout">Connect Timeout*</label>
                    </div>

                    <p class="col s12">Sets the default write timeout for new connections. A value of 0 means no
                        timeout,
                        otherwise values must be between 1 and Integer.MAX_VALUE when converted to milliseconds.</p>
                    <div class="input-field col s2">
                        <input class="validate" id="write_timeout" placeholder="Api Key"
                               type="text" type="number" value="180">
                        <label for="write_timeout">Write Timeout*</label>
                    </div>

                    <p class="col s12">Sets the default read timeout for new connections. A value of 0 means no timeout,
                        otherwise values must be between 1 and Integer.MAX_VALUE when converted to milliseconds.</p>
                    <div class="input-field col s2">
                        <input class="validate" id="read_timeout" placeholder="Api Key"
                               type="text" type="number" value="180">
                        <label for="read_timeout">Read Timeout*</label>
                    </div>
                </div>
            </form>
        </div>

        <!-- Modal Structure -->
        <div class="modal" id="searchModal">
            <div class="modal-content">
                <h4 id="searchModelTitle">Searching</h4>
                <div id="searchingBody"></div>
                <div class="progress" id="progressContainer">
                    <div class="determinate" id="progressBar" style="width: 0%"></div>
                </div>
            </div>
            <div class="modal-footer">
                <a class="modal-close waves-effect waves-green btn-flat" href="#!">Cancel</a>
            </div>
        </div>

    </div>
</main>
<footer class="page-footer blue lighten-2">
    <div class="container">
        <div class="row">
            <div class="col l6 s12">
                <h5 class="white-text">Gaps v0.4.5/h5>
            </div>
        </div>
    </div>
    <div class="footer-copyright">
        <div class="container">
            © 2020 Gaps
        </div>
    </div>
</footer>


<script src="../static/js/jquery-3.4.1.min.js" type="text/javascript"></script>
<script src="../static/js/sockjs-1.4.0.min.js" type="text/javascript"></script>
<script src="../static/js/stomp-2.3.3.min.js" type="text/javascript"></script>
<script src="js/folder.js" type="text/javascript"></script>
</body>
</html>
