Compare commits

..

No commits in common. "ed921a4ccf064fd7215a0ecf2e6d3290e620d837" and "55247828e17a2c47d2f292f1dc33597760d9a8f3" have entirely different histories.

7 changed files with 162 additions and 690 deletions

View File

@ -18,7 +18,7 @@ class MatchEventController extends Controller
$request->validate([
'round_number' => 'required|integer|min:1',
'name' => 'nullable|string|max:50',
'start_time_seconds' => 'nullable|numeric|min:0',
'start_time_seconds' => 'nullable|integer|min:0',
]);
// Check if user owns the video
@ -45,7 +45,7 @@ class MatchEventController extends Controller
$request->validate([
'round_number' => 'sometimes|integer|min:1',
'name' => 'required|string|max:50',
'start_time_seconds' => 'nullable|numeric|min:0',
'start_time_seconds' => 'nullable|integer|min:0',
]);
// Check if user owns the video
@ -87,7 +87,7 @@ class MatchEventController extends Controller
{
$request->validate([
'round_id' => 'required|exists:match_rounds,id',
'timestamp_seconds' => 'required|numeric|min:0',
'timestamp_seconds' => 'required|integer|min:0',
'action' => 'required|string|max:255',
'points' => 'required|integer|min:1',
'competitor' => 'required|in:blue,red',
@ -150,7 +150,7 @@ class MatchEventController extends Controller
public function updatePoint(Request $request, MatchPoint $point)
{
$request->validate([
'timestamp_seconds' => 'required|numeric|min:0',
'timestamp_seconds' => 'required|integer|min:0',
'action' => 'required|string|max:255',
'points' => 'required|integer|min:1',
'competitor' => 'required|in:blue,red',
@ -202,8 +202,8 @@ class MatchEventController extends Controller
public function storeReview(Request $request, Video $video)
{
$request->validate([
'start_time_seconds' => 'required|numeric|min:0',
'end_time_seconds' => 'nullable|numeric|min:0',
'start_time_seconds' => 'required|integer|min:0',
'end_time_seconds' => 'nullable|integer|min:0',
'note' => 'required|string|max:1000',
'coach_name' => 'required|string|max:100',
'emoji' => 'nullable|string|max:10',
@ -238,8 +238,8 @@ class MatchEventController extends Controller
public function updateReview(Request $request, CoachReview $review)
{
$request->validate([
'start_time_seconds' => 'required|numeric|min:0',
'end_time_seconds' => 'nullable|numeric|min:0',
'start_time_seconds' => 'required|integer|min:0',
'end_time_seconds' => 'nullable|integer|min:0',
'note' => 'required|string|max:1000',
'coach_name' => 'required|string|max:100',
'emoji' => 'nullable|string|max:10',

View File

@ -25,8 +25,6 @@ class CoachReview extends Model
protected $casts = [
'position_x' => 'float',
'position_y' => 'float',
'start_time_seconds' => 'float',
'end_time_seconds' => 'float',
];
public function video(): BelongsTo

View File

@ -22,10 +22,6 @@ class MatchPoint extends Model
'score_red',
];
protected $casts = [
'timestamp_seconds' => 'float',
];
public function video(): BelongsTo
{
return $this->belongsTo(Video::class);

View File

@ -19,7 +19,7 @@ class MatchRound extends Model
];
protected $casts = [
'start_time_seconds' => 'float',
'start_time_seconds' => 'integer',
];
public function video(): BelongsTo

View File

@ -1,49 +0,0 @@
<?php
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
return new class extends Migration
{
/**
* Frame-accurate timestamps: the match highlights scrubber lands on
* frame boundaries (1/fps seconds). Storing these as INTEGER seconds
* throws away sub-second precision, so we promote the columns to
* decimal(10,3) 3 decimals cover up to 1000 fps and centuries of
* runtime, and existing integer values migrate losslessly.
*/
public function up(): void
{
// MatchRound.start_time_seconds is used to jump to a round's opening
// frame too, so bring it along.
Schema::table('match_rounds', function (Blueprint $table) {
$table->decimal('start_time_seconds', 10, 3)->nullable()->change();
});
Schema::table('match_points', function (Blueprint $table) {
$table->decimal('timestamp_seconds', 10, 3)->change();
});
Schema::table('coach_reviews', function (Blueprint $table) {
$table->decimal('start_time_seconds', 10, 3)->change();
$table->decimal('end_time_seconds', 10, 3)->nullable()->change();
});
}
public function down(): void
{
// Round back to integer on rollback — sub-second data would be
// truncated but nothing catastrophic happens.
Schema::table('match_rounds', function (Blueprint $table) {
$table->integer('start_time_seconds')->nullable()->change();
});
Schema::table('match_points', function (Blueprint $table) {
$table->integer('timestamp_seconds')->change();
});
Schema::table('coach_reviews', function (Blueprint $table) {
$table->integer('start_time_seconds')->change();
$table->integer('end_time_seconds')->nullable()->change();
});
}
};

View File

@ -71,14 +71,10 @@
color: var(--brand-red) !important;
}
/* Single Action dropdown for every viewport the individual
.desktop-action buttons are collapsed into this one menu. */
.mobile-action-dropdown {
display: inline-block;
display: none;
position: relative;
margin-left: auto;
}
.video-actions > .desktop-action { display: none !important; }
.mobile-action-dropdown .dropdown-menu {
right: 0;

File diff suppressed because it is too large Load Diff