Skip to content

Commit 9731740

Browse files
author
dularion
committed
Merge branch 'beta' into github
* beta: (23 commits) v0.2.0 working on generic video fixed: play button from media dialog leads to dashboard working on generic video fixed "All genre" link How do I add a new category that is not "Movies" or "Shows"? #104 typo TV Series browsing #101 - > popup box that displays the episodes has a unique UR genre: dont reload page when url params change genre on show & movie createa add genre on movie & show create Genres genres genres! improved fileManager only show pagination if necessary remove global buttons in filemanager - too risky tags inline search seasons fix viewingstatus fix viewingstatus fix dashboard performance improvement ... # Conflicts: # grails-app/assets/javascripts/streama-app/templates/modal--media-detail.tpl.htm
2 parents b9044f1 + c3499b8 commit 9731740

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

58 files changed

+2446
-349
lines changed

CHANGELOG.md

+19
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,24 @@
11
# Change Log
22

3+
## [0.2.0] - 2016-03-08
4+
### Features
5+
- added functionality for "Generic Videos", aka videos that are not necessarily Movies or TV shows
6+
- Added Genres for Movies and shows! When starting the app, it might be slower for the first time because it adds all the genres for existing movies and shows :)
7+
- added filters for dashboard
8+
- immensely improved performance for dashboard
9+
- added file-manager in admin section
10+
- added custom tags for movies
11+
- added more keyboard and mouse controls in player
12+
13+
14+
### Bugfixes
15+
- deleting a file will now erase the file from disk
16+
- fixed: Fetching tv-show information doesn't seem to end #145
17+
- fixed: You can’t save settings if you haven’t selected a second video directory #144
18+
- fixed: play button from media dialog leads to dashboard
19+
20+
21+
322
## [0.1.9.1] - 2016-01-12
423
### Bugfixes
524
- fixed: unable to play videos that users were able to play previously (m4v format)

README.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# streama v0.1.9.1
1+
# streama v0.2.0
22

33

44
[![Build Status](https://travis-ci.org/dularion/streama.svg?branch=master)](https://travis-ci.org/dularion/streama) [![GitHub license](https://img.shields.io/github/license/mashape/apistatus.svg)](https://github.com/dularion/streama/blob/master/LICENSE.md) [![Join the chat at https://gitter.im/dularion/streama](https://badges.gitter.im/Join%20Chat.svg)](https://gitter.im/dularion/streama?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge)

bower.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@
2222
"bootstrap": "~3.3.5",
2323
"angular-ui-slider": "~0.1.3",
2424
"ionicons": "~2.0.1",
25-
"lodash": "~3.10.0",
25+
"lodash": "~4.5.0",
2626
"angular": "~1.4.3",
2727
"angular-sanitize": "~1.4.3",
2828
"ng-file-upload": "~5.0.9",

grails-app/assets/javascripts/application.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
//= require angular-bootstrap/ui-bootstrap.min.js
1515
//= require angular-bootstrap/ui-bootstrap-tpls.min.js
1616
//= require alertify/alertify.min.js
17-
//= require lodash/lodash.min.js
17+
//= require lodash/dist/lodash.min.js
1818
//= require ng-file-upload/ng-file-upload.min.js
1919
//= require jquery-ui-1.11.4.custom/jquery-ui.min.js
2020
//= require angular-ui-slider/src/slider.js
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,87 @@
1+
2+
3+
streamaApp.controller('adminFileManagerCtrl', ['$scope', 'apiService', 'modalService', '$state', function ($scope, apiService, modalService, $state) {
4+
5+
6+
$scope.maxPerPage = 10;
7+
$scope.offset = 0;
8+
$scope.pagination = {};
9+
10+
$scope.activeListDisplay = 'table';
11+
12+
$scope.changeListDisplay = function (displayType) {
13+
$scope.activeListDisplay = displayType;
14+
};
15+
16+
$scope.removeFile = function(file){
17+
var confirmText;
18+
if(file.isHardDriveFile){
19+
confirmText = 'This file is not associated with any object in the database and is therefore a sort of artifact. Do you want to remove it now?';
20+
}
21+
else if(file.videos && file.videos.length){
22+
confirmText = 'This file is associated with '+file.videos[0].title+'. Do you want to remove this File from the hard drive?';
23+
}else {
24+
confirmText = 'This file is not associated with any Video. Do you want to remove this File from the hard drive?';
25+
}
26+
27+
alertify.confirm(confirmText, function (confirmed) {
28+
if(confirmed){
29+
apiService.video.removeFileFromDisk(file.id, file.path).success(function () {
30+
_.remove($scope.files, {id: file.id});
31+
_.remove($scope.files, {path: file.path});
32+
});
33+
}
34+
})
35+
};
36+
37+
$scope.pageChanged = function () {
38+
var newOffset = $scope.maxPerPage*($scope.pagination.currentPage-1);
39+
loadFiles({max: $scope.maxPerPage, filter: $scope.listFilter, offset: newOffset});
40+
};
41+
42+
43+
$scope.refreshList = function (filter) {
44+
$scope.listFilter = filter;
45+
loadFiles({max: $scope.maxPerPage, filter: filter, offset: $scope.offset});
46+
};
47+
48+
49+
var loadFiles = function (params) {
50+
$scope.loading = true;
51+
$scope.files = [];
52+
$scope.filesCount = 0;
53+
apiService.video.listAllFiles(params)
54+
.success(function (data) {
55+
$scope.loading = false;
56+
$scope.files = data.files;
57+
$scope.filesCount = data.count;
58+
})
59+
.error(function () {
60+
alertify.error('An error occurred.');
61+
});
62+
};
63+
64+
65+
$scope.cleanUpFiles = function(type){
66+
var message;
67+
if(type == 'noVideos'){
68+
message = 'Are you sure you want to proceed? This will delete all file-objects that are missing the corresponding file in the file-system';
69+
}else if(type == 'noFile'){
70+
message = 'Are you sure you want to proceed? This will delete all non-associated files from the harddrive';
71+
}
72+
alertify.confirm(message, function (confirmed) {
73+
if(confirmed){
74+
$scope.loading = true;
75+
apiService.video.cleanUpFiles(type).success(function () {
76+
$scope.refreshList('all');
77+
});
78+
}
79+
})
80+
};
81+
82+
83+
84+
//Initial Load
85+
$scope.refreshList('all');
86+
87+
}]);

grails-app/assets/javascripts/controllers/admin-movie-ctrl.js

-27
Original file line numberDiff line numberDiff line change
@@ -71,33 +71,6 @@ streamaApp.controller('adminMovieCtrl', [
7171

7272

7373

74-
$scope.onTagSelect = function (tag) {
75-
apiService.tag.save(tag);
76-
apiService.movie.save($scope.movie);
77-
};
78-
79-
$scope.tagTransform = function (newTag) {
80-
var item = {
81-
name: newTag,
82-
isNew: true
83-
};
84-
85-
return item;
86-
};
87-
88-
$scope.deleteTag = function (tag) {
89-
alertify.confirm('Are you sure you want to delete the tag ' + tag.name, function (confirmed) {
90-
if(confirmed){
91-
apiService.tag.delete(tag.id).success(function () {
92-
_.remove($scope.tags, {id: tag.id});
93-
})
94-
}
95-
});
96-
};
97-
98-
apiService.tag.list().success(function (data) {
99-
$scope.tags = data;
100-
});
10174

10275

10376
}]);

grails-app/assets/javascripts/controllers/admin-settings-ctrl.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ streamaApp.controller('adminSettingsCtrl', ['$scope', 'apiService', '$sce', func
4747

4848
$scope.anySettingsInvalid = function () {
4949
return _.find($scope.settings, function (setting) {
50-
return setting.invalid || (setting.dirty && !setting.valid) || !setting.value;
50+
return setting.invalid || (setting.dirty && !setting.valid) || (!setting.value && setting.required);
5151
});
5252
};
5353

grails-app/assets/javascripts/controllers/admin-show-ctrl.js

+1
Original file line numberDiff line numberDiff line change
@@ -74,6 +74,7 @@ streamaApp.controller('adminShowCtrl', [
7474
var seasonForShow = function (season) {
7575
apiService.theMovieDb.seasonForShow({apiId: $scope.show.apiId, showId: $stateParams.showId, season: season})
7676
.success(function (data) {
77+
$scope.seasons = $scope.seasons || [];
7778
$scope.seasons[season] = $scope.seasons[season] || [];
7879
$scope.seasons[season] = $scope.seasons[season].concat(data);
7980
$scope.loading = false;
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,76 @@
1+
2+
3+
streamaApp.controller('adminVideoCtrl', [
4+
'$scope', 'apiService', '$stateParams', 'modalService', '$state', 'uploadService',
5+
function ($scope, apiService, $stateParams, modalService, $state, uploadService) {
6+
$scope.loading = true;
7+
8+
apiService.genericVideo.get($stateParams.videoId).success(function (data) {
9+
$scope.video = data;
10+
$scope.loading = false;
11+
});
12+
13+
$scope.openVideoModal = function () {
14+
modalService.genericVideoModal($scope.video, function (data) {
15+
angular.merge($scope.video, data)
16+
});
17+
};
18+
19+
$scope.delete = function(){
20+
alertify.confirm("Are you sure, you want to delete this Movie?", function (confirmed) {
21+
if(confirmed){
22+
apiService.movie.delete($stateParams.movieId).success(function () {
23+
$state.go('admin.movies');
24+
});
25+
}
26+
})
27+
};
28+
29+
$scope.addToCurrentNotification = function(){
30+
apiService.notification.addMovieToCurrentNotification($stateParams.movieId).success(function () {
31+
alertify.success('The movie was added to the current notification queue.');
32+
});
33+
};
34+
35+
$scope.manageFiles = function(video){
36+
modalService.fileManagerModal(video);
37+
};
38+
39+
40+
$scope.addSimilarMovieToStreama = function(movie, redirect){
41+
alertify.set({
42+
buttonReverse: true,
43+
labels: {
44+
ok : "Yes",
45+
cancel : "Cancel"
46+
} });
47+
48+
alertify.confirm("Do you want to add \""+ movie.title +"\" to the Streama library?", function (confirmed) {
49+
if(confirmed){
50+
51+
var apiId = movie.id;
52+
delete movie.id;
53+
movie.apiId = apiId;
54+
55+
apiService.movie.save(movie).success(function (data) {
56+
if(redirect){
57+
$state.go('admin.movie', {movieId: data.id});
58+
}
59+
});
60+
}
61+
})
62+
};
63+
64+
$scope.uploadStatus = {};
65+
66+
$scope.upload = uploadService.doUpload.bind(uploadService, $scope.uploadStatus, 'video/uploadFile.json?id=' + $stateParams.movieId, function (data) {
67+
$scope.uploadStatus.percentage = null;
68+
$scope.video.files = $scope.video.files || [];
69+
$scope.video.files.push(data);
70+
});
71+
72+
73+
74+
75+
76+
}]);
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
2+
3+
streamaApp.controller('adminVideosCtrl', ['$scope', 'apiService', 'modalService', '$state', function ($scope, apiService, modalService, $state) {
4+
5+
$scope.loading = true;
6+
7+
8+
apiService.genericVideo.list().success(function (data) {
9+
$scope.videos = data;
10+
$scope.loading = false;
11+
});
12+
13+
$scope.openGenericVideoModal = function () {
14+
modalService.genericVideoModal(null, function (data) {
15+
$state.go('admin.video', {videoId: data.id});
16+
});
17+
};
18+
19+
$scope.addFromSuggested = function (movie, redirect) {
20+
var tempMovie = angular.copy(movie);
21+
var apiId = tempMovie.id;
22+
delete tempMovie.id;
23+
tempMovie.apiId = apiId;
24+
25+
apiService.movie.save(tempMovie).success(function (data) {
26+
if(redirect){
27+
$state.go('admin.movie', {movieId: data.id});
28+
}else{
29+
$scope.movies.push(data);
30+
}
31+
});
32+
};
33+
34+
$scope.alreadyAdded = function (movie) {
35+
console.log('%c movie', 'color: deeppink; font-weight: bold; text-shadow: 0 0 5px deeppink;', movie);
36+
return movie.id && _.find($scope.movies, {apiId: movie.id.toString()});
37+
};
38+
39+
}]);

0 commit comments

Comments
 (0)