- What changed:
Added external_view_count so provider totals from YouTube/Vimeo/etc are added to the site’s total without double-counting local plays. Updated public totals and per-video public view displays to use site views + external views. Changed Upkeeping action to Correct external view counts with a Correct Views button. Expanded provider scraping beyond YouTube with generic page/JSON-LD/oEmbed patterns for readable Vimeo, Dailymotion, and similar pages. Improved Add Video:Title no longer has to be manually entered first. External URL rows now have Fetch Info. Metadata can fill title, description, duration, source label, and external view count. Save also retries metadata extraction server-side. Added authenticated metadata endpoint: [admin/media_info.php](/Users/tyemeclifford/Documents/GH/mediaplayer/admin/media_info.php). Updated docs in [README.md](/Users/tyemeclifford/Documents/GH/mediaplayer/README.md).
This commit is contained in:
+11
-4
@@ -43,6 +43,7 @@ if ($_SERVER['REQUEST_METHOD'] === 'POST') {
|
||||
$duration = (int)($_POST['duration'] ?? 0);
|
||||
$sort_order = (int)($_POST['sort_order'] ?? 0);
|
||||
$view_count = max(0, (int)($_POST['view_count'] ?? $video['view_count']));
|
||||
$external_view_count = max(0, (int)($_POST['external_view_count'] ?? $video['external_view_count']));
|
||||
$published = isset($_POST['published']) ? 1 : 0;
|
||||
$auto_thumb = isset($_POST['auto_thumbnail']);
|
||||
|
||||
@@ -75,10 +76,10 @@ if ($_SERVER['REQUEST_METHOD'] === 'POST') {
|
||||
if (!$error) {
|
||||
$db->prepare("
|
||||
UPDATE videos SET title=?, description=?, slug=?, thumbnail=?,
|
||||
duration=?, sort_order=?, view_count=?, published=?,
|
||||
duration=?, sort_order=?, view_count=?, external_view_count=?, published=?,
|
||||
updated_at=datetime('now')
|
||||
WHERE id=?
|
||||
")->execute([$title, $description, $slug, $thumbnail, $duration, $sort_order, $view_count, $published, $id]);
|
||||
")->execute([$title, $description, $slug, $thumbnail, $duration, $sort_order, $view_count, $external_view_count, $published, $id]);
|
||||
|
||||
// Update existing sources sort/label/quality
|
||||
$upd_labels = $_POST['src_label'] ?? [];
|
||||
@@ -330,10 +331,16 @@ render_head('Edit Video — Admin', '
|
||||
value="<?= (int)$video['sort_order'] ?>" min="0">
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="form-label" for="view_count">View Count</label>
|
||||
<label class="form-label" for="view_count">Site View Count</label>
|
||||
<input class="form-input" type="number" id="view_count" name="view_count"
|
||||
value="<?= (int)$video['view_count'] ?>" min="0">
|
||||
<span class="hint">Use this to restore older local videos or override an imported external count.</span>
|
||||
<span class="hint">Local media-site plays. Use this to restore older local videos manually.</span>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="form-label" for="external_view_count">External View Count</label>
|
||||
<input class="form-input" type="number" id="external_view_count" name="external_view_count"
|
||||
value="<?= (int)$video['external_view_count'] ?>" min="0">
|
||||
<span class="hint">Provider views from YouTube, Vimeo, and other readable external pages. Upkeeping can correct this automatically.</span>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="form-label">Published</label>
|
||||
|
||||
Reference in New Issue
Block a user