-
Notifications
You must be signed in to change notification settings - Fork 983
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* 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
- Loading branch information
Showing
58 changed files
with
2,446 additions
and
349 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
87 changes: 87 additions & 0 deletions
87
grails-app/assets/javascripts/controllers/admin-fileManager-ctrl.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,87 @@ | ||
|
||
|
||
streamaApp.controller('adminFileManagerCtrl', ['$scope', 'apiService', 'modalService', '$state', function ($scope, apiService, modalService, $state) { | ||
|
||
|
||
$scope.maxPerPage = 10; | ||
$scope.offset = 0; | ||
$scope.pagination = {}; | ||
|
||
$scope.activeListDisplay = 'table'; | ||
|
||
$scope.changeListDisplay = function (displayType) { | ||
$scope.activeListDisplay = displayType; | ||
}; | ||
|
||
$scope.removeFile = function(file){ | ||
var confirmText; | ||
if(file.isHardDriveFile){ | ||
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?'; | ||
} | ||
else if(file.videos && file.videos.length){ | ||
confirmText = 'This file is associated with '+file.videos[0].title+'. Do you want to remove this File from the hard drive?'; | ||
}else { | ||
confirmText = 'This file is not associated with any Video. Do you want to remove this File from the hard drive?'; | ||
} | ||
|
||
alertify.confirm(confirmText, function (confirmed) { | ||
if(confirmed){ | ||
apiService.video.removeFileFromDisk(file.id, file.path).success(function () { | ||
_.remove($scope.files, {id: file.id}); | ||
_.remove($scope.files, {path: file.path}); | ||
}); | ||
} | ||
}) | ||
}; | ||
|
||
$scope.pageChanged = function () { | ||
var newOffset = $scope.maxPerPage*($scope.pagination.currentPage-1); | ||
loadFiles({max: $scope.maxPerPage, filter: $scope.listFilter, offset: newOffset}); | ||
}; | ||
|
||
|
||
$scope.refreshList = function (filter) { | ||
$scope.listFilter = filter; | ||
loadFiles({max: $scope.maxPerPage, filter: filter, offset: $scope.offset}); | ||
}; | ||
|
||
|
||
var loadFiles = function (params) { | ||
$scope.loading = true; | ||
$scope.files = []; | ||
$scope.filesCount = 0; | ||
apiService.video.listAllFiles(params) | ||
.success(function (data) { | ||
$scope.loading = false; | ||
$scope.files = data.files; | ||
$scope.filesCount = data.count; | ||
}) | ||
.error(function () { | ||
alertify.error('An error occurred.'); | ||
}); | ||
}; | ||
|
||
|
||
$scope.cleanUpFiles = function(type){ | ||
var message; | ||
if(type == 'noVideos'){ | ||
message = 'Are you sure you want to proceed? This will delete all file-objects that are missing the corresponding file in the file-system'; | ||
}else if(type == 'noFile'){ | ||
message = 'Are you sure you want to proceed? This will delete all non-associated files from the harddrive'; | ||
} | ||
alertify.confirm(message, function (confirmed) { | ||
if(confirmed){ | ||
$scope.loading = true; | ||
apiService.video.cleanUpFiles(type).success(function () { | ||
$scope.refreshList('all'); | ||
}); | ||
} | ||
}) | ||
}; | ||
|
||
|
||
|
||
//Initial Load | ||
$scope.refreshList('all'); | ||
|
||
}]); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
76 changes: 76 additions & 0 deletions
76
grails-app/assets/javascripts/controllers/admin-video-ctrl.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,76 @@ | ||
|
||
|
||
streamaApp.controller('adminVideoCtrl', [ | ||
'$scope', 'apiService', '$stateParams', 'modalService', '$state', 'uploadService', | ||
function ($scope, apiService, $stateParams, modalService, $state, uploadService) { | ||
$scope.loading = true; | ||
|
||
apiService.genericVideo.get($stateParams.videoId).success(function (data) { | ||
$scope.video = data; | ||
$scope.loading = false; | ||
}); | ||
|
||
$scope.openVideoModal = function () { | ||
modalService.genericVideoModal($scope.video, function (data) { | ||
angular.merge($scope.video, data) | ||
}); | ||
}; | ||
|
||
$scope.delete = function(){ | ||
alertify.confirm("Are you sure, you want to delete this Movie?", function (confirmed) { | ||
if(confirmed){ | ||
apiService.movie.delete($stateParams.movieId).success(function () { | ||
$state.go('admin.movies'); | ||
}); | ||
} | ||
}) | ||
}; | ||
|
||
$scope.addToCurrentNotification = function(){ | ||
apiService.notification.addMovieToCurrentNotification($stateParams.movieId).success(function () { | ||
alertify.success('The movie was added to the current notification queue.'); | ||
}); | ||
}; | ||
|
||
$scope.manageFiles = function(video){ | ||
modalService.fileManagerModal(video); | ||
}; | ||
|
||
|
||
$scope.addSimilarMovieToStreama = function(movie, redirect){ | ||
alertify.set({ | ||
buttonReverse: true, | ||
labels: { | ||
ok : "Yes", | ||
cancel : "Cancel" | ||
} }); | ||
|
||
alertify.confirm("Do you want to add \""+ movie.title +"\" to the Streama library?", function (confirmed) { | ||
if(confirmed){ | ||
|
||
var apiId = movie.id; | ||
delete movie.id; | ||
movie.apiId = apiId; | ||
|
||
apiService.movie.save(movie).success(function (data) { | ||
if(redirect){ | ||
$state.go('admin.movie', {movieId: data.id}); | ||
} | ||
}); | ||
} | ||
}) | ||
}; | ||
|
||
$scope.uploadStatus = {}; | ||
|
||
$scope.upload = uploadService.doUpload.bind(uploadService, $scope.uploadStatus, 'video/uploadFile.json?id=' + $stateParams.movieId, function (data) { | ||
$scope.uploadStatus.percentage = null; | ||
$scope.video.files = $scope.video.files || []; | ||
$scope.video.files.push(data); | ||
}); | ||
|
||
|
||
|
||
|
||
|
||
}]); |
39 changes: 39 additions & 0 deletions
39
grails-app/assets/javascripts/controllers/admin-videos-ctrl.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
|
||
|
||
streamaApp.controller('adminVideosCtrl', ['$scope', 'apiService', 'modalService', '$state', function ($scope, apiService, modalService, $state) { | ||
|
||
$scope.loading = true; | ||
|
||
|
||
apiService.genericVideo.list().success(function (data) { | ||
$scope.videos = data; | ||
$scope.loading = false; | ||
}); | ||
|
||
$scope.openGenericVideoModal = function () { | ||
modalService.genericVideoModal(null, function (data) { | ||
$state.go('admin.video', {videoId: data.id}); | ||
}); | ||
}; | ||
|
||
$scope.addFromSuggested = function (movie, redirect) { | ||
var tempMovie = angular.copy(movie); | ||
var apiId = tempMovie.id; | ||
delete tempMovie.id; | ||
tempMovie.apiId = apiId; | ||
|
||
apiService.movie.save(tempMovie).success(function (data) { | ||
if(redirect){ | ||
$state.go('admin.movie', {movieId: data.id}); | ||
}else{ | ||
$scope.movies.push(data); | ||
} | ||
}); | ||
}; | ||
|
||
$scope.alreadyAdded = function (movie) { | ||
console.log('%c movie', 'color: deeppink; font-weight: bold; text-shadow: 0 0 5px deeppink;', movie); | ||
return movie.id && _.find($scope.movies, {apiId: movie.id.toString()}); | ||
}; | ||
|
||
}]); |
Oops, something went wrong.