Skip to content

Commit

Permalink
save chunks when upload
Browse files Browse the repository at this point in the history
  • Loading branch information
DaWe35 committed Nov 7, 2020
1 parent b08ffa2 commit 48262ee
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 1 deletion.
1 change: 1 addition & 0 deletions post/studio/new-stream.php
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@ function random_str(int $length = 64, string $keyspace = '0123456789abcdefghijkl
exit('Database error');
}
$streamid = $db->lastInsertId();

}


Expand Down
7 changes: 7 additions & 0 deletions post/studio/upload.php
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,13 @@
exit('Database error');
}
$streamid = $db->lastInsertId();

$stmt = $db->prepare("INSERT INTO chunks (`streamid`, `length`, `skylink`, `is_first_chunk`, `resolution`) VALUES (?, '0', ?, '1', 'original')");
if (!$stmt->execute([$streamid, $_POST['skylink']])) {
header('HTTP/1.0 500 Internal Server Error');
exit('Database error');
}
$stmt = null;
}

if (isset($_FILES["file"]["name"])) {
Expand Down
2 changes: 1 addition & 1 deletion view/studio/upload.php
Original file line number Diff line number Diff line change
Expand Up @@ -238,7 +238,7 @@
<label class="button" for="thumbnail" tabindex="3" onkeydown="keyDown(event, this)" onkeyup="keyUp(event, this)" onmouseover="mouseOver(this)" onmouseout="mouseOut(this)" onmousedown="mouseDown(this)" onmouseup="mouseUp(this)">Thumbnail</label>
<span id="image">None</span>
</p>
<p>Start time:
<p style="display: none;">Start time: <!-- Unused -->
<input class="w3-input" type="datetime-local" id="scheule_time_local" onchange="change_timestamp()" required tabindex="4">
<input type="hidden" id="scheule_time" name="scheule_time" required value="<?= $edit['scheule_time'] ?>">
</p>
Expand Down

0 comments on commit 48262ee

Please sign in to comment.