Skip to content

Commit

Permalink
Merge branch 'beta' into github
Browse files Browse the repository at this point in the history
* 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
dularion committed Mar 8, 2016
2 parents b9044f1 + c3499b8 commit 9731740
Show file tree
Hide file tree
Showing 58 changed files with 2,446 additions and 349 deletions.
19 changes: 19 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,24 @@
# Change Log

## [0.2.0] - 2016-03-08
### Features
- added functionality for "Generic Videos", aka videos that are not necessarily Movies or TV shows
- 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 :)
- added filters for dashboard
- immensely improved performance for dashboard
- added file-manager in admin section
- added custom tags for movies
- added more keyboard and mouse controls in player


### Bugfixes
- deleting a file will now erase the file from disk
- fixed: Fetching tv-show information doesn't seem to end #145
- fixed: You can’t save settings if you haven’t selected a second video directory #144
- fixed: play button from media dialog leads to dashboard



## [0.1.9.1] - 2016-01-12
### Bugfixes
- fixed: unable to play videos that users were able to play previously (m4v format)
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# streama v0.1.9.1
# streama v0.2.0


[![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)
Expand Down
2 changes: 1 addition & 1 deletion bower.json
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
"bootstrap": "~3.3.5",
"angular-ui-slider": "~0.1.3",
"ionicons": "~2.0.1",
"lodash": "~3.10.0",
"lodash": "~4.5.0",
"angular": "~1.4.3",
"angular-sanitize": "~1.4.3",
"ng-file-upload": "~5.0.9",
Expand Down
2 changes: 1 addition & 1 deletion grails-app/assets/javascripts/application.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
//= require angular-bootstrap/ui-bootstrap.min.js
//= require angular-bootstrap/ui-bootstrap-tpls.min.js
//= require alertify/alertify.min.js
//= require lodash/lodash.min.js
//= require lodash/dist/lodash.min.js
//= require ng-file-upload/ng-file-upload.min.js
//= require jquery-ui-1.11.4.custom/jquery-ui.min.js
//= require angular-ui-slider/src/slider.js
Expand Down
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');

}]);
27 changes: 0 additions & 27 deletions grails-app/assets/javascripts/controllers/admin-movie-ctrl.js
Original file line number Diff line number Diff line change
Expand Up @@ -71,33 +71,6 @@ streamaApp.controller('adminMovieCtrl', [



$scope.onTagSelect = function (tag) {
apiService.tag.save(tag);
apiService.movie.save($scope.movie);
};

$scope.tagTransform = function (newTag) {
var item = {
name: newTag,
isNew: true
};

return item;
};

$scope.deleteTag = function (tag) {
alertify.confirm('Are you sure you want to delete the tag ' + tag.name, function (confirmed) {
if(confirmed){
apiService.tag.delete(tag.id).success(function () {
_.remove($scope.tags, {id: tag.id});
})
}
});
};

apiService.tag.list().success(function (data) {
$scope.tags = data;
});


}]);
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ streamaApp.controller('adminSettingsCtrl', ['$scope', 'apiService', '$sce', func

$scope.anySettingsInvalid = function () {
return _.find($scope.settings, function (setting) {
return setting.invalid || (setting.dirty && !setting.valid) || !setting.value;
return setting.invalid || (setting.dirty && !setting.valid) || (!setting.value && setting.required);
});
};

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,7 @@ streamaApp.controller('adminShowCtrl', [
var seasonForShow = function (season) {
apiService.theMovieDb.seasonForShow({apiId: $scope.show.apiId, showId: $stateParams.showId, season: season})
.success(function (data) {
$scope.seasons = $scope.seasons || [];
$scope.seasons[season] = $scope.seasons[season] || [];
$scope.seasons[season] = $scope.seasons[season].concat(data);
$scope.loading = false;
Expand Down
76 changes: 76 additions & 0 deletions grails-app/assets/javascripts/controllers/admin-video-ctrl.js
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 grails-app/assets/javascripts/controllers/admin-videos-ctrl.js
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()});
};

}]);
Loading

0 comments on commit 9731740

Please sign in to comment.