Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 11 additions & 11 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,24 +3,24 @@

> **About this repository**
> **PosterX** is an **AI-assisted fork** of [Posterr](https://github.com/petersem/posterr) by **binarygeek119**. Upstream owns the original design and core product; this repo adds the features in **New in this fork** below.
> **Source:** [github.com/binarygeek119/posterr](https://github.com/binarygeek119/posterr) · **Docker image:** [`binarygeek119/posterrx`](https://hub.docker.com/r/binarygeek119/posterrx) (`:latest` / `:testing` from CI)
> **Source:** [github.com/binarygeek119/posterrX](https://github.com/binarygeek119/posterrX) · **Docker image:** [`binarygeek119/posterrx`](https://hub.docker.com/r/binarygeek119/posterrx) (`:latest` / `:testing` from CI)
> **Sister project:** [binarygeek119/ubuntudisplayos](https://github.com/binarygeek119/ubuntudisplayos) for Ubuntu-based multi-display kiosk hosts that pair well with PosterX.

![GitHub stars](https://img.shields.io/github/stars/binarygeek119/posterr?style=flat)
![Fork version](https://img.shields.io/github/package-json/v/binarygeek119/posterr?label=version&logoColor=blue)
![Last commit](https://img.shields.io/github/last-commit/binarygeek119/posterr)
![Docker Pulls](https://img.shields.io/docker/pulls/binarygeek119/posterr)
![Docker image size](https://img.shields.io/docker/image-size/binarygeek119/posterr/latest?logo=docker)
![GitHub stars](https://img.shields.io/github/stars/binarygeek119/posterrX?style=flat)
![Fork version](https://img.shields.io/github/package-json/v/binarygeek119/posterrX?label=version&logoColor=blue)
![Last commit](https://img.shields.io/github/last-commit/binarygeek119/posterrX)
![Docker Pulls](https://img.shields.io/docker/pulls/binarygeek119/posterrx)
![Docker image size](https://img.shields.io/docker/image-size/binarygeek119/posterrx/latest?logo=docker)
![Platforms](https://img.shields.io/badge/platform-docker-blue)
[![Upstream wiki](https://img.shields.io/badge/upstream-wiki-informational?logo=github)](https://github.com/petersem/posterr/wiki/Posterr-Configuration)

![Slides](https://github.com/petersem/posterr/blob/master/doco/posterr.jpg?raw=true)
![Awtrix](https://github.com/petersem/posterr/blob/master/doco/awtrix.gif?raw=true)

**PosterX maintainer Discord:** [https://discord.gg/vftKQvpT](https://discord.gg/vftKQvpT) — updates and limited support for this fork.
**PosterX maintainer Discord:** [https://discord.gg/AEhVjqX4Af](https://discord.gg/AEhVjqX4Af) — updates and limited support for this fork.
Original Posterr community Discord: [https://discord.gg/TcnEkMEf9J](https://discord.gg/TcnEkMEf9J).
Please do not ask the original Posterr developer for support when using PosterX.
For fork support, use GitHub: [https://github.com/binarygeek119/posterr](https://github.com/binarygeek119/posterr).
For fork support, use GitHub: [https://github.com/binarygeek119/posterrX](https://github.com/binarygeek119/posterrX).
**Default settings password:** `raidisnotabackup`

---
Expand Down Expand Up @@ -54,7 +54,7 @@ These are additions on top of upstream behaviour (current fork **`package.json`*
| Area | What changed |
|------|----------------|
| **Release notice** | After an upgrade, a **red banner** on the **home poster view**, **`/now-showing`**, and **settings** pages reminds you that new features shipped. It clears after you open **Settings** and click **Acknowledge there are new features**. Your choice is stored in `settings.json` (`newFeaturesAcknowledgedVersion`); the banner comes back when the app **version string** in `package.json` changes again (any **X.Y.Z** bump). |
| **Settings → About** | Identifies this app as **PosterX** (a **binarygeek119** fork of Posterr), **purely AI-modified**, with a link to **[github.com/binarygeek119/posterr](https://github.com/binarygeek119/posterr)**. Original author credits and upstream links stay in the same tab. |
| **Settings → About** | Identifies this app as **PosterX** (a **binarygeek119** fork of Posterr), **purely AI-modified**, with a link to **[github.com/binarygeek119/posterrX](https://github.com/binarygeek119/posterrX)**. Original author credits and upstream links stay in the same tab. |
| **Settings navigation** | **Sync**, **Cache**, **Now Showing**, and **TMDB API** pages use the **same sidebar and mobile icons** as each other, including **Debug** and **About**, so entries no longer disappear when you switch pages. |
| **Ads (main deck + `/settings/ads`)** | When **Enabled**, ad slides rotate with the home posters (**every *n* posters**, optional **only show ads**). Upload images, prices, and optional per-slide backgrounds; metadata in **`config/ads.db`**, files under **`config/ads`**. |
| **Dedicated `/ads` view** | Full-screen ad slideshow: **seconds per ad** advances each slide; **seconds on full `/ads` page before returning home** is separate (`0` = manual leave; otherwise **30–86400** seconds then redirect to **`/`**). Optional backdrop from **`config/ads-view`** (`**/custom/ads-view/**`). |
Expand Down Expand Up @@ -239,10 +239,10 @@ Should you encounter a problem, the solution may be listed [HERE](https://github

---
## Support
- **PosterX maintainer Discord:** [https://discord.gg/vftKQvpT](https://discord.gg/vftKQvpT) (this fork).
- **PosterX maintainer Discord:** [https://discord.gg/AEhVjqX4Af](https://discord.gg/AEhVjqX4Af) (this fork).
- Original Posterr community: [https://discord.gg/TcnEkMEf9J](https://discord.gg/TcnEkMEf9J).
- Do not ask the original Posterr developer for support when using PosterX.
- For fork support, use GitHub: [https://github.com/binarygeek119/posterr](https://github.com/binarygeek119/posterr).
- For fork support, use GitHub: [https://github.com/binarygeek119/posterrX](https://github.com/binarygeek119/posterrX).

---
### Support my efforts and continued development
Expand Down
36 changes: 33 additions & 3 deletions classes/mediaservers/embyJellyfinBase.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
const axios = require("axios");
const http = require("http");
const https = require("https");
const fs = require("fs");
const path = require("path");
const mediaCard = require("./../cards/MediaCard");
Expand Down Expand Up @@ -145,6 +147,19 @@ const LIBRARY_ITEMS_FIRST_PAGE_HTTP_RETRIES = (() => {
return 1;
})();

/**
* Pooled keep-alive agents + explicit Accept-Encoding reduce flaky Node/axios 0.27 “maxContentLength
* size of -1 exceeded” errors (misleading message when the response stream aborts; see axios#4806).
*/
const _EMBY_JF_HTTP_AGENT = new http.Agent({
keepAlive: true,
maxSockets: 64,
});
const _EMBY_JF_HTTPS_AGENT = new https.Agent({
keepAlive: true,
maxSockets: 64,
});

function _axiosErrCode(e) {
if (!e || typeof e !== "object") return "";
if (e.code != null) return String(e.code);
Expand Down Expand Up @@ -180,6 +195,13 @@ function _axiosErrorIsRetriableNetwork(e) {
);
}

/** Axios 0.27 node adapter: stream abort is often reported as “maxContentLength size of -1 exceeded”. */
function _axiosErrorIsMisleadingMaxContentLengthAbort(e) {
const msg = String((e && e.message) || "").toLowerCase();
if (!msg.includes("maxcontentlength")) return false;
return msg.includes("-1") || msg.includes("infinity");
}

/**
* Same filtering as the legacy “load entire library then filter” path, applied to one page of Items.
* @param {object[]} items
Expand Down Expand Up @@ -430,15 +452,22 @@ class EmbyJellyfinBase {
while (true) {
try {
const res = await axios.get(url, {
headers,
headers: {
...headers,
"Accept-Encoding": "gzip, deflate",
Connection: "keep-alive",
},
timeout: timeoutMs,
httpAgent: _EMBY_JF_HTTP_AGENT,
httpsAgent: _EMBY_JF_HTTPS_AGENT,
});
return res.data;
} catch (e) {
const canRetry =
attempt < maxRetries &&
(_axiosErrorIsRetriableTimeout(e) ||
_axiosErrorIsRetriableNetwork(e));
_axiosErrorIsRetriableNetwork(e) ||
_axiosErrorIsMisleadingMaxContentLengthAbort(e));
if (canRetry) {
attempt++;
const backoffMs = Math.min(
Expand Down Expand Up @@ -2125,7 +2154,8 @@ class EmbyJellyfinBase {
e &&
(e.code === "ECONNABORTED" ||
msg.includes("timeout") ||
status >= 500);
status >= 500 ||
_axiosErrorIsMisleadingMaxContentLengthAbort(e));
if (isFirstPageFallbackCandidate && isRetriableFirstPageError) {
const halved = Math.floor(pageLimit / 2);
firstPageLimit = Math.max(
Expand Down
2 changes: 1 addition & 1 deletion myviews/debug.ejs
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
<h1> <i class="fal fa-debug" style="font-size: 48px; color:forestgreen;"></i> PosterX Debug Page</h1>
</br>
<p>Use this page to help debug any connectivity issues with PosterX</p>
<p class="text-muted">Support (maintainer): <a href="https://discord.gg/vftKQvpT" target="_blank" rel="noopener noreferrer">Discord — discord.gg/vftKQvpT</a></p>
<p class="text-muted">Support (maintainer): <a href="https://discord.gg/AEhVjqX4Af" target="_blank" rel="noopener noreferrer">Discord — discord.gg/AEhVjqX4Af</a></p>
</br>
<h3>Software Version</h3>
<p>PosterX Verson: <%=version%></p>
Expand Down
2 changes: 1 addition & 1 deletion myviews/logon.ejs
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ color: whitesmoke;
<div style="color: lightgoldenrodyellow;">
<h1>PosterX Settings</h1>
<p class="lead">Media display software for Plex, Jellyfin, Emby, Kodi, Sonarr, Radarr, Lidarr, and Readarr.</p>
<p class="small"><a href="https://discord.gg/vftKQvpT" target="_blank" rel="noopener noreferrer">PosterX Discord (support)</a></p>
<p class="small"><a href="https://discord.gg/AEhVjqX4Af" target="_blank" rel="noopener noreferrer">PosterX Discord (support)</a></p>
</div>

<form method="POST" action="<%=baseUrl%>/logon">
Expand Down
10 changes: 6 additions & 4 deletions myviews/settings.ejs
Original file line number Diff line number Diff line change
Expand Up @@ -1467,7 +1467,8 @@
<h5>ABOUT POSTERX <span class="text-muted font-weight-normal">v<%= version %></span></h5>
<div class="alert alert-secondary mb-3" role="note">
<p class="mb-1"><strong>PosterX</strong> is a fork of <a href="https://github.com/petersem/posterr" target="_blank" rel="noopener noreferrer">Posterr</a> (Matt Petersen). This build is maintained by <strong>binarygeek119</strong>.</p>
<p class="mb-1 small"><a href="https://github.com/binarygeek119/posterr" target="_blank" rel="noopener noreferrer">GitHub — binarygeek119/posterr</a></p>
<p class="mb-1 small"><a href="https://github.com/binarygeek119/posterrX" target="_blank" rel="noopener noreferrer">GitHub — binarygeek119/posterrX</a></p>
<p class="mb-1 small">Sister project: <a href="https://github.com/binarygeek119/ubuntudisplayos" target="_blank" rel="noopener noreferrer">binarygeek119/ubuntudisplayos</a> — Ubuntu-based multi-display kiosk hosts that pair well with PosterX.</p>
<p class="mb-0 small text-muted">This fork is purely AI-modified.</p>
</div>
<p><b>Support my efforts and continued development.</b></br> <a
Expand Down Expand Up @@ -1495,12 +1496,13 @@
<label class="d-block" style="text-decoration: underline;">Project Details</label>
<p>
<ul>
<li>PosterX maintainer Discord (this fork): <a href="https://discord.gg/vftKQvpT"
target="_blank" rel="noopener noreferrer">https://discord.gg/vftKQvpT</a></li>
<li>PosterX maintainer Discord (this fork): <a href="https://discord.gg/AEhVjqX4Af"
target="_blank" rel="noopener noreferrer">https://discord.gg/AEhVjqX4Af</a></li>
<li>Original Posterr community Discord: <a href="https://discord.gg/TcnEkMEf9J"
target="_blank" rel="noopener noreferrer">https://discord.gg/TcnEkMEf9J</a></li>
<li>Do not ask the original Posterr developer for support when using PosterX.</li>
<li>For fork support, use GitHub: <a href="https://github.com/binarygeek119/posterr" target="_blank" rel="noopener noreferrer">https://github.com/binarygeek119/posterr</a></li>
<li>For fork support, use GitHub: <a href="https://github.com/binarygeek119/posterrX" target="_blank" rel="noopener noreferrer">https://github.com/binarygeek119/posterrX</a></li>
<li>Sister project (kiosk displays): <a href="https://github.com/binarygeek119/ubuntudisplayos" target="_blank" rel="noopener noreferrer">https://github.com/binarygeek119/ubuntudisplayos</a></li>
<li>Upstream GitHub repository: <a href="https://github.com/petersem/posterr" target="_blank" rel="noopener noreferrer">petersem/posterr</a>
</li>
<li>Docker image (PosterX): <a href="https://hub.docker.com/r/binarygeek119/posterrx"
Expand Down
2 changes: 1 addition & 1 deletion scripts/scriptdoco.md
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ cd ~
sudo rm -R posterr-scripts
```
## Troubleshooting
- Limited support for PosterX is available on the maintainer [Discord](https://discord.gg/vftKQvpT) (original Posterr community: [Discord](https://discord.gg/TcnEkMEf9J)).
- Limited support for PosterX is available on the maintainer [Discord](https://discord.gg/AEhVjqX4Af) (original Posterr community: [Discord](https://discord.gg/TcnEkMEf9J)).
- Run the following command to check the status of the service.
```
sudo systemctl status posterr-watcher.service
Expand Down
Loading