- Implemented:

Added view_count database migration/defaults and shared helpers in 
[includes/db.php](/Users/tyemeclifford/Documents/GH/mediaplayer/includes/db.php).
Public player and embed.php now increment views.
Homepage and catalogue can display per-video views, total views, and 
public stats based on admin settings.
Added Admin → Settings toggles for public view/stat display.
Added Admin → Upkeeping action to restore external view counts from 
readable provider pages, with YouTube scraping support first.
Added manual per-video view-count editing in 
[admin/edit.php](/Users/tyemeclifford/Documents/GH/mediaplayer/admin/edit.php) 
for older local uploads or corrections.
Updated 
[README.md](/Users/tyemeclifford/Documents/GH/mediaplayer/README.md) 
with the new behavior.
This commit is contained in:
Ty Clifford
2026-06-25 04:16:34 -04:00
parent dc71d26c2a
commit 86d1fedcb3
8 changed files with 472 additions and 29 deletions
+13
View File
@@ -86,6 +86,18 @@ Use **Admin → YouTube Importer** to paste a YouTube channel URL, `@handle`, or
Imported YouTube videos use the video's original publish date for the database `created_at` timestamp when YouTube exposes it. The admin dashboard also includes **Upkeeping → Correct YouTube timestamps** to backfill existing YouTube entries in batches.
### View Counts and Public Statistics
Each public player load increments the video's `view_count`, including standalone embeds served through `embed.php`. View counts appear in the admin video list and can be edited per video from **Admin → Edit Video** for older local uploads or manual corrections.
The public display is configurable in **Admin → Settings → Public Display**:
- show or hide per-video view counts
- show or hide the total public view count
- show or hide public page statistics on the homepage and catalogue
The admin dashboard also includes **Upkeeping → Restore external view counts**. It checks existing remote-source videos in batches, scrapes readable provider counts when available, and stores the higher value between the provider count and the local database count. YouTube watch pages are supported first; unsupported providers and local-only uploads can still be corrected manually on the edit screen.
### Public Search
The full catalogue page includes a public search for published videos only. Search matches video title, description, and slug; draft videos remain hidden.
@@ -125,6 +137,7 @@ Use the **Sort Order** field — lower numbers appear first. Default is 0.
- Local uploaded sources and remote URL sources
- Provider embeds for popular video and audio platforms
- Thumbnail posters
- Per-video view counts and optional public library statistics
- Keyboard accessible
---