aboutsummaryrefslogtreecommitdiffhomepage
path: root/index.html
blob: 9339aaeb11ca51314719e941439d10d8de208c67 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
<!doctype html>
<html lang="en">

<head></head>
    <title>PASTA | Plex Audio and Subtitle Track Automator</title>

    <!-- Required meta tags -->
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">

    <!-- Bootstrap CSS -->
    <link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/4.3.1/css/bootstrap.min.css"
        integrity="sha384-ggOyR0iXCbMQv3Xipma34MD+dH/1fQ784/j6cY/iJTQUOhcWr7x9JvoRxT2MZw1T" crossorigin="anonymous">
    <link rel="stylesheet" href="css/main.css" />

    <!-- Font Awesome CSS -->
    <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/5.11.2/css/all.css"
        integrity="sha256-46qynGAkLSFpVbEBog43gvNhfrOj+BmwXdxFgVK/Kvc=" crossorigin="anonymous" />

    <!--<link rel="icon" type="image/png" href="images/favicon.png">-->

    <!-- jQuery first, then Popper.js, then Bootstrap JS -->
    <script src="https://code.jquery.com/jquery-3.4.1.min.js"
        integrity="sha256-CSXorXvZcTkaix6Yvo6HppcZGetbYMGWSFlBw8HfCJo=" crossorigin="anonymous"></script>
    <script src="https://cdnjs.cloudflare.com/ajax/libs/popper.js/1.14.7/umd/popper.min.js"
        integrity="sha384-UO2eT0CpHqdSJQ6hJty5KVphtPhzWj9WO1clHTMGa3JDZwrnQq4sF86dIHNDz0W1"
        crossorigin="anonymous"></script>
    <script src="https://stackpath.bootstrapcdn.com/bootstrap/4.3.1/js/bootstrap.min.js"
        integrity="sha384-JjSmVgyd0p3pXB1rRibZUAYoIIy6OrQ6VrjIEaFf/nJGzIxFDsf4x0xIM+B07jRM"
        crossorigin="anonymous"></script>

    <!-- Font Awesome JS -->
    <script src="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/5.11.2/js/all.min.js"
        integrity="sha256-qM7QTJSlvtPSxVRjVWNM2OfTAz/3k5ovHOKmKXuYMO4=" crossorigin="anonymous"></script>

    <!-- Custom Scripts -->
    <script type="text/javascript" src="js/main.js"></script>
</head>

<body>
    <!-- Navigation -->
    <nav class="navbar navbar-expand-lg navbar-dark static-top">
        <div class="container">
            <a class="navbar-brand" href="javascript:window.location.reload()">
                <h2>PASTA<small class="ml-2">Plex Audio and Subtitle Track Automation</small></h2>
            </a>
            <i class="far fa-question-circle" style="color: #e5a00d; font-size: 1.5em"></i>
        </div>
    </nav>

    <!-- Modal -->
    <div class="modal fade" id="progressModal" tabindex="-1" role="dialog" aria-labelledby="exampleModalCenterTitle"
        aria-hidden="true">
        <div class="modal-dialog modal-xl modal-dialog-centered" role="document">
            <div class="modal-content">
                <div class="modal-header">
                    <h5 class="modal-title" id="progressModalTitle"></h5>
                    <button type="button" class="close" data-dismiss="modal" aria-label="Close">
                        <span aria-hidden="true">&times;</span>
                    </button>
                </div>
                <div id="modalBodyText" class="modal-body">

                </div>
                <div class="modal-footer">
                    <button type="button" class="btn btn-secondary" data-dismiss="modal">Close</button>
                </div>
            </div>
        </div>
    </div>

    <!-- Page Content -->
    <div class="container">
        <div class="card border-0 shadow my-3 my-md-5">
            <div class="card-body p-3 p-md-5">

                <!-- TABS -->
                <ul class="nav nav-tabs" id="myTab" role="tablist">
                    <li class="nav-item">
                        <a class="nav-link active" id="authentication-tab" data-toggle="tab" href="#authentication"
                            role="tab" aria-controls="authentication" aria-selected="true">Authentication</a>
                    </li>
                    <li class="nav-item">
                        <a class="nav-link" id="series-tab" data-toggle="tab" href="#series" role="tab"
                            aria-controls="series" aria-selected="false">Series</a>
                    </li>
                    <li class="nav-item">
                        <a class="nav-link" id="episodes-tab" data-toggle="tab" href="#episodes" role="tab"
                            aria-controls="episodes" aria-selected="false">Episodes</a>
                    </li>
                </ul>
                <!-- / TABS -->

                <!-- TAB CONTENT -->
                <div class="tab-content" id="myTabContent">
                    <div class="tab-pane fade show active" id="authentication" role="tabpanel"
                        aria-labelledby="authentication-tab">
                        <!-- PLEX LOGIN FORM -->
                        <div class="row mt-3">
                            <div class="col">
                                <div id="insecureWarning" class="alert alert-warning alert-dismissible fade show mt-3" role="alert">
                                    <strong>Warning:</strong> You have loaded this page over <strong>http</strong>, which means that this may not be very secure, especially if you are using public or untrusted networks.
                                    <br>If you can only access your Plex server via http, then please continue with caution.
                                    <br>However, if you can access your Plex server via <strong>https</strong>, then I recommend reloading this site over https by <a href="https://www.pastatool.com">clicking here</a>.
                                    <button type="button" class="close" data-dismiss="alert" aria-label="Close">
                                        <span aria-hidden="true">&times;</span>
                                    </button>
                                </div>
                                <div class="form-group">
                                    <label for="plexUrl">Plex URL</label>
                                    <input type="email" class="form-control" id="plexUrl"
                                        placeholder="e.g. http://192.168.0.1:32400" autocomplete="on">
                                    <small class="form-text text-muted">This must be a local server, or a server
                                        publicly addressable.</small>
                                </div>
                                <div class="form-group">
                                    <label for="plexToken">Plex Token</label>
                                    <input type="text" class="form-control" id="plexToken" placeholder="X-Plex-Token" autocomplete="on">
                                    <small class="form-text text-muted">
                                        <a target="_blank"
                                            href="https://support.plex.tv/articles/204059436-finding-an-authentication-token-x-plex-token/">Find
                                            out how to get your X-Plex-token here.</a>
                                    </small>
                                </div>
                                <button id="btnConnectToPlex" class="btn btn-secondary" onclick="connectToPlex()"
                                    disabled>Connect to Plex</button>
                            </div>
                        </div>
                        <!-- / PLEX LOGIN FORM -->

                        <!-- PLEX AUTHENTICATION WARNING -->
                        <div class="row">
                            <div class="col" id="authWarningText">

                            </div>
                        </div>
                        <!-- / PLEX AUTHENTICATION WARNING -->

                        <!-- LIBRARIES TABLE -->
                        <div class="row mt-4">
                            <div class="col">
                                <h3>Plex Libraries</h3>
                                <small>Choose <strong>only</strong> TV Shows. This will not work for Movies.</small>
                                <div class="table-responsive">
                                    <table id="libraryTable" class="table table-hover mt-3">
                                        <thead>
                                            <tr>
                                                <th scope="col">Name</th>
                                            </tr>
                                        </thead>
                                        <tbody>

                                        </tbody>
                                    </table>
                                </div>
                            </div>
                        </div>
                        <!-- / LIBRARIES TABLE -->
                    </div>
                    <div class="tab-pane fade" id="series" role="tabpanel" aria-labelledby="series-tab">
                        <!-- ALPHABET LIBRARY -->
                        <div class="row mt-3">
                            <div class="col text-center">
                                <div id="alphabetGroup" class="btn-group flex-wrap" role="group"
                                    aria-label="TV Library First Letter">
                                    <!-- set class "disabled" for buttons which are not active -->
                                    <button id="btnHash" disabled type="button" class="btn btn-outline-dark"
                                        onclick="getLibraryByLetter(this)">#</button>
                                    <button id="btnA" disabled type="button" class="btn btn-outline-dark"
                                        onclick="getLibraryByLetter(this)">A</button>
                                    <button id="btnB" disabled type="button" class="btn btn-outline-dark"
                                        onclick="getLibraryByLetter(this)">B</button>
                                    <button id="btnC" disabled type="button" class="btn btn-outline-dark"
                                        onclick="getLibraryByLetter(this)">C</button>
                                    <button id="btnD" disabled type="button" class="btn btn-outline-dark"
                                        onclick="getLibraryByLetter(this)">D</button>
                                    <button id="btnE" disabled type="button" class="btn btn-outline-dark"
                                        onclick="getLibraryByLetter(this)">E</button>
                                    <button id="btnF" disabled type="button" class="btn btn-outline-dark"
                                        onclick="getLibraryByLetter(this)">F</button>
                                    <button id="btnG" disabled type="button" class="btn btn-outline-dark"
                                        onclick="getLibraryByLetter(this)">G</button>
                                    <button id="btnH" disabled type="button" class="btn btn-outline-dark"
                                        onclick="getLibraryByLetter(this)">H</button>
                                    <button id="btnI" disabled type="button" class="btn btn-outline-dark"
                                        onclick="getLibraryByLetter(this)">I</button>
                                    <button id="btnJ" disabled type="button" class="btn btn-outline-dark"
                                        onclick="getLibraryByLetter(this)">J</button>
                                    <button id="btnK" disabled type="button" class="btn btn-outline-dark"
                                        onclick="getLibraryByLetter(this)">K</button>
                                    <button id="btnL" disabled type="button" class="btn btn-outline-dark"
                                        onclick="getLibraryByLetter(this)">L</button>
                                    <button id="btnM" disabled type="button" class="btn btn-outline-dark"
                                        onclick="getLibraryByLetter(this)">M</button>
                                    <button id="btnN" disabled type="button" class="btn btn-outline-dark"
                                        onclick="getLibraryByLetter(this)">N</button>
                                    <button id="btnO" disabled type="button" class="btn btn-outline-dark"
                                        onclick="getLibraryByLetter(this)">O</button>
                                    <button id="btnP" disabled type="button" class="btn btn-outline-dark"
                                        onclick="getLibraryByLetter(this)">P</button>
                                    <button id="btnQ" disabled type="button" class="btn btn-outline-dark"
                                        onclick="getLibraryByLetter(this)">Q</button>
                                    <button id="btnR" disabled type="button" class="btn btn-outline-dark"
                                        onclick="getLibraryByLetter(this)">R</button>
                                    <button id="btnS" disabled type="button" class="btn btn-outline-dark"
                                        onclick="getLibraryByLetter(this)">S</button>
                                    <button id="btnT" disabled type="button" class="btn btn-outline-dark"
                                        onclick="getLibraryByLetter(this)">T</button>
                                    <button id="btnU" disabled type="button" class="btn btn-outline-dark"
                                        onclick="getLibraryByLetter(this)">U</button>
                                    <button id="btnV" disabled type="button" class="btn btn-outline-dark"
                                        onclick="getLibraryByLetter(this)">V</button>
                                    <button id="btnW" disabled type="button" class="btn btn-outline-dark"
                                        onclick="getLibraryByLetter(this)">W</button>
                                    <button id="btnX" disabled type="button" class="btn btn-outline-dark"
                                        onclick="getLibraryByLetter(this)">X</button>
                                    <button id="btnY" disabled type="button" class="btn btn-outline-dark"
                                        onclick="getLibraryByLetter(this)">Y</button>
                                    <button id="btnZ" disabled type="button" class="btn btn-outline-dark"
                                        onclick="getLibraryByLetter(this)">Z</button>
                                </div>
                            </div>
                        </div>
                        <!-- / ALPHABET LIBRARY -->

                        <!-- SHOWS TABLE -->
                        <div class="row mt-4">
                            <div class="col">
                                <h3>TV Series</h3>
                                <div class="table-responsive">
                                    <table id="tvShowsTable" class="table table-hover mt-3">
                                        <thead>
                                            <tr>
                                                <th scope="col">Title</th>
                                                <th scope="col">Year</th>
                                            </tr>
                                        </thead>
                                        <tbody>

                                        </tbody>
                                    </table>
                                </div>
                            </div>
                        </div>
                        <!-- / SHOWS TABLE -->
                    </div>
                    <div class="tab-pane fade" id="episodes" role="tabpanel" aria-labelledby="episodes-tab">
                        <!-- SEASONS TABLE -->
                        <div class="row mt-3">
                            <div class="col">
                                <h3>Seasons</h3>
                                <div class="table-responsive">
                                    <table id="seasonsTable" class="table table-hover mt-3">
                                        <thead>
                                            <tr>
                                                <th scope="col">Title</th>
                                            </tr>
                                        </thead>
                                        <tbody>

                                        </tbody>
                                    </table>
                                </div>
                            </div>
                        </div>
                        <!-- / SHOWS TABLE -->

                        <!-- EPISODES TABLE -->
                        <div class="row mt-4">
                            <div class="col">
                                <h3>Episodes</h3>
                                <div class="table-responsive">
                                    <table id="episodesTable" class="table table-hover mt-3">
                                        <thead>
                                            <tr>
                                                <th scope="col">Title</th>
                                            </tr>
                                        </thead>
                                        <tbody>

                                        </tbody>
                                    </table>
                                </div>
                            </div>
                        </div>
                        <!-- / EPISODES TABLE -->

                        <!-- SWITCH TOGGLE -->
                        <div class="row mt-4">
                            <div class="col text-center">
                                <div id="episodeOrSeriesBtns" class="btn-group btn-group-toggle" data-toggle="buttons">
                                    <label class="btn btn-secondary active">
                                        <input type="radio" name="episodeOrSeries" id="singleEpisode" autocomplete="off"
                                            checked> Single Episode
                                    </label>
                                    <label class="btn btn-secondary">
                                        <input type="radio" name="episodeOrSeries" id="entireSeries" autocomplete="off">
                                        Entire Series
                                    </label>
                                </div>
                            </div>
                        </div>
                        <!-- / SWITCH TOGGLE -->

                        <!-- STREAMS TABLES -->
                        <div class="row mt-4">
                            <div class="col">
                                <h3>Audio Tracks</h3>
                                <div class="table-responsive">
                                    <table id="audioTable" class="table table-hover table-sm mt-3">
                                        <thead>
                                            <tr>
                                                <th scope="col">Name</th>
                                                <th scope="col">Title</th>
                                                <th scope="col">Language</th>
                                                <th scope="col">Code</th>
                                            </tr>
                                        </thead>
                                        <tbody>

                                        </tbody>
                                    </table>
                                </div>
                            </div>
                            <div class="col">
                                <h3>Subtitle Tracks</h3>
                                <div class="table-responsive">
                                    <table id="subtitleTable" class="table table-hover table-sm mt-3">
                                        <thead>
                                            <tr>
                                                <th scope="col">Name</th>
                                                <th scope="col">Title</th>
                                                <th scope="col">Language</th>
                                                <th scope="col">Code</th>
                                            </tr>
                                        </thead>
                                        <tbody>

                                        </tbody>
                                    </table>
                                </div>
                            </div>
                        </div>
                        <!-- / STREAMS TABLES -->
                    </div>
                </div>
                <!-- / TAB CONTENT -->
            </div>
        </div>
    </div>
</body>

</html>