Skip to content

Commit 04fd6ef

Browse files
Merge remote-tracking branch 'upstream/release-v0.5.x' into mp3
2 parents 5bdbb98 + 027357e commit 04fd6ef

File tree

5 files changed

+39
-20
lines changed

5 files changed

+39
-20
lines changed

kolibri/plugins/media_player/assets/src/views/index.vue

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -314,6 +314,11 @@
314314
$video-player-font-size = 12px
315315
316316
317+
/* Hide control bar when playing & inactive */
318+
.vjs-has-started.vjs-playing.vjs-user-inactive
319+
.vjs-control-bar
320+
visibility: hidden
321+
317322
318323
/*** CUSTOM VIDEOJS SKIN ***/
319324
.custom-skin

kolibri/tasks/api.py

Lines changed: 10 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -24,8 +24,7 @@
2424
from barbequeue.common.classes import State
2525

2626
from .permissions import IsDeviceOwnerOnly
27-
from .apps import client
28-
27+
from .client import get_client
2928

3029
logging = logger.getLogger(__name__)
3130

@@ -37,15 +36,15 @@ class TasksViewSet(viewsets.ViewSet):
3736
permission_classes = (IsDeviceOwnerOnly,)
3837

3938
def list(self, request):
40-
jobs_response = [_job_to_response(j) for j in client.all_jobs()]
39+
jobs_response = [_job_to_response(j) for j in get_client().all_jobs()]
4140
return Response(jobs_response)
4241

4342
def create(self, request):
4443
# unimplemented. Call out to the task-specific APIs for now.
4544
pass
4645

4746
def retrieve(self, request, pk=None):
48-
task = _job_to_response(client.status(pk))
47+
task = _job_to_response(get_client().status(pk))
4948
return Response(task)
5049

5150
def destroy(self, request, pk=None):
@@ -73,11 +72,11 @@ def startremoteimport(self, request):
7372
_("The requested channel does not exist on the content server")
7473
)
7574

76-
task_id = client.schedule(
75+
task_id = get_client().schedule(
7776
_networkimport, channel_id, track_progress=True)
7877

7978
# attempt to get the created Task, otherwise return pending status
80-
resp = _job_to_response(client.status(task_id))
79+
resp = _job_to_response(get_client().status(task_id))
8180

8281
return Response(resp)
8382

@@ -92,11 +91,11 @@ def startlocalimport(self, request):
9291
raise serializers.ValidationError(
9392
"The 'drive_id' field is required.")
9493

95-
job_id = client.schedule(
94+
job_id = get_client().schedule(
9695
_localimport, request.data['drive_id'], track_progress=True)
9796

9897
# attempt to get the created Task, otherwise return pending status
99-
resp = _job_to_response(client.status(job_id))
98+
resp = _job_to_response(get_client().status(job_id))
10099

101100
return Response(resp)
102101

@@ -111,11 +110,11 @@ def startlocalexport(self, request):
111110
raise serializers.ValidationError(
112111
"The 'drive_id' field is required.")
113112

114-
job_id = client.schedule(
113+
job_id = get_client().schedule(
115114
_localexport, request.data['drive_id'], track_progress=True)
116115

117116
# attempt to get the created Task, otherwise return pending status
118-
resp = _job_to_response(client.status(job_id))
117+
resp = _job_to_response(get_client().status(job_id))
119118

120119
return Response(resp)
121120

@@ -129,7 +128,7 @@ def cleartask(self, request):
129128
raise serializers.ValidationError(
130129
"The 'task_id' field is required.")
131130

132-
client.clear(force=True)
131+
get_client().clear(force=True)
133132
return Response({})
134133

135134
@list_route(methods=['get'])

kolibri/tasks/apps.py

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,6 @@
11
from __future__ import absolute_import, print_function, unicode_literals
22

33
from django.apps import AppConfig
4-
from django.conf import settings
5-
6-
from barbequeue.client import SimpleClient
7-
8-
client = None
94

105

116
class KolibriTasksConfig(AppConfig):
@@ -14,6 +9,4 @@ class KolibriTasksConfig(AppConfig):
149
verbose_name = 'Kolibri Tasks'
1510

1611
def ready(self):
17-
global client
18-
client = SimpleClient(app="kolibri", storage_path=settings.QUEUE_JOB_STORAGE_PATH)
19-
client.clear(force=True)
12+
pass

kolibri/tasks/client.py

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
import atexit
2+
3+
from django.conf import settings
4+
5+
from barbequeue.client import SimpleClient
6+
7+
_client = None
8+
9+
10+
def get_client():
11+
"""
12+
13+
:return: the SimpleClient object
14+
"""
15+
16+
global _client
17+
if not _client:
18+
# not initialized, initialize it
19+
_client = SimpleClient(app="kolibri", storage_path=settings.QUEUE_JOB_STORAGE_PATH)
20+
atexit.register(_client.shutdown)
21+
22+
return _client

requirements/base.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ djangorestframework-csv==1.4.1
1010
tqdm==4.8.3 # progress bars
1111
requests==2.10.0
1212
https://github.com/cherrypy/cherrypy/archive/v6.2.0.zip#egg=cherrypy
13-
https://github.com/learningequality/barbequeue/archive/d655b.zip#egg=barbequeue
13+
https://github.com/learningequality/barbequeue/archive/aa729.zip#egg=barbequeue
1414
porter2stemmer==1.0
1515
unicodecsv==0.14.1
1616
metafone==0.5

0 commit comments

Comments
 (0)