mirror of
https://github.com/advplyr/audiobookshelf.git
synced 2026-11-16 05:41:11 +01:00
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
This commit is contained in:
1 parent
6caa1aa2da
commit
94400acdcd
1 file changed
+3
-3
@@ -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 || '',
|
||||
|
||||
Reference in new issue
Block a user