From aade7ed04688ce6c633f7a08b52622d3a926931b Mon Sep 17 00:00:00 2001 From: Jordfoz16 Date: Sun, 2 Dec 2018 13:01:19 +0000 Subject: [PATCH] Json file extension --- README.md | 6 +++--- src/Utils/ReadFile.java | 8 ++++---- whitelist.txt => whitelist.json | 0 3 files changed, 7 insertions(+), 7 deletions(-) rename whitelist.txt => whitelist.json (100%) diff --git a/README.md b/README.md index ee92bcd..1f81694 100644 --- a/README.md +++ b/README.md @@ -9,7 +9,7 @@ Season renamer will rename a season of a TV show with the correct title needed f #### Using the application Make sure you have the java runtime enviroment installed. -Run the "Season Rename.jar", this will create a whitelist.txt file +Run the "Season Rename.jar", this will create a whitelist.json file Enter the path to the folder where your season is located Enter the series name Enter the season number and episode starting number @@ -17,6 +17,6 @@ Enter subtitle language if needed Scan the folder to check it can open the folder Click the rename button to rename the folder -#### Editing the whitelist.txt +#### Editing the whitelist.json -Inside the whitelist.txt are the file extension that can be renamed. So if a video or subtitle format is not there then it can be added by using the json format. If you have made a change to the whitelist.txt the program will need restarting. To get the defualt whitelist.txt delete the current file and relaunch the application. +Inside the whitelist.json are the file extension that can be renamed. So if a video or subtitle format is not there then it can be added by using the json format. If you have made a change to the whitelist.txt the program will need restarting. To get the defualt whitelist.txt delete the current file and relaunch the application. diff --git a/src/Utils/ReadFile.java b/src/Utils/ReadFile.java index 4b62c22..ca266c5 100644 --- a/src/Utils/ReadFile.java +++ b/src/Utils/ReadFile.java @@ -19,7 +19,7 @@ public class ReadFile { private ArrayList videoList = new ArrayList(); private ArrayList subtitleList = new ArrayList(); - private File blacklist = new File("whitelist.txt"); + private File whitelist = new File("whitelist.json"); private String template = "{ \r\n" + @@ -41,10 +41,10 @@ public ReadFile() { public void checkForFile() { - if(!blacklist.exists()) { + if(!whitelist.exists()) { System.out.println("Creating Whitelist File"); try { - PrintWriter writer = new PrintWriter("whitelist.txt", "UTF-8"); + PrintWriter writer = new PrintWriter("whitelist.json", "UTF-8"); writer.write(template); writer.close(); } catch (FileNotFoundException e) { @@ -61,7 +61,7 @@ public void readFile() { JSONParser parser = new JSONParser(); try { - Object obj = parser.parse(new FileReader("whitelist.txt")); + Object obj = parser.parse(new FileReader("whitelist.json")); JSONObject jsonObject = (JSONObject) obj; JSONArray videoFormat = (JSONArray) jsonObject.get("video"); diff --git a/whitelist.txt b/whitelist.json similarity index 100% rename from whitelist.txt rename to whitelist.json