From 33c25f61a7f619ae56c8a36a644720434008150b Mon Sep 17 00:00:00 2001 From: Justin Hartman Date: Mon, 20 Oct 2025 17:53:05 +0200 Subject: [PATCH 1/4] docs: Update README with `bun` instructions --- README.md | 31 ++++++++++++++++++------------- 1 file changed, 18 insertions(+), 13 deletions(-) diff --git a/README.md b/README.md index e835e35..29e4f33 100644 --- a/README.md +++ b/README.md @@ -68,12 +68,12 @@ To install and set up the basic project, follow these steps: 1. Clone the repository to your local machine. 2. Navigate to the project directory in your terminal. -3. Install the required dependencies by running `yarn install`. +3. Install the required dependencies by running `bun install`. 4. Rename `.env.example` to simply `.env` in the project root directory and change the following lines: - [ ] `OMDB_API_KEY=your_api_key_here` - replace `your_api_key_here` with your actual OMDB API key. - [ ] `API_PORT=3000` - replace `3000` with the port you want the node server to run on. - [ ] `APP_URL=binger.uk` - replace `binger.uk` with your website/app's live URL. -5. Start the application by running `yarn start`. +5. Start the application by running `bun start`. ### Nginx and Systemd Server Setup @@ -98,8 +98,8 @@ To get the authentication and user functionality working, make sure you've follo Application and then follow these steps. 1. Install and configure MongoDB. There are detailed instructions here: - - [Install for Debian Bookworm](./docs/mongodb/INSTALL_DEBIAN.md) found at `./docs/mongodb/INSTALL_DEBIAN.md` - - [Install for Ubuntu 20.04](./docs/mongodb/INSTALL_UBUNTU.md) found at `./docs/mongodb/INSTALL_UBUNTU.md` - note + - [Install for Debian Bookworm][install-bookworm] found at `./docs/mongodb/INSTALL_DEBIAN.md` + - [Install for Ubuntu 20.04][install-ubuntu] found at `./docs/mongodb/INSTALL_UBUNTU.md` - note that these instructions come from ChatGPT and I haven't tested them. I have a Debian server so please correct the instructions if you find any are incorrect and submit a PR. @@ -127,7 +127,7 @@ Application and then follow these steps. 3. You need to run the MongoDB migrations once you've added your MongoDB details to your `.env` file. Open up a terminal and in the project root run the following: ```bash - yarn db:migrate + bun db:migrate ``` Or if you are using NPM: ```bash @@ -135,7 +135,7 @@ Application and then follow these steps. ``` 4. With the MongoDB collection now migrated, you can begin using your app. Simply restart your node server so your - latest configs are loaded. If you've used the [systemd service file](./system/systemd/binger.service) I've supplied + latest configs are loaded. If you've used the [systemd service file][service] I've supplied at `./system/systemd/binger.service` then all you need to do is restart the service with: ```bash sudo systemctl restart binger.service @@ -148,21 +148,21 @@ Application and then follow these steps. [![code coverage][codecov-ice]][codecov-lnk] -- Run `yarn test` to execute the test suite. -- Run `yarn test:coverage` to generate coverage for the entire project. A summary will be printed to the console and full reports will be written to the `coverage/` folder (HTML, lcov, text). +- Run `bun run test` to execute the test suite. +- Run `bun test:coverage` to generate coverage for the entire project. A summary will be printed to the console and full reports will be written to the `coverage/` folder (HTML, lcov, text). ## Linting -- Run `yarn lint` to type-check all TypeScript files using the TypeScript compiler in no-emit mode and lint EJS templates. -- Run `yarn lint:ts` to type-check only the TypeScript files. -- Run `yarn lint:ejs` to lint EJS templates. +- Run `bun lint` to type-check all TypeScript files using the TypeScript compiler in no-emit mode and lint EJS templates. +- Run `bun lint:ts` to type-check only the TypeScript files. +- Run `bun lint:ejs` to lint EJS templates. ## OMDb API -Included in this repository is a [RapidAPI](https://rapidapi.com) file created by the macOS app RapidAPI which is free. +Included in this repository is a [RapidAPI][rapidapi] file created by the macOS app RapidAPI which is free. There is also a VSCode extension which should be able to work with this file but YMMV. -The file is located at [/docs/api/OMDb_API.paw](/docs/api/OMDb_API.paw) and contains a working implementation of the +The file is located at [/docs/api/OMDb_API.paw][pawapi] and contains a working implementation of the OMDb API used in this project. Open the file and begin testing the API to see responses. ## Known Issues @@ -223,3 +223,8 @@ I want a way to kill this because there's known malware in these popups! [badge-relcom]: https://img.shields.io/github/commits-since/justinhartman/imdb-app/latest [badge-tots]: https://img.shields.io/github/commit-activity/t/justinhartman/imdb-app [badge-reldate]: https://img.shields.io/github/release-date/justinhartman/imdb-app +[install-bookworm]: ./docs/mongodb/INSTALL_DEBIAN.md +[install-ubuntu]: ./docs/mongodb/INSTALL_UBUNTU.md +[pawapi]: /docs/api/OMDb_API.paw +[rapidapi]: https://rapidapi.com +[service]: ./system/systemd/binger.service From 02fd4deb55341ef4140b717d4bd40f47b8ee5a84 Mon Sep 17 00:00:00 2001 From: Justin Hartman <717118+justinhartman@users.noreply.github.com> Date: Sat, 22 Nov 2025 16:08:43 +0000 Subject: [PATCH 2/4] feat: add cinema mode toggle --- public/css/style.css | 7 +++++++ views/partials/footer.ejs | 22 ++++++++++++++++++++++ views/partials/series-buttons.ejs | 3 +++ 3 files changed, 32 insertions(+) diff --git a/public/css/style.css b/public/css/style.css index 13df34e..ef99a32 100644 --- a/public/css/style.css +++ b/public/css/style.css @@ -26,6 +26,9 @@ a.btn-primary:hover { display: flex; flex-direction: column; } +.series-layout.cinema-mode { + gap: 1rem; +} /* Home page scrolling containers with buttons. */ .scroll-row { @@ -64,6 +67,10 @@ a.btn-primary:hover { "info episodes"; column-gap: 1rem; } + .series-layout.cinema-mode { + display: flex; + flex-direction: column; + } .series-player { grid-area: player; } .series-episodes { grid-area: episodes; } .series-seasons { grid-area: seasons; } diff --git a/views/partials/footer.ejs b/views/partials/footer.ejs index 2e21b80..1f9815d 100644 --- a/views/partials/footer.ejs +++ b/views/partials/footer.ejs @@ -91,5 +91,27 @@ applyServer(next); }); })(); + + (function() { + const cinemaToggle = document.getElementById('cinema-toggle'); + const seriesLayout = document.querySelector('.series-layout'); + if (!cinemaToggle || !seriesLayout) return; + + const updateCinemaToggle = (enabled) => { + cinemaToggle.innerHTML = ` ${enabled ? 'Cinema Off' : 'Cinema On'}`; + cinemaToggle.classList.toggle('btn-warning', enabled); + cinemaToggle.classList.toggle('text-dark', enabled); + cinemaToggle.classList.toggle('btn-outline-warning', !enabled); + seriesLayout.classList.toggle('cinema-mode', enabled); + }; + + updateCinemaToggle(seriesLayout.classList.contains('cinema-mode')); + + cinemaToggle.addEventListener('click', (event) => { + event.preventDefault(); + const enableCinema = !seriesLayout.classList.contains('cinema-mode'); + updateCinemaToggle(enableCinema); + }); + })(); diff --git a/views/partials/series-buttons.ejs b/views/partials/series-buttons.ejs index 79bcf78..3cc8805 100644 --- a/views/partials/series-buttons.ejs +++ b/views/partials/series-buttons.ejs @@ -31,6 +31,9 @@ if (episodeNum >= maxEpisodes) {
Previous + <% if (server2Src && server2Src.trim() !== '') { -%> Server <%= currentServer === '1' ? '2' : '1' %> From 44f69255de6df37728e4ea4a007bd7a3b04b7afe Mon Sep 17 00:00:00 2001 From: Justin Hartman <717118+justinhartman@users.noreply.github.com> Date: Sun, 23 Nov 2025 11:27:30 +0000 Subject: [PATCH 3/4] fix: correct cinema layout grid --- public/css/style.css | 15 +++++++++++---- views/view.ejs | 12 +++++++----- 2 files changed, 18 insertions(+), 9 deletions(-) diff --git a/public/css/style.css b/public/css/style.css index ef99a32..a1c9657 100644 --- a/public/css/style.css +++ b/public/css/style.css @@ -26,8 +26,8 @@ a.btn-primary:hover { display: flex; flex-direction: column; } -.series-layout.cinema-mode { - gap: 1rem; +.series-controls { + width: 100%; } /* Home page scrolling containers with buttons. */ @@ -63,15 +63,22 @@ a.btn-primary:hover { grid-template-columns: 2fr 1fr; grid-template-areas: "player episodes" + "controls episodes" "seasons episodes" "info episodes"; column-gap: 1rem; } .series-layout.cinema-mode { - display: flex; - flex-direction: column; + grid-template-columns: 3fr 2fr; + grid-template-areas: + "player player" + "controls controls" + "seasons episodes" + "info episodes"; + row-gap: 1rem; } .series-player { grid-area: player; } + .series-controls { grid-area: controls; } .series-episodes { grid-area: episodes; } .series-seasons { grid-area: seasons; } .series-info { grid-area: info; } diff --git a/views/view.ejs b/views/view.ejs index 637baa6..7a759ed 100644 --- a/views/view.ejs +++ b/views/view.ejs @@ -60,12 +60,8 @@
-
+
<% for (let s = 1; s <= seriesDetail.totalSeasons; s++) { %> @@ -94,6 +90,12 @@
<% } -%> +
+ <% const currentSeason = seriesDetail.currentSeason || { episodes: [] }; %> + <% currentSeason.episodes.forEach(ep => { %> + <%= ep.episode %>. <%= ep.title || `Episode ${ep.episode}` %> + <% }) %> +
<% } else { %>
From db86e84627eb2836de8740d3a597a7c2cd2112f1 Mon Sep 17 00:00:00 2001 From: Justin Hartman <717118+justinhartman@users.noreply.github.com> Date: Sun, 23 Nov 2025 12:14:53 +0000 Subject: [PATCH 4/4] fix: update cinema toggle styling --- views/partials/footer.ejs | 4 ++-- views/partials/series-buttons.ejs | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/views/partials/footer.ejs b/views/partials/footer.ejs index 1f9815d..d9b3a48 100644 --- a/views/partials/footer.ejs +++ b/views/partials/footer.ejs @@ -99,9 +99,9 @@ const updateCinemaToggle = (enabled) => { cinemaToggle.innerHTML = ` ${enabled ? 'Cinema Off' : 'Cinema On'}`; - cinemaToggle.classList.toggle('btn-warning', enabled); + cinemaToggle.classList.toggle('bg-info', enabled); cinemaToggle.classList.toggle('text-dark', enabled); - cinemaToggle.classList.toggle('btn-outline-warning', !enabled); + cinemaToggle.classList.toggle('bg-info-subtle', !enabled); seriesLayout.classList.toggle('cinema-mode', enabled); }; diff --git a/views/partials/series-buttons.ejs b/views/partials/series-buttons.ejs index 3cc8805..7f570cc 100644 --- a/views/partials/series-buttons.ejs +++ b/views/partials/series-buttons.ejs @@ -31,7 +31,7 @@ if (episodeNum >= maxEpisodes) {
Previous - <% if (server2Src && server2Src.trim() !== '') { -%>