Skip to content
Projects
Groups
Snippets
Help
Sign in / Register
Toggle navigation
Minds Backend - Engine
Project overview
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Locked Files
Issues
280
Merge Requests
37
CI / CD
Security & Compliance
Packages
Wiki
Snippets
Members
Collapse sidebar
Close sidebar
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Minds
Minds Backend - Engine
Commits
c26a72e3
Commit
c26a72e3
authored
3 hours ago
by
Guy Thouret
Browse files
Options
Download
Capture Boost rating values as an exlicitly describing constant -
#1106
parent
51a8bf1d
goal/boost-campaigns-e24
1 merge request
!235
WIP: Boost Campaigns (&24)
Pipeline
#97579057
failed with stages
in 2 minutes and 40 seconds
Changes
7
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
14 additions
and
13 deletions
+14
-13
Controllers/api/v1/boost/fetch.php
View file @
c26a72e3
...
...
@@ -41,12 +41,12 @@ class fetch implements Interfaces\Api
// options specific to newly created users (<=1 hour) and iOS users
if
(
time
()
-
$user
->
getTimeCreated
()
<=
3600
)
{
$rating
=
1
;
// they can only see safe content
$rating
=
Boost\Network\Boost
::
RATING_SAFE
;
$quality
=
75
;
}
if
(
$platform
===
'ios'
)
{
$rating
=
1
;
// they can only see safe content
$rating
=
Boost\Network\Boost
::
RATING_SAFE
;
$quality
=
90
;
}
...
...
@@ -81,7 +81,7 @@ class fetch implements Interfaces\Api
if
(
!
$response
[
'boosts'
])
{
$result
=
Di
::
_
()
->
get
(
'Trending\Repository'
)
->
getList
([
'type'
=>
'images'
,
'rating'
=>
isset
(
$rating
)
?
(
int
)
$rating
:
1
,
'rating'
=>
isset
(
$rating
)
?
(
int
)
$rating
:
Boost\Network\Boost
::
RATING_SAFE
,
'limit'
=>
$limit
,
]);
...
...
This diff is collapsed.
Controllers/api/v2/boost/fetch/campaigns.php
View file @
c26a72e3
...
...
@@ -71,10 +71,10 @@ class campaigns implements Interfaces\Api
// Options specific to newly created users (<=1 hour) and iOS users
if
(
$platform
===
'ios'
)
{
$rating
=
1
;
// they can only see safe content
$rating
=
Network\Boost
::
RATING_SAFE
;
$quality
=
90
;
}
elseif
(
time
()
-
$currentUser
->
getTimeCreated
()
<=
3600
)
{
$rating
=
1
;
// they can only see safe content
$rating
=
Network\Boost
::
RATING_SAFE
;
$quality
=
75
;
}
...
...
This diff is collapsed.
Controllers/api/v2/entities/suggested.php
View file @
c26a72e3
...
...
@@ -54,13 +54,13 @@ class suggested implements Interfaces\Api
$offset
=
intval
(
$_GET
[
'offset'
]);
}
$rating
=
Core\Session
::
getLoggedinUser
()
->
boost_rating
?:
1
;
$rating
=
Core\Session
::
getLoggedinUser
()
->
boost_rating
?:
Core\Boost\Network\Boost
::
RATING_SAFE
;
if
(
isset
(
$_GET
[
'rating'
]))
{
$rating
=
intval
(
$_GET
[
'rating'
]);
}
if
(
$type
==
'user'
)
{
$rating
=
1
;
$rating
=
Core\Boost\Network\Boost
::
RATING_SAFE
;
}
$hashtag
=
null
;
...
...
This diff is collapsed.
Core/Boost/Feed.php
View file @
c26a72e3
...
...
@@ -9,8 +9,6 @@ use Minds\Core;
abstract
class
Feed
{
const
RATING_SAFE
=
1
;
/** @var Resolver */
protected
$resolver
;
/** @var User */
...
...
@@ -102,10 +100,10 @@ abstract class Feed
protected
function
makeRatingAndQualitySafe
()
:
void
{
if
(
$this
->
platform
===
'ios'
)
{
$this
->
rating
=
self
::
RATING_SAFE
;
$this
->
rating
=
Core\Boost\Network\Boost
::
RATING_SAFE
;
$this
->
quality
=
90
;
}
elseif
(
time
()
-
$this
->
currentUser
->
getTimeCreated
()
<=
Core\Time
::
ONE_HOUR
)
{
$this
->
rating
=
self
::
RATING_SAFE
;
$this
->
rating
=
Core\Boost\Network\Boost
::
RATING_SAFE
;
$this
->
quality
=
75
;
}
}
...
...
This diff is collapsed.
Core/Boost/Network/Boost.php
View file @
c26a72e3
...
...
@@ -67,6 +67,9 @@ class Boost
const
TYPE_NEWSFEED
=
'newsfeed'
;
const
TYPE_CONTENT
=
'content'
;
const
RATING_SAFE
=
1
;
const
RATING_OPEN
=
2
;
/** @var int $guid */
private
$guid
;
...
...
This diff is collapsed.
Core/Boost/Network/ElasticRepository.php
View file @
c26a72e3
...
...
@@ -28,7 +28,7 @@ class ElasticRepository
public
function
getList
(
$opts
=
[])
{
$opts
=
array_merge
([
'rating'
=>
3
,
'rating'
=>
Boost
::
RATING_OPEN
,
'token'
=>
0
,
'offset'
=>
null
,
'order'
=>
null
,
...
...
This diff is collapsed.
Core/Boost/Network/Iterator.php
View file @
c26a72e3
...
...
@@ -17,7 +17,7 @@ class Iterator implements \Iterator
/** @var Manager */
protected
$manager
;
protected
$rating
=
1
;
protected
$rating
=
Boost
::
RATING_SAFE
;
protected
$quality
=
0
;
protected
$offset
=
self
::
OFFSET_START
;
protected
$limit
=
10
;
...
...
This diff is collapsed.
Please
register
or
sign in
to comment