Skip to content

Commit

Permalink
added - list all shows and movies option
Browse files Browse the repository at this point in the history
  • Loading branch information
petersem committed Jan 29, 2024
1 parent a6c1c12 commit 41f69c8
Show file tree
Hide file tree
Showing 7 changed files with 54 additions and 4 deletions.
3 changes: 2 additions & 1 deletion index.js
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ async function GetMovies(genre) {
console.log('✅ Starting process to get movie data for lists');
let rdr = new radarr(radarrUrl, radarrToken);
movies = await rdr.GetMovies(genre);
//discreteMovieList = movies;
console.log(movies.length, "matching movies returned");
distinctMovieGenres = await Promise.resolve(rdr.genreList.sort());
console.log('✅ Movie genre list created');
Expand Down Expand Up @@ -82,7 +83,7 @@ app.get("/", (req, res) => {
res.sendStatus(401);
}
else{
res.render('index',{radarr: distinctMovieGenres, sonarr: distinctShowGenres, token: token});
res.render('index',{radarr: distinctMovieGenres, sonarr: distinctShowGenres, token: token, movies: movies, shows: shows});
}
});

Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "exportarr",
"version": "1.0.0",
"version": "1.1.0",
"description": "Export radarr list as custom stephen lu format feeds, for import into other radarr apps",
"main": "index.js",
"nodemonConfig": {
Expand Down
4 changes: 4 additions & 0 deletions public/css/styles.css
Original file line number Diff line number Diff line change
Expand Up @@ -35,3 +35,7 @@ a.alert-link {
color: #6c757d;
opacity: .5;
}

li.title {
color: rgb(140, 143, 143);
}
12 changes: 12 additions & 0 deletions public/js/script.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
function hideElement() {
document.getElementById("full-list1").style.display = "none";
document.getElementById("full-list2").style.display = "none";
}

function showElement() {
document.getElementById("full-list1").style.display = "block";
document.getElementById("full-list1").style.visibility = "visible";
document.getElementById("full-list2").style.display = "block";
document.getElementById("full-list2").style.visibility = "visible";
}

31 changes: 31 additions & 0 deletions views/exportarr.ejs
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@

<div class="container py-4">
<div class="bg-light rounded-3">
<div class="container-fluid py-5 banners">
Expand Down Expand Up @@ -48,7 +49,37 @@
</ul>
</div>
</div>

<div class="col-12">
<h2>Full list of titles (for reference)</h2>
<button class="ws-btn w3-block" onclick="showElement()">Show</button>
<button class="ws-btn w3-block" onclick="hideElement()">Hide</button>
</div>

<div class="col-6" id="full-list1" style="display: none;">
<!-- method 1 - sizing classes -->
<div class="list-group d-flex flex-row ">
<ul>
<% movies.forEach(function(movie) { %>
<li class="title"><%=movie.title%> - (<%=movie.genres%>)</a></li>
<%});%>
</ul>
</div>
</div>

<div class="col-6" id="full-list2" style="display: none;">
<!-- method 1 - sizing classes -->
<div class="list-group d-flex flex-row ">
<ul>
<% shows.forEach(function(show) { %>
<li class="title"><%=show.title%> - (<%=show.genres%>)</a></li>
<%});%>
</ul>
</div>
</div>

</div>



<!-- [{ "tvdbId": "75837" }, { "tvdbId": "77847" }, { "tvdbId": "78299" }, { "tvdbId": "72756" } ] -->
4 changes: 3 additions & 1 deletion views/header.ejs
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,9 @@
<link rel="stylesheet" href="/css/font-awesome.min.css">
<link rel="stylesheet" href="/css/styles.css">
<link rel="stylesheet" href="/css/light.min.css">
<!-- <script src="/js/script.js"></script> -->
<script src="/js/script.js"></script>



<title>Exportarr</title>
</head>
Expand Down
2 changes: 1 addition & 1 deletion views/index.ejs
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
<%- include('header.ejs') %>
<%- include('exportarr.ejs', {radarr, sonarr, token}) %>
<%- include('exportarr.ejs', {radarr, sonarr, token, movies, shows}) %>
<%- include('footer.ejs') %>

0 comments on commit 41f69c8

Please sign in to comment.