Skip to content

Commit

Permalink
Adding error handling for directories that don't exist in VideoSwarm …
Browse files Browse the repository at this point in the history
…wizard
  • Loading branch information
Gittinger committed Jan 21, 2021
1 parent 96e2cc7 commit 20ff973
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 0 deletions.
3 changes: 3 additions & 0 deletions web-server/plugins/slycat-video-swarm/html/vs-wizard.html
Original file line number Diff line number Diff line change
Expand Up @@ -194,6 +194,9 @@ <h4 className='alert-heading' style="margin-top:30px">Would you like us to gener
<div className="alert alert-warning" data-bind="visible:movies_exist() == false && generate_movies() == 'false'" role="alert" style="BACKGROUND-COLOR: #FFFF99">
<p className='mt-3'>We weren't able to locate your movies. Please verify that the provided path is correct.</p>
</div>
<div className="alert alert-warning" data-bind="visible:directory_exists() == false && generate_movies() == 'false'" role="alert" style="BACKGROUND-COLOR: #FFFF99">
<p className='mt-3'>This directory doesn't exist. Please verify that the provided path is correct.</p>
</div>
<label style="margin-top:15px">
<input class="form-check-input" type="radio" name="movie-source-radios" id="col-radio" value="col" data-bind="checked: movie_source">
Please choose column of CSV file with links to video files (format .mp4).</label>
Expand Down
4 changes: 4 additions & 0 deletions web-server/plugins/slycat-video-swarm/js/vs-wizard.js
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,7 @@ function constructor(params) {
// existing movies present in moviedir
var existing_movies = [];
component.movies_exist = ko.observable();
component.directory_exists = ko.observable();
component.replace_movies = ko.observable();
component.generate_movies = ko.observable();
component.generate_movies_verification = ko.observable();
Expand Down Expand Up @@ -475,6 +476,7 @@ component.reauth = function() {

component.cleanup = function() {
component.movies_exist(null);
component.directory_exists(null);
component.moviedir(null);
component.replace_movies(null);
component.generate_movies_verification(null);
Expand Down Expand Up @@ -508,6 +510,7 @@ component.reauth = function() {
path : component.moviedir(),
success : function(results)
{
component.directory_exists(true);
var link_selected = $("#vs-remote-frames-selector").val();
var link_selected_ind = component.vs_media_columns.indexOf(link_selected);
var frame_link_column = media_columns_inds[link_selected_ind];
Expand Down Expand Up @@ -607,6 +610,7 @@ component.reauth = function() {
});
},
error : function(results) {
component.directory_exists(false);
var link_selected = $("#vs-remote-frames-selector").val();
var link_selected_ind = component.vs_media_columns.indexOf(link_selected);
var frame_link_column = media_columns_inds[link_selected_ind];
Expand Down

0 comments on commit 20ff973

Please sign in to comment.