Skip to content

Commit

Permalink
add messages and fix java doc
Browse files Browse the repository at this point in the history
  • Loading branch information
codingPF committed Nov 1, 2023
1 parent fbf5c34 commit 357c75e
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 17 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,9 @@ public enum ServerMessages implements Message {
NO_FILMLIST_IMPORT_FORMAT_IN_CONFIG("noFilmlistImportFormatInConfig", MessageTypes.FATAL_ERROR),
NO_FILMLIST_IMPORT_LOCATION_IN_CONFIG(
"noFilmlistImportLocationInConfig", MessageTypes.FATAL_ERROR),
NO_FILMLIST_IMPORT_ACTIVE_IN_CONFIG("noFilmlistImportActgiveInConfig", MessageTypes.FATAL_ERROR),
NO_FILMLIST_IMPORT_DIFF_IN_CONFIG("noFilmlistImportCreateDiffInConfig", MessageTypes.FATAL_ERROR),
NO_FILMLIST_IMPORT_CHECK_IN_CONFIG("noFilmlistImportCheckUrlInConfig", MessageTypes.FATAL_ERROR),
FORMAT_NOT_IN_SAVE_FORMATS("formatNotInSaveFormats", MessageTypes.ERROR),
UI_TO_MANY_ARGUMENTS("uiToManyArguments", MessageTypes.ERROR),
UI_UNKNOWN_ARGUMENT("uiUnknownArgument", MessageTypes.FATAL_ERROR),
Expand Down
24 changes: 7 additions & 17 deletions src/main/java/de/mediathekview/mserver/crawler/CrawlerManager.java
Original file line number Diff line number Diff line change
Expand Up @@ -150,10 +150,6 @@ public void filterFilmlist() {
}
}

/**
* Imports the film list with the given {@link MServerConfigDTO#getFilmlistImportFormat()} of
* {@link MServerConfigDTO#getFilmlistImportLocation()}.
*/
public void importFilmlist() {
for (ImportFilmlistConfiguration importFilmlistConfiguration : config.getImportFilmlistConfigurations()) {
if (checkImportFilmlistConfig(importFilmlistConfiguration) && importFilmlistConfiguration.isActive()) {
Expand Down Expand Up @@ -187,14 +183,7 @@ public void importLivestreamFilmlist(final FilmlistFormats aFormat, final String
}
}

/**
* Imports the film list with the given {@link FilmlistFormats} and the given location.
*
* @param aFormat The{@link FilmlistFormats} to import.
* @param aFilmlistLocation The given location from which to import. If it starts with <code>http
* </code> or <code>https</code> it tries to import from URL. Otherwise it tries to import
* from the given Location as a file path.
*/

public void importFilmlist(final ImportFilmlistConfiguration importFilmlistConfiguration) {
try {
Optional<Filmlist> importedFilmlist;
Expand Down Expand Up @@ -368,21 +357,22 @@ private boolean checkImportFilmlistConfig(ImportFilmlistConfiguration config) {
printMessage(ServerMessages.NO_FILMLIST_IMPORT_LOCATION_IN_CONFIG);
return false;
}

if (config.getFormat() == null) {
printMessage(ServerMessages.NO_FILMLIST_IMPORT_FORMAT_IN_CONFIG);
return false;
}
// @TODO define message
if (config.isActive() == null) {
printMessage(ServerMessages.NO_FILMLIST_IMPORT_FORMAT_IN_CONFIG);
printMessage(ServerMessages.NO_FILMLIST_IMPORT_ACTIVE_IN_CONFIG);
return false;
}
if (config.isCreateDiff() == null) {
printMessage(ServerMessages.NO_FILMLIST_IMPORT_FORMAT_IN_CONFIG);
printMessage(ServerMessages.NO_FILMLIST_IMPORT_DIFF_IN_CONFIG);
return false;
}
if (config.isCheckImportListUrl() == null) {
printMessage(ServerMessages.NO_FILMLIST_IMPORT_CHECK_IN_CONFIG);
return false;
}

return true;
}

Expand Down
3 changes: 3 additions & 0 deletions src/main/resources/MediathekView_Messages_de_DE.properties
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,9 @@ filmlistSavePathMissingRights=Die Filmliste konnte aufgrund fehlender Dateirecht
formatNotInSaveFormats=Das f\u00FCr den Upload angegebene Filmlist Format %s ist nicht mit bei den Filmlist speicher Formaten aufgef\u00FChrt und kann somit nicht verwendet werden da es auch nicht generiert wird.
noFilmlistFormatConfigured=In der Konfiguration wurde kein Filmlisten Format angegeben.
noFilmlistImportFormatInConfig=In der Konfiguration ist kein Format f\u00FCr die zu importierende Filmliste angegeben.
noFilmlistImportActgiveInConfig=Konfiguration active in importFilmlistConfigurations fehlt
noFilmlistImportCreateDiffInConfig=Konfiguration active in importFilmlistConfigurations fehlt
noFilmlistImportCheckUrlInConfig=Konfiguration active in importFilmlistConfigurations fehlt
noFilmlistImportLocationInConfig=In der Konfiguration ist kein/e Pfad/URL f\u00FCr die zu importierende Filmliste angegeben.
noFilmlistSavePathForFormatConfigured=In der Konfiguration wurde nicht angegeben, wo die Filmliste mit dem Format "%s" gespeichert werden soll.
noFilmlistSavePathsConfigured=In der Konfiguration wurde nicht angegebe, wo die Filmliste/n gespeichert werden sollen.
Expand Down
3 changes: 3 additions & 0 deletions src/main/resources/MediathekView_Messages_en.properties
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,9 @@ filmlistSavePathMissingRights=The film list couldn't be saved because of missing
formatNotInSaveFormats=The film list format %s is not listed in the film list save formats and so it can't be used because it will not be generated.
noFilmlistFormatConfigured=There is no configuration in which formats the film list should be safed.
noFilmlistImportFormatInConfig=There is no format for the film list to import in the configuration file.
noFilmlistImportActgiveInConfig=Configuration element active in importFilmlistConfigurations is missing
noFilmlistImportCreateDiffInConfig=Configuration element active in importFilmlistConfigurations is missing
noFilmlistImportCheckUrlInConfig=Configuration element active in importFilmlistConfigurations is missing
noFilmlistImportLocationInConfig=There is no path/URL in the configuration for the film list to import.
noFilmlistSavePathForFormatConfigured=There is no configuration where the film list with the format "%s" should be safed to.
noFilmlistSavePathsConfigured=There is no configuration where which film list should be safed to.
Expand Down

0 comments on commit 357c75e

Please sign in to comment.