added getAllNotCachedEntries()

* added a method to get all not cached entries from the films db
This commit is contained in:
Jannik
2018-08-13 23:56:16 +02:00
parent f68b0c0feb
commit 814bb00158
2 changed files with 42 additions and 1 deletions

View File

@ -213,6 +213,8 @@ public class MainWindowController {
initUI();
initActions();
dbController.init();
checkAllPosters(); // TODO testing
}
// Initialize general UI elements
@ -801,6 +803,22 @@ public class MainWindowController {
String mimeType = URLConnection.guessContentTypeFromName(film.getStreamUrl());
return mimeType != null && (mimeType.contains("mp4") || mimeType.contains("vp6"));
}
private void posterModeStartup() {
checkAllPosters();
}
/**
* check if all posters are cached, if not cache the missing ones
*/
private void checkAllPosters() {
// get all not cached entries, none of them should have a cached poster
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
}
}
// getter and setter