From 94400acdcd348d41f0ef9948795c23ec63aa2ac9 Mon Sep 17 00:00:00 2001 From: zsh Date: Fri, 31 Jul 2026 10:16:23 +1200 Subject: [PATCH 1/2] fix: add cache-busting timestamp to RSS feed cover image URLs Feed cover image URLs were built only from the item's slug and file extension, so the URL never changed when the cover image itself changed. Podcast clients that cache by URL would keep showing the old cover after an update. Add a '?ts=' query parameter using the already-computed entityUpdatedAt value, matching the same cache-busting convention already used elsewhere in the app (see the updatedAt comment in LibraryItemController.updateCover). Applies to all three feed types: single item, collection, and series. Fixes #5306 --- server/models/Feed.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/server/models/Feed.js b/server/models/Feed.js index 577dedfb9..a433d0b1a 100644 --- a/server/models/Feed.js +++ b/server/models/Feed.js @@ -119,7 +119,7 @@ class Feed extends Model { entityUpdatedAt, serverAddress, feedURL: `/feed/${slug}`, - imageURL: media.coverPath ? `/feed/${slug}/cover${Path.extname(media.coverPath)}` : `/Logo.png`, + imageURL: media.coverPath ? `/feed/${slug}/cover${Path.extname(media.coverPath)}?ts=${new Date(entityUpdatedAt).getTime()}` : `/Logo.png`, siteURL: `/item/${libraryItem.id}`, title: media.title, description: media.description, @@ -212,7 +212,7 @@ class Feed extends Model { entityUpdatedAt, serverAddress, feedURL: `/feed/${slug}`, - imageURL: firstBookWithCover?.coverPath ? `/feed/${slug}/cover${Path.extname(firstBookWithCover.coverPath)}` : `/Logo.png`, + imageURL: firstBookWithCover?.coverPath ? `/feed/${slug}/cover${Path.extname(firstBookWithCover.coverPath)}?ts=${new Date(entityUpdatedAt).getTime()}` : `/Logo.png`, siteURL: `/collection/${collectionExpanded.id}`, title: collectionExpanded.name, description: collectionExpanded.description || '', @@ -301,7 +301,7 @@ class Feed extends Model { entityUpdatedAt, serverAddress, feedURL: `/feed/${slug}`, - imageURL: firstBookWithCover?.coverPath ? `/feed/${slug}/cover${Path.extname(firstBookWithCover.coverPath)}` : `/Logo.png`, + imageURL: firstBookWithCover?.coverPath ? `/feed/${slug}/cover${Path.extname(firstBookWithCover.coverPath)}?ts=${new Date(entityUpdatedAt).getTime()}` : `/Logo.png`, siteURL: `/library/${booksWithTracks[0].libraryItem.libraryId}/series/${seriesExpanded.id}`, title: seriesExpanded.name, description: seriesExpanded.description || '', From 6b60beff6e471ca27f3d1a8f5f6791360545db3a Mon Sep 17 00:00:00 2001 From: advplyr Date: Thu, 1 Oct 2026 18:13:09 -0500 Subject: [PATCH 2/2] Extract out rss feed image URL construction into a separate function --- server/models/Feed.js | 18 +++++++++++++++--- 1 file changed, 15 insertions(+), 3 deletions(-) diff --git a/server/models/Feed.js b/server/models/Feed.js index a433d0b1a..1bfadc284 100644 --- a/server/models/Feed.js +++ b/server/models/Feed.js @@ -87,6 +87,18 @@ class Feed extends Model { ) } + /** + * @param {string} slug + * @param {string|null|undefined} coverPath + * @param {Date|null|undefined} entityUpdatedAt + * @returns {string} + */ + static getFeedImageURL(slug, coverPath, entityUpdatedAt) { + if (!coverPath) return '/Logo.png' + const cacheBuster = entityUpdatedAt != null ? `?ts=${entityUpdatedAt.valueOf()}` : '' + return `/feed/${slug}/cover${Path.extname(coverPath)}${cacheBuster}` + } + /** * * @param {string} userId @@ -119,7 +131,7 @@ class Feed extends Model { entityUpdatedAt, serverAddress, feedURL: `/feed/${slug}`, - imageURL: media.coverPath ? `/feed/${slug}/cover${Path.extname(media.coverPath)}?ts=${new Date(entityUpdatedAt).getTime()}` : `/Logo.png`, + imageURL: Feed.getFeedImageURL(slug, media.coverPath, entityUpdatedAt), siteURL: `/item/${libraryItem.id}`, title: media.title, description: media.description, @@ -212,7 +224,7 @@ class Feed extends Model { entityUpdatedAt, serverAddress, feedURL: `/feed/${slug}`, - imageURL: firstBookWithCover?.coverPath ? `/feed/${slug}/cover${Path.extname(firstBookWithCover.coverPath)}?ts=${new Date(entityUpdatedAt).getTime()}` : `/Logo.png`, + imageURL: Feed.getFeedImageURL(slug, firstBookWithCover?.coverPath, entityUpdatedAt), siteURL: `/collection/${collectionExpanded.id}`, title: collectionExpanded.name, description: collectionExpanded.description || '', @@ -301,7 +313,7 @@ class Feed extends Model { entityUpdatedAt, serverAddress, feedURL: `/feed/${slug}`, - imageURL: firstBookWithCover?.coverPath ? `/feed/${slug}/cover${Path.extname(firstBookWithCover.coverPath)}?ts=${new Date(entityUpdatedAt).getTime()}` : `/Logo.png`, + imageURL: Feed.getFeedImageURL(slug, firstBookWithCover?.coverPath, entityUpdatedAt), siteURL: `/library/${booksWithTracks[0].libraryItem.libraryId}/series/${seriesExpanded.id}`, title: seriesExpanded.name, description: seriesExpanded.description || '',