|
|
@@ -1015,6 +1015,11 @@ class ElementController extends Controller
|
|
1015
|
1015
|
$tag_ids = json_decode($data);
|
|
1016
|
1016
|
$search_object = new ElementSearcher();
|
|
1017
|
1017
|
|
|
|
1018
|
+ $id_limit = $element_id+1;
|
|
|
1019
|
+ if ($element_id < 1) {
|
|
|
1020
|
+ $id_limit = Null;
|
|
|
1021
|
+ }
|
|
|
1022
|
+
|
|
1018
|
1023
|
if (count($tag_ids))
|
|
1019
|
1024
|
{
|
|
1020
|
1025
|
$tags = array();
|
|
|
@@ -1028,7 +1033,7 @@ class ElementController extends Controller
|
|
1028
|
1033
|
'tags' => $tags,
|
|
1029
|
1034
|
$show_type.'_id' => $show_id,
|
|
1030
|
1035
|
'count' => $this->container->getParameter('autoplay_max_elements'),
|
|
1031
|
|
- 'id_limit' => $element_id+1
|
|
|
1036
|
+ 'id_limit' => $id_limit
|
|
1032
|
1037
|
));
|
|
1033
|
1038
|
|
|
1034
|
1039
|
$elements = $search_object->getElements($this->getDoctrine(), $this->getUserId(true));
|
|
|
@@ -1047,13 +1052,18 @@ class ElementController extends Controller
|
|
1047
|
1052
|
$tags[$id] = $id;
|
|
1048
|
1053
|
}
|
|
1049
|
1054
|
}
|
|
|
1055
|
+
|
|
|
1056
|
+ $id_limit = $element_id+1;
|
|
|
1057
|
+ if ($element_id < 1) {
|
|
|
1058
|
+ $id_limit = Null;
|
|
|
1059
|
+ }
|
|
1050
|
1060
|
|
|
1051
|
1061
|
$search_object->init(array(
|
|
1052
|
1062
|
'tags' => $tags,
|
|
1053
|
1063
|
'user_id' => $show_id,
|
|
1054
|
1064
|
'favorite' => true,
|
|
1055
|
1065
|
'count' => $this->container->getParameter('autoplay_max_elements'),
|
|
1056
|
|
- 'id_limit' => $element_id+1
|
|
|
1066
|
+ 'id_limit' => $id_limit
|
|
1057
|
1067
|
));
|
|
1058
|
1068
|
|
|
1059
|
1069
|
$elements = $search_object->getElements($this->getDoctrine(), $this->getUserId(true));
|
|
|
@@ -1063,6 +1073,12 @@ class ElementController extends Controller
|
|
1063
|
1073
|
{
|
|
1064
|
1074
|
// On récupère les élements
|
|
1065
|
1075
|
$autoplaym = new AutoplayManager($elements, $this->container);
|
|
|
1076
|
+
|
|
|
1077
|
+ // Petit hack pour savoir qu'on est en suffle
|
|
|
1078
|
+ if ($element_id == -1) {
|
|
|
1079
|
+ $autoplaym->shuffle();
|
|
|
1080
|
+ }
|
|
|
1081
|
+
|
|
1066
|
1082
|
$elements_json = $autoplaym->getList();
|
|
1067
|
1083
|
}
|
|
1068
|
1084
|
|