Skip to content
Next
Projects
Groups
Snippets
Help
Loading...
Help
Support
Submit feedback
Contribute to GitLab
Switch to GitLab Next
Sign in / Register
Toggle navigation
Minds Backend - Engine
Project
Project
Details
Activity
Releases
Cycle Analytics
Insights
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Locked Files
Issues
238
Issues
238
List
Boards
Labels
Service Desk
Milestones
Merge Requests
42
Merge Requests
42
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Security & Compliance
Security & Compliance
Dependency List
Packages
Packages
List
Container Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Minds
Minds Backend - Engine
Compare Revisions
7d77cc0dad6b1054f2fa14a6fd4da4e1caa24fb7...b29fbf67868a3c699dd0d3116c81e8f14c72837d
Source
b29fbf67868a3c699dd0d3116c81e8f14c72837d
Select Git revision
...
Target
7d77cc0dad6b1054f2fa14a6fd4da4e1caa24fb7
Select Git revision
Compare
Commits (3)
(fix): full hd for new upload flow
· 73b44302
Marcelo Rivera
authored
34 minutes ago
73b44302
(fix): add phpdoc
· 6207325a
Marcelo Rivera
authored
26 minutes ago
6207325a
(fix): remove full_hd attribute from Video->getExportableValues()
· b29fbf67
Marcelo Rivera
authored
21 minutes ago
b29fbf67
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
29 additions
and
4 deletions
+29
-4
Controllers/api/v1/media.php
Controllers/api/v1/media.php
+1
-0
Controllers/api/v2/media/upload.php
Controllers/api/v2/media/upload.php
+6
-1
Core/Media/ClientUpload/Manager.php
Core/Media/ClientUpload/Manager.php
+18
-1
Core/Media/Services/FFMpeg.php
Core/Media/Services/FFMpeg.php
+1
-0
Core/Queue/Runners/Transcode.php
Core/Queue/Runners/Transcode.php
+3
-1
Entities/Video.php
Entities/Video.php
+0
-1
No files found.
Controllers/api/v1/media.php
View file @
b29fbf67
...
...
@@ -163,6 +163,7 @@ class media implements Interfaces\Api, Interfaces\ApiIgnorePam
$body
=
$req
[
'body'
];
fwrite
(
$fp
,
$body
);
$video
->
access_id
=
0
;
$video
->
patch
([
'full_hd'
,
Core\Session
::
getLoggedinUser
()
->
isPro
()]);
$video
->
upload
(
$tmpFilename
);
$guid
=
$video
->
save
();
fclose
(
$fp
);
...
...
This diff is collapsed.
Click to expand it.
Controllers/api/v2/media/upload.php
View file @
b29fbf67
...
...
@@ -10,6 +10,8 @@ namespace Minds\Controllers\api\v2\media;
use
Minds\Api\Factory
;
use
Minds\Core\Di\Di
;
use
Minds\Core\Media\ClientUpload\Manager
;
use
Minds\Core\Session
;
use
Minds\Interfaces
;
use
Minds\Core\Media\ClientUpload\ClientUploadLease
;
...
...
@@ -38,6 +40,7 @@ class upload implements Interfaces\Api
*/
public
function
put
(
$pages
)
{
/** @var Manager $manager */
$manager
=
Di
::
_
()
->
get
(
"Media\ClientUpload\Manager"
);
switch
(
$pages
[
0
])
{
case
'prepare'
:
...
...
@@ -55,7 +58,9 @@ class upload implements Interfaces\Api
$lease
->
setGuid
(
$guid
)
->
setMediaType
(
$mediaType
);
$manager
->
complete
(
$lease
);
$manager
->
setFullHD
(
Session
::
getLoggedinUser
()
->
isPro
())
->
complete
(
$lease
);
break
;
}
return
Factory
::
response
([]);
...
...
This diff is collapsed.
Click to expand it.
Core/Media/ClientUpload/Manager.php
View file @
b29fbf67
...
...
@@ -12,15 +12,28 @@ use Minds\Entities\Video;
class
Manager
{
/** @var FFM
ep
g */
/** @var FFM
pe
g */
private
$ffmpeg
;
/** @var Guid $guid */
private
$guid
;
/** @var bool */
private
$full_hd
;
/** @var Save $save */
private
$save
;
/**
* @param bool $value
* @return Manager
*/
public
function
setFullHD
(
bool
$value
)
:
Manager
{
$this
->
full_hd
=
$value
;
return
$this
;
}
public
function
__construct
(
FFMpeg
$FFMpeg
=
null
,
GuidBuilder
$guid
=
null
,
...
...
@@ -70,12 +83,16 @@ class Manager
$video
->
set
(
'guid'
,
$lease
->
getGuid
());
$video
->
set
(
'cinemr_guid'
,
$lease
->
getGuid
());
$video
->
set
(
'access_id'
,
0
);
// Hide until published
$video
->
setFlag
(
'full_hd'
,
$this
->
full_hd
);
// Save the video
$this
->
save
->
setEntity
(
$video
)
->
save
();
$this
->
ffmpeg
->
setKey
(
$lease
->
getGuid
());
// Set the full hd flag
$this
->
ffmpeg
->
setFullHD
(
$this
->
full_hd
);
// Start the transcoding process
$this
->
ffmpeg
->
transcode
();
...
...
This diff is collapsed.
Click to expand it.
Core/Media/Services/FFMpeg.php
View file @
b29fbf67
...
...
@@ -154,6 +154,7 @@ class FFMpeg implements ServiceInterface
->
setQueue
(
'Transcode'
)
->
send
([
'key'
=>
$this
->
key
,
'full_hd'
=>
$this
->
full_hd
,
]);
return
$this
;
...
...
This diff is collapsed.
Click to expand it.
Core/Queue/Runners/Transcode.php
View file @
b29fbf67
...
...
@@ -13,9 +13,11 @@ class Transcode implements Interfaces\QueueRunner
$client
=
Core\Queue\Client
::
Build
();
$client
->
setQueue
(
"Transcode"
)
->
receive
(
function
(
$data
)
{
$d
=
$data
->
getData
();
echo
"Received a transcode request
\n
"
;
$transcoder
=
new
Core\Media\Services\FFMpeg
();
$transcoder
->
setKey
(
$data
->
getData
()[
'key'
]);
$transcoder
->
setKey
(
$d
[
'key'
]);
$transcoder
->
setFullHD
(
$d
[
'full_hd'
]);
$transcoder
->
onQueue
();
},
[
'max_messages'
=>
1
]);
}
...
...
This diff is collapsed.
Click to expand it.
Entities/Video.php
View file @
b29fbf67
...
...
@@ -118,7 +118,6 @@ class Video extends Object
'license'
,
'monetized'
,
'mature'
,
'full_hd'
,
'boost_rejection_reason'
,
'time_sent'
,
]);
...
...
This diff is collapsed.
Click to expand it.