clean up
This commit is contained in:
@ -34,6 +34,8 @@ import java.math.BigInteger;
|
||||
import java.net.URLConnection;
|
||||
import java.util.Locale;
|
||||
import java.util.ResourceBundle;
|
||||
import java.util.concurrent.ExecutorService;
|
||||
import java.util.concurrent.Executors;
|
||||
|
||||
import org.apache.logging.log4j.LogManager;
|
||||
import org.apache.logging.log4j.Logger;
|
||||
@ -214,7 +216,7 @@ public class MainWindowController {
|
||||
initActions();
|
||||
dbController.init();
|
||||
|
||||
// posterModeStartup(); // TODO testing
|
||||
// posterModeStartup(); // TODO testing DO NOT USE THIS!!
|
||||
}
|
||||
|
||||
// Initialize general UI elements
|
||||
@ -441,7 +443,7 @@ public class MainWindowController {
|
||||
LOGGER.info("loading from cache: " + getCurrentTitle());
|
||||
dbController.readCache(getCurrentStreamUrl());
|
||||
} else {
|
||||
Thread omdbAPIThread = new Thread(new OMDbAPIController(main, dbController, currentTableFilm, omdbAPIKey));
|
||||
Thread omdbAPIThread = new Thread(new OMDbAPIController(main, dbController, currentTableFilm, omdbAPIKey, true));
|
||||
omdbAPIThread.setName("OMDbAPI");
|
||||
omdbAPIThread.start();
|
||||
}
|
||||
@ -817,18 +819,21 @@ public class MainWindowController {
|
||||
*/
|
||||
private void checkAllPosters() {
|
||||
// get all not cached entries, none of them should have a cached poster
|
||||
ExecutorService executor = Executors.newFixedThreadPool(5);
|
||||
|
||||
for (FilmTabelDataType entry : dbController.getAllNotCachedEntries()) {
|
||||
System.out.println(entry.getStreamUrl() + " is NOT cached!");
|
||||
// TODO get all needed posters eg cache all not cached entries
|
||||
// TODO for entries not available show homeflix logo
|
||||
|
||||
Runnable OMDbAPIWorker = new OMDbAPIController(main, dbController, entry, omdbAPIKey, false);
|
||||
executor.execute(OMDbAPIWorker);
|
||||
|
||||
// TODO for entries not available show homeflix logo and set cached
|
||||
}
|
||||
executor.shutdown();
|
||||
|
||||
// Thread omdbAPIThread = new Thread(new OMDbAPIController(main, dbController, currentTableFilm, omdbAPIKey));
|
||||
// omdbAPIThread.setName("OMDbAPI");
|
||||
// omdbAPIThread.start();
|
||||
// TODO show loading screen
|
||||
}
|
||||
|
||||
|
||||
// getter and setter
|
||||
public DBController getDbController() {
|
||||
return dbController;
|
||||
|
Reference in New Issue
Block a user