Skip to content

Commit

Permalink
1.8.1: added ON_DEMAND capabilities flag for one time execution
Browse files Browse the repository at this point in the history
  • Loading branch information
mynttt committed Feb 22, 2024
1 parent c35504f commit 6d53a4d
Show file tree
Hide file tree
Showing 9 changed files with 28 additions and 6 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
## 1.8.1
- `ON_DEMAND` capability flag supplied to bypass hourly scheduling for on-demand runs
This update is not interesting for docker/gui/script users interested in scheduled execution.

## 1.8.0
- Support for Plex v1.40.0.7775+ key:value format in extra data
- Older version of extra data for versions < v1.40.0.7775 is still supported
Expand Down
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -220,6 +220,7 @@ Flag | Description
`IGNORE_SCRAPER_NO_RESULT_LOG`|Supresses printing web scraper no-match results that either have no rating on the IMDB website or are not allowed to be rated by anyone on the IMDB website and thus will never have ratings
`DISABLE_SCREEN_SCRAPE`|Disables the screen scraping unit (extracts IMDB ratings from the website if not in dataset) in case that there are issues with the IMDB web page such as 503 errors and timeouts that cause unsuccessful results and slow down the metadata lookup process immensely.
`PRINT_SQLITE_BINARY_EXECUTE_STATEMENTS`|Prints out the SQLite binary execute statements for diagnostic purposes
`ON_DEMAND`|Quit after running once, ignoring the (n) hour scheduling

Multiple flags can be supplied as a semicolon separated string.

Expand Down
2 changes: 1 addition & 1 deletion VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
1.8.0
1.8.1
2 changes: 1 addition & 1 deletion build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ plugins {
id 'com.github.spotbugs' version '2.0.1'
}

version = '1.8.0'
version = '1.8.1'
sourceCompatibility = '11'

new File(projectDir, "VERSION").text = version;
Expand Down
6 changes: 4 additions & 2 deletions src/main/java/updatetool/common/Capabilities.java
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,11 @@ public enum Capabilities {
IGNORE_SCRAPER_NO_RESULT_LOG,
IGNORE_NO_MATCHING_RESOLVER_LOG,
DISABLE_SCREEN_SCRAPE,
PRINT_SQLITE_BINARY_EXECUTE_STATEMENTS;
PRINT_SQLITE_BINARY_EXECUTE_STATEMENTS,
ON_DEMAND
;

private static final List<Capabilities> USER_FLAGS = List.of(NO_MOVIE, NO_TV, DONT_THROW_ON_ENCODING_ERROR, IGNORE_NO_MATCHING_RESOLVER_LOG, IGNORE_SCRAPER_NO_RESULT_LOG, DISABLE_SCREEN_SCRAPE, PRINT_SQLITE_BINARY_EXECUTE_STATEMENTS);
private static final List<Capabilities> USER_FLAGS = List.of(NO_MOVIE, NO_TV, DONT_THROW_ON_ENCODING_ERROR, IGNORE_NO_MATCHING_RESOLVER_LOG, IGNORE_SCRAPER_NO_RESULT_LOG, DISABLE_SCREEN_SCRAPE, PRINT_SQLITE_BINARY_EXECUTE_STATEMENTS, ON_DEMAND);

public static List<Capabilities> getUserFlags() {
return USER_FLAGS;
Expand Down
7 changes: 6 additions & 1 deletion src/main/java/updatetool/imdb/ImdbDockerImplementation.java
Original file line number Diff line number Diff line change
Expand Up @@ -320,8 +320,13 @@ public void run() {
Logger.error("The application will terminate now.");
System.exit(-1);
}

if(checkCapability(Capabilities.ON_DEMAND)) {
Logger.info("ON_DEMAND configured. Exiting after running once now!");
System.exit(0);
}

}

}

@Override
Expand Down
9 changes: 9 additions & 0 deletions src/main/java/updatetool/imdb/ImdbOnDemandImplementation.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
package updatetool.imdb;

public class ImdbOnDemandImplementation extends ImdbDockerImplementation {

public ImdbOnDemandImplementation(String id, String desc, String usage, String help) {
super(id, desc, usage, help);
}

}
2 changes: 1 addition & 1 deletion src/main/resources/VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
1.8.0
1.8.1
1 change: 1 addition & 0 deletions src/main/resources/desc/imdb-docker.ez
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ meta {
| (Optional) DISABLE_SCREEN_SCRAPE: Disables the screen scraping unit (extracts IMDB ratings from the website if not in dataset)
| in case that there are issues with the IMDB web page such as 503 errors and timeouts that cause unsuccessful results and
| slow down the metadata lookup process immensely.
| (Optional) ON_DEMAND: Exit after running one time; ignoring the schedule every n hour(s) behavior.
|
| Parameters:
| - schedule = if present will schedule this task every n hour(s) : must be > 0 : default 12
Expand Down

0 comments on commit 6d53a4d

Please sign in to comment.