When re-downloading, use the cached copy for the time being... Next run
can use the newly downloaded update. Less interruptions of service this way.
This commit is contained in:
parent
11f1a40115
commit
9a8852ce87
@ -332,6 +332,7 @@ public class sigIRC{
|
|||||||
Thread downloadThread = new Thread(){
|
Thread downloadThread = new Thread(){
|
||||||
public void run() {
|
public void run() {
|
||||||
JSONObject subemotes = null;
|
JSONObject subemotes = null;
|
||||||
|
JSONObject subemotes2 = null;
|
||||||
try {
|
try {
|
||||||
File filer = new File(SUBEMOTELISTFILE);
|
File filer = new File(SUBEMOTELISTFILE);
|
||||||
if (!filer.exists()) {
|
if (!filer.exists()) {
|
||||||
@ -343,7 +344,8 @@ public class sigIRC{
|
|||||||
subemotes = FileUtils.readJsonFromFile(SUBEMOTELISTFILE);
|
subemotes = FileUtils.readJsonFromFile(SUBEMOTELISTFILE);
|
||||||
} else {
|
} else {
|
||||||
System.out.println("Local copy of Sub emote JSON out-of-date! Re-downloading in background...");
|
System.out.println("Local copy of Sub emote JSON out-of-date! Re-downloading in background...");
|
||||||
subemotes = FileUtils.readJsonFromUrl("https://twitchemotes.com/api_cache/v3/subscriber.json",SUBEMOTELISTFILE,true);
|
subemotes = FileUtils.readJsonFromFile(SUBEMOTELISTFILE);
|
||||||
|
subemotes2 = FileUtils.readJsonFromUrl("https://twitchemotes.com/api_cache/v3/subscriber.json",SUBEMOTELISTFILE,true);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
} catch (JSONException | IOException e) {
|
} catch (JSONException | IOException e) {
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user