- Fixed the thumbnail loading issue on paginated pretty URLs.

The bug was relative media paths like media/thumbs/... resolving under 
routes such as /v/<slug>?page=2 or /search/<query>?page=2. I added 
public_media_url() in 
[includes/db.php](/Users/tyemeclifford/Documents/GH/mediaplayer/includes/db.php) 
and updated public thumbnails, posters, and local player sources in 
[index.php](/Users/tyemeclifford/Documents/GH/mediaplayer/index.php), 
[catalogue.php](/Users/tyemeclifford/Documents/GH/mediaplayer/catalogue.php), 
and [embed.php](/Users/tyemeclifford/Documents/GH/mediaplayer/embed.php) 
to use root/base-aware URLs.
This commit is contained in:
Ty Clifford
2026-06-24 13:25:44 -04:00
parent 1abe5218ca
commit 7ad9c672ca
4 changed files with 12 additions and 6 deletions
+6
View File
@@ -125,6 +125,12 @@ function public_url_path(string $path): string {
return $base . $path;
}
function public_media_url(string $path = ''): string {
$media_url = public_url_path('/media/');
$path = ltrim($path, '/');
return $path === '' ? $media_url : rtrim($media_url, '/') . '/' . $path;
}
function public_home_url(): string {
return url_rewrite_enabled() ? public_url_path('/') : public_url_path('/index.php');
}