diff --git a/src/main/java/io/github/stekeblad/videouploader/allTheTodos.md b/src/main/java/io/github/stekeblad/videouploader/allTheTodos.md
index 46eff43..1c049d1 100644
--- a/src/main/java/io/github/stekeblad/videouploader/allTheTodos.md
+++ b/src/main/java/io/github/stekeblad/videouploader/allTheTodos.md
@@ -3,9 +3,12 @@
#### Right now
- Bugs and small things
-#### More important things to do
+#### Higher priority things to do
+- Change "Abort all and clear" button to not affect started uploads.
+users can currently not remove all not started at once and it would
+only be two extra click to first abort all before clearing.
-#### Less important things to do
+#### Lower priority things to do
- Creating localization support and moving all strings visible for the
users there (resourceBundle)
- add notice for that Edge does not work for authentication!
diff --git a/src/main/java/io/github/stekeblad/videouploader/main/mainWindow.fxml b/src/main/java/io/github/stekeblad/videouploader/main/mainWindow.fxml
index cac7640..fcafbcb 100644
--- a/src/main/java/io/github/stekeblad/videouploader/main/mainWindow.fxml
+++ b/src/main/java/io/github/stekeblad/videouploader/main/mainWindow.fxml
@@ -19,18 +19,18 @@
-
+
-
-
-
-
+
+
+
+
diff --git a/src/main/java/io/github/stekeblad/videouploader/main/mainWindowController.java b/src/main/java/io/github/stekeblad/videouploader/main/mainWindowController.java
index 16877fd..617c1aa 100644
--- a/src/main/java/io/github/stekeblad/videouploader/main/mainWindowController.java
+++ b/src/main/java/io/github/stekeblad/videouploader/main/mainWindowController.java
@@ -82,7 +82,7 @@ public void initialize(URL location, ResourceBundle resources) {
choice_presets.setItems(FXCollections.observableArrayList(configManager.getPresetNames()));
btn_startAll.setTooltip(new Tooltip("Starts all uploads that have the \"Start Upload\" button visible"));
btn_abortAll.setTooltip(new Tooltip("Aborts all uploads that have the \"Abort\" button visible"));
- btn_abortAndClear.setTooltip(new Tooltip("Aborts all uploads and removes all uploads from the list below"));
+ btn_abortAndClear.setTooltip(new Tooltip("Aborts all started uploads and removes all uploads from the list below"));
// Only allow numbers in autoNum textField
text_autoNum.textProperty().addListener((observable, oldValue, newValue) -> {
@@ -229,6 +229,11 @@ public void onApplyPresetClicked(ActionEvent actionEvent) {
for (File videoFile : videosToAdd) {
// Apply automatic numbering on video name
String name = chosenPreset.getVideoName().replace("$(ep)", String.valueOf(autoNum++));
+ // Insert raw file name in title, exclude file extension
+ if (name.contains("$(rawname)")) {
+ String rawFileName = videoFile.getName().substring(0, videoFile.getName().lastIndexOf("."));
+ name = name.replace("$(rawname)", rawFileName);
+ }
// Insert playlist URL in description
String description = chosenPreset.getVideoDescription()
.replace("$(playlist)", playlistUrl);
@@ -361,12 +366,14 @@ public void onRemoveFinishedUploadsClicked(ActionEvent actionEvent) {
*/
public void onAbortAllUploadsClicked(ActionEvent actionEvent) {
// Show confirmation dialog
- Optional buttonChoice = AlertUtils.yesNo("Abort ALL Uploads?",
- "Are you sure you want to abort the uploading of all started uploads?").showAndWait();
- if (buttonChoice.isPresent()) {
- if (buttonChoice.get() != ButtonType.YES) {
- // ButtonType.NO or Closed with [X] button
- return;
+ if (!bybassAbortWarning) { // can be set from onAbortAndClearClicked
+ Optional buttonChoice = AlertUtils.yesNo("Abort ALL Uploads?",
+ "Are you sure you want to abort the uploading of all started uploads?").showAndWait();
+ if (buttonChoice.isPresent()) {
+ if (buttonChoice.get() != ButtonType.YES) {
+ // ButtonType.NO or Closed with [X] button
+ return;
+ }
}
}
// Prevent the "Are you sure you want to abort X?" dialog for every upload
@@ -394,6 +401,7 @@ public void onAbortAndClearClicked(ActionEvent actionEvent) {
"all started, aborted, finished and not yet started uploads?").showAndWait();
if (choice.isPresent()) {
if (choice.get() == ButtonType.YES) {
+ bybassAbortWarning = true; // is set back to false by onAbortAllUploadsClicked
onAbortAllUploadsClicked(new ActionEvent());
uploadQueueVideos.clear();
uploadPaneCounter = 0;
diff --git a/src/main/java/io/github/stekeblad/videouploader/settings/PresetsWindowController.java b/src/main/java/io/github/stekeblad/videouploader/settings/PresetsWindowController.java
index 216517c..1828224 100644
--- a/src/main/java/io/github/stekeblad/videouploader/settings/PresetsWindowController.java
+++ b/src/main/java/io/github/stekeblad/videouploader/settings/PresetsWindowController.java
@@ -163,6 +163,7 @@ public void onTipsClicked(ActionEvent actionEvent) {
"comma a part of the tag.\nOk, tips!" +
"\n- In the video title field you can write \"$(ep)\" to tell the program where to insert the episode " +
"number/name defined when adding videos for upload." +
+ "\n- In the video title field you can also write \"$(rawname)\" to insert the name of the video file used" +
"\n- In the description field you can add \"$(playlist)\" to insert a link to the playlist the " +
"video will be added to then uploaded.";
AlertUtils.simpleClose("Tips", messageContent).showAndWait();
diff --git a/src/main/java/io/github/stekeblad/videouploader/utils/PickFile.java b/src/main/java/io/github/stekeblad/videouploader/utils/PickFile.java
index 9b5959b..ed9d806 100644
--- a/src/main/java/io/github/stekeblad/videouploader/utils/PickFile.java
+++ b/src/main/java/io/github/stekeblad/videouploader/utils/PickFile.java
@@ -7,6 +7,7 @@
import java.math.BigDecimal;
import java.nio.file.Files;
import java.nio.file.Paths;
+import java.util.ArrayList;
import java.util.List;
import static io.github.stekeblad.videouploader.youtube.VideoInformationBase.THUMBNAIL_FILE_FORMAT;
@@ -51,20 +52,20 @@ public static List pickVideos() {
FileChooser fileChooser = new FileChooser();
fileChooser.setTitle("Choose video files to upload");
Stage fileChooserStage = new Stage();
- List filesToUpload = fileChooser.showOpenMultipleDialog(fileChooserStage);
- if (filesToUpload != null) {
+ List chosenFiles = fileChooser.showOpenMultipleDialog(fileChooserStage);
+ List filesToUpload = new ArrayList<>();
+ if (chosenFiles != null) {
boolean fileWasSkipped = false;
- for (int i = 0; i < filesToUpload.size(); i++) {
+ for (File chosenFile : chosenFiles) {
try { // Check file MIME to see if it is a video file
- if (!Files.probeContentType(Paths.get(filesToUpload.get(i).toURI())).startsWith(VIDEO_FILE_FORMAT)) {
+ String contentType = Files.probeContentType(Paths.get(chosenFile.toURI()));
+ if (contentType == null || !contentType.startsWith(VIDEO_FILE_FORMAT)) {
fileWasSkipped = true; // at leased one selected file is not a video file
- filesToUpload.remove(filesToUpload.get(i));
- i--;
+ } else {
+ filesToUpload.add(chosenFile);
}
} catch (Exception e) {
fileWasSkipped = true;
- filesToUpload.remove(filesToUpload.get(i));
- i--;
}
}
if (fileWasSkipped) {