Skip to content

Commit

Permalink
- switch to 14.1.0 due to many changes
Browse files Browse the repository at this point in the history
- rename filters via separate button instead of ComboBox entry
- update libraries
  • Loading branch information
derreisende77 committed May 14, 2024
1 parent 81a03f8 commit 987e904
Show file tree
Hide file tree
Showing 14 changed files with 159 additions and 110 deletions.
3 changes: 2 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# **14.0.1**
# **14.1.0**
- JDK 21 wird nun mitgeliefert. Behebt primär Darstellungsfehler von Java Apps unter Windows.
- **macOS/Windows:** ffmpeg 7.0 ist nun enthalten.
- CVE in xerial-jdbc Bibliothek wurde durch eine neuere Version gefixt.
Expand Down Expand Up @@ -38,6 +38,7 @@
- **FEATURE:** Der bevorzugte DNS-IP-Auflösungsmodus kann nun via `-dpm <XXX>` oder `--dns-preference-mode <XXX>` geändert werden. Zulässige Werte sind `system`, `ip_v6`, `ip_v4`, `ip_v6_only`, `ip_v4_only` (Standardwert). Eine Änderung kann bei IPv6-only Internetanschlüssen notwendig sein.
- **FEATURE:** Die Suchhistorie kann nun im Kontextmenü editiert werden.
- **FEATURE:** Dialog "Filminformation" kann nun vollständig vergrößert oder verkleinert werden.
- **FEATURE:** Die Filter werden nun über einen eigenen Button umbenannt und nicht mehr durch Eingabe in der ComboBox.


# **14.0.0**
Expand Down
4 changes: 2 additions & 2 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@

<groupId>de.mediathekview</groupId>
<artifactId>MediathekView</artifactId>
<version>14.0.1</version>
<version>14.1.0</version>
<packaging>jar</packaging>

<name>${project.groupId}:${project.artifactId}</name>
Expand Down Expand Up @@ -122,7 +122,7 @@
<miglayout.version>11.3</miglayout.version>
<mockito.version>5.11.0</mockito.version>
<okhttp.version>5.0.0-alpha.14</okhttp.version>
<picocli.version>4.7.5</picocli.version>
<picocli.version>4.7.6</picocli.version>
<sqlite-jdbc.version>3.45.3.0</sqlite-jdbc.version>
<xz.version>1.9</xz.version>

Expand Down
2 changes: 1 addition & 1 deletion src/main/java/mediathek/config/Konstanten.java
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@

public class Konstanten {
public static final long MINIMUM_MEMORY_THRESHOLD = 768 * FileUtils.ONE_MB;
public static final Version MVVERSION = new Version(14,0,1);
public static final Version MVVERSION = new Version(14,1,0);

public static final ApplicationType APPLICATION_TYPE = ApplicationType.PRODUCTION;
public static final String MACOS_OFFICIAL_APP = "OSX_OFFICIAL_APP";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -192,7 +192,7 @@ public synchronized void filterListAndNotifyListeners() {

private void calculateZeitraumBoundaries() {
try {
var strZeitraum = MediathekGui.ui().tabFilme.filmActionPanel.zeitraumProperty().get();
var strZeitraum = MediathekGui.ui().tabFilme.getFilterActionPanel().zeitraumProperty().get();
if (strZeitraum.equalsIgnoreCase(ZeitraumSpinner.UNLIMITED_VALUE))
days_lower_boundary = 0;
else {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
package mediathek.gui;

import javafx.application.Platform;
import mediathek.tool.FilterConfiguration;
import mediathek.tool.FilterDTO;

Expand All @@ -15,7 +16,7 @@ public class FilterSelectionComboBoxModel extends DefaultComboBoxModel<FilterDTO
public void setSelectedItem(Object anObject) {
super.setSelectedItem(anObject);
if (anObject != null) {
filterConfiguration.setCurrentFilter((FilterDTO) anObject);
Platform.runLater(() -> filterConfiguration.setCurrentFilter((FilterDTO) anObject));
}
}

Expand Down
60 changes: 31 additions & 29 deletions src/main/java/mediathek/gui/tabs/tab_film/GuiFilme.java
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@
import mediathek.gui.tabs.tab_film.helpers.GuiModelHelper;
import mediathek.gui.tabs.tab_film.helpers.LuceneGuiFilmeModelHelper;
import mediathek.javafx.bookmark.BookmarkWindowController;
import mediathek.javafx.filterpanel.FilmActionPanel;
import mediathek.javafx.filterpanel.FilterActionPanel;
import mediathek.javafx.filterpanel.SearchControlFieldMode;
import mediathek.mainwindow.MediathekGui;
import mediathek.tool.*;
Expand Down Expand Up @@ -111,10 +111,15 @@ public class GuiFilme extends AGuiTabPanel {
private final JToolBar toolBar = new JToolBar();
private final JCheckBoxMenuItem cbShowButtons = new JCheckBoxMenuItem("Buttons anzeigen");
private final PauseTransition zeitraumTransition = new PauseTransition(Duration.millis(250));

public FilterActionPanel getFilterActionPanel() {
return filterActionPanel;
}

/**
* The JavaFx Film action popup panel.
*/
public FilmActionPanel filmActionPanel;
private final FilterActionPanel filterActionPanel;
public ToggleFilterDialogVisibilityAction toggleFilterDialogVisibilityAction = new ToggleFilterDialogVisibilityAction();
protected SearchField searchField;
protected JComboBox<FilterDTO> filterSelectionComboBox = new JComboBox<>(new FilterSelectionComboBoxModel());
Expand Down Expand Up @@ -153,7 +158,8 @@ public GuiFilme(Daten aDaten, MediathekGui mediathekGui) {
setupFilmSelectionPropertyListener();
setupDescriptionTab(tabelle, cbkShowDescription, ApplicationConfiguration.FILM_SHOW_DESCRIPTION);
setupPsetButtonsTab();
setupFilmActionPanel();

filterActionPanel = new FilterActionPanel(btnToggleFilterDialogVisibility);

start_init();
// register message bus handler
Expand Down Expand Up @@ -291,10 +297,6 @@ public void installMenuEntries(JMenu menu) {
menu.add(cbkShowDescription);
}

private void setupFilmActionPanel() {
filmActionPanel = new FilmActionPanel(btnToggleFilterDialogVisibility);
}

private void setupPsetButtonsTab() {
var initialVisibility = ApplicationConfiguration.getConfiguration().getBoolean(ApplicationConfiguration.APPLICATION_BUTTONS_PANEL_VISIBLE, false);
setupButtonsMenuItem(initialVisibility);
Expand Down Expand Up @@ -368,7 +370,7 @@ private void start_init() {
daten.getFilmeLaden().addAdListener(new ListenerFilmeLaden() {
@Override
public void fertig(ListenerFilmeLadenEvent event) {
Platform.runLater(() -> filmActionPanel.updateThemaComboBox());
Platform.runLater(() -> filterActionPanel.updateThemaComboBox());
}
});

Expand Down Expand Up @@ -411,7 +413,7 @@ private void setupHeaderPopupMenu() {
@Handler
private void handleDownloadHistoryChangedEvent(DownloadHistoryChangedEvent e) {
SwingUtilities.invokeLater(() -> {
if (filmActionPanel.isShowUnseenOnly()) {
if (filterActionPanel.isShowUnseenOnly()) {
Platform.runLater(reloadTableDataTransition::playFromStart);
} else {
tabelle.fireTableDataChanged(true);
Expand Down Expand Up @@ -521,7 +523,7 @@ private void saveFilm(@NotNull DatenFilm datenFilm, @NotNull DatenPset pSet) {
} else {
// dann alle Downloads im Dialog abfragen
Optional<FilmResolution.Enum> res =
filmActionPanel.isShowOnlyHighQuality() ? Optional.of(FilmResolution.Enum.HIGH_QUALITY) : Optional.empty();
filterActionPanel.isShowOnlyHighQuality() ? Optional.of(FilmResolution.Enum.HIGH_QUALITY) : Optional.empty();
DialogAddDownload dialog = new DialogAddDownload(mediathekGui, datenFilm, pSet, res);
dialog.setVisible(true);
}
Expand Down Expand Up @@ -569,7 +571,7 @@ public void playerStarten(DatenPset pSet) {
} else {
// mit dem flvstreamer immer nur einen Filme starten
final String aufloesung;
if (filmActionPanel.isShowOnlyHighQuality()) {
if (filterActionPanel.isShowOnlyHighQuality()) {
aufloesung = FilmResolution.Enum.HIGH_QUALITY.toString();
} else aufloesung = "";

Expand Down Expand Up @@ -657,7 +659,7 @@ private void setupDataTransitions() {

zeitraumTransition.setOnFinished(evt -> {
// reset sender filter first
filmActionPanel.getViewSettingsPane().senderCheckList.getCheckModel().clearChecks();
filterActionPanel.getViewSettingsPane().senderCheckList.getCheckModel().clearChecks();
try {
SwingUtilities.invokeAndWait(() -> daten.getListeBlacklist().filterListe());
} catch (InterruptedException | InvocationTargetException e) {
Expand All @@ -677,24 +679,24 @@ private void setupActionListeners() {
reloadTableDataTransition.playFromStart();
}
};
filmActionPanel.showOnlyHighQualityProperty().addListener(reloadTableListener);
filmActionPanel.showSubtitlesOnlyProperty().addListener(reloadTableListener);
filmActionPanel.showNewOnlyProperty().addListener(reloadTableListener);
filmActionPanel.showBookMarkedOnlyProperty().addListener(reloadTableListener);
filmActionPanel.showUnseenOnlyProperty().addListener(reloadTableListener);
filmActionPanel.dontShowAbosProperty().addListener(reloadTableListener);
filmActionPanel.dontShowTrailersProperty().addListener(reloadTableListener);
filmActionPanel.dontShowSignLanguageProperty().addListener(reloadTableListener);
filmActionPanel.dontShowAudioVersionsProperty().addListener(reloadTableListener);
filmActionPanel.showLivestreamsOnlyProperty().addListener(reloadTableListener);
var filmLengthSlider = filmActionPanel.getFilmLengthSlider();
filterActionPanel.showOnlyHighQualityProperty().addListener(reloadTableListener);
filterActionPanel.showSubtitlesOnlyProperty().addListener(reloadTableListener);
filterActionPanel.showNewOnlyProperty().addListener(reloadTableListener);
filterActionPanel.showBookMarkedOnlyProperty().addListener(reloadTableListener);
filterActionPanel.showUnseenOnlyProperty().addListener(reloadTableListener);
filterActionPanel.dontShowAbosProperty().addListener(reloadTableListener);
filterActionPanel.dontShowTrailersProperty().addListener(reloadTableListener);
filterActionPanel.dontShowSignLanguageProperty().addListener(reloadTableListener);
filterActionPanel.dontShowAudioVersionsProperty().addListener(reloadTableListener);
filterActionPanel.showLivestreamsOnlyProperty().addListener(reloadTableListener);
var filmLengthSlider = filterActionPanel.getFilmLengthSlider();
filmLengthSlider.lowValueChangingProperty().addListener(reloadTableListener2);
filmLengthSlider.highValueChangingProperty().addListener(reloadTableListener2);

filmActionPanel.zeitraumProperty().addListener((observable, oldValue, newValue) -> zeitraumTransition.playFromStart());
filterActionPanel.zeitraumProperty().addListener((observable, oldValue, newValue) -> zeitraumTransition.playFromStart());

filmActionPanel.getViewSettingsPane().themaComboBox.setOnAction(evt -> {
if (!filmActionPanel.getViewSettingsPane().themaComboBox.getItems().isEmpty()) {
filterActionPanel.getViewSettingsPane().themaComboBox.setOnAction(evt -> {
if (!filterActionPanel.getViewSettingsPane().themaComboBox.getItems().isEmpty()) {
reloadTableDataTransition.playFromStart();
}
});
Expand Down Expand Up @@ -738,9 +740,9 @@ private void loadTable(boolean from_search_field) {
var searchFieldData = new SearchFieldData(searchField.getText(),
searchField.getSearchMode());
if (Daten.getInstance().getListeFilmeNachBlackList() instanceof IndexedFilmList) {
helper = new LuceneGuiFilmeModelHelper(filmActionPanel, historyController, searchFieldData);
helper = new LuceneGuiFilmeModelHelper(filterActionPanel, historyController, searchFieldData);
} else {
helper = new GuiFilmeModelHelper(filmActionPanel, historyController, searchFieldData);
helper = new GuiFilmeModelHelper(filterActionPanel, historyController, searchFieldData);
}
return helper.getFilteredTableModel();
});
Expand Down Expand Up @@ -793,7 +795,7 @@ public ToggleFilterDialogVisibilityAction() {

@Override
public void actionPerformed(ActionEvent e) {
var dlg = filmActionPanel.getFilterDialog();
var dlg = filterActionPanel.getFilterDialog();
if (dlg != null) {
var visible = dlg.isVisible();
visible = !visible;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@
import mediathek.gui.tabs.tab_film.searchfilters.FinalStageFilterNoPatternWithDescription;
import mediathek.gui.tabs.tab_film.searchfilters.FinalStagePatternFilter;
import mediathek.gui.tabs.tab_film.searchfilters.FinalStagePatternFilterWithDescription;
import mediathek.javafx.filterpanel.FilmActionPanel;
import mediathek.javafx.filterpanel.FilmLengthSlider;
import mediathek.javafx.filterpanel.FilterActionPanel;
import mediathek.tool.Filter;
import mediathek.tool.models.TModelFilm;
import org.jetbrains.annotations.NotNull;
Expand All @@ -25,16 +25,16 @@ public class GuiFilmeModelHelper extends GuiModelHelper {
private TModelFilm filmModel;
private String[] arrIrgendwo;

public GuiFilmeModelHelper(@NotNull FilmActionPanel filmActionPanel,
public GuiFilmeModelHelper(@NotNull FilterActionPanel filterActionPanel,
@NotNull SeenHistoryController historyController,
@NotNull SearchFieldData searchFieldData) {
this.filmActionPanel = filmActionPanel;
this.filterActionPanel = filterActionPanel;
this.historyController = historyController;
this.searchFieldData = searchFieldData;
}

private String getFilterThema() {
String filterThema = filmActionPanel.getViewSettingsPane().themaComboBox.getSelectionModel().getSelectedItem();
String filterThema = filterActionPanel.getViewSettingsPane().themaComboBox.getSelectionModel().getSelectedItem();
if (filterThema == null) {
filterThema = "";
}
Expand All @@ -44,23 +44,23 @@ private String getFilterThema() {

@Override
protected boolean noFiltersAreSet() {
var filmLengthSlider = filmActionPanel.getFilmLengthSlider();
var filmLengthSlider = filterActionPanel.getFilmLengthSlider();

return filmActionPanel.getViewSettingsPane().senderCheckList.getCheckModel().isEmpty()
return filterActionPanel.getViewSettingsPane().senderCheckList.getCheckModel().isEmpty()
&& getFilterThema().isEmpty()
&& searchFieldData.isEmpty()
&& ((int) filmLengthSlider.getLowValue() == 0)
&& ((int) filmLengthSlider.getHighValue() == FilmLengthSlider.UNLIMITED_VALUE)
&& !filmActionPanel.isDontShowAbos()
&& !filmActionPanel.isShowUnseenOnly()
&& !filmActionPanel.isShowOnlyHighQuality()
&& !filmActionPanel.isShowSubtitlesOnly()
&& !filmActionPanel.isShowLivestreamsOnly()
&& !filmActionPanel.isShowNewOnly()
&& !filmActionPanel.isShowBookMarkedOnly()
&& !filmActionPanel.isDontShowTrailers()
&& !filmActionPanel.isDontShowSignLanguage()
&& !filmActionPanel.isDontShowAudioVersions();
&& !filterActionPanel.isDontShowAbos()
&& !filterActionPanel.isShowUnseenOnly()
&& !filterActionPanel.isShowOnlyHighQuality()
&& !filterActionPanel.isShowSubtitlesOnly()
&& !filterActionPanel.isShowLivestreamsOnly()
&& !filterActionPanel.isShowNewOnly()
&& !filterActionPanel.isShowBookMarkedOnly()
&& !filterActionPanel.isDontShowTrailers()
&& !filterActionPanel.isDontShowSignLanguage()
&& !filterActionPanel.isDontShowAudioVersions();
}


Expand All @@ -70,9 +70,9 @@ private void performTableFiltering() {
calculateFilmLengthSliderValues();

final String filterThema = getFilterThema();
final ObservableList<String> selectedSenders = filmActionPanel.getViewSettingsPane().senderCheckList.getCheckModel().getCheckedItems();
final ObservableList<String> selectedSenders = filterActionPanel.getViewSettingsPane().senderCheckList.getCheckModel().getCheckedItems();

if (filmActionPanel.isShowUnseenOnly())
if (filterActionPanel.isShowUnseenOnly())
historyController.prepareMemoryCache();

var stream = Daten.getInstance().getListeFilmeNachBlackList().parallelStream();
Expand All @@ -82,23 +82,23 @@ private void performTableFiltering() {
senderSet.addAll(selectedSenders);
stream = stream.filter(f -> senderSet.contains(f.getSender()));
}
if (filmActionPanel.isShowNewOnly())
if (filterActionPanel.isShowNewOnly())
stream = stream.filter(DatenFilm::isNew);
if (filmActionPanel.isShowBookMarkedOnly())
if (filterActionPanel.isShowBookMarkedOnly())
stream = stream.filter(DatenFilm::isBookmarked);
if (filmActionPanel.isShowLivestreamsOnly())
if (filterActionPanel.isShowLivestreamsOnly())
stream = stream.filter(DatenFilm::isLivestream);
if (filmActionPanel.isShowOnlyHighQuality())
if (filterActionPanel.isShowOnlyHighQuality())
stream = stream.filter(DatenFilm::isHighQuality);
if (filmActionPanel.isDontShowTrailers())
if (filterActionPanel.isDontShowTrailers())
stream = stream.filter(film -> !film.isTrailerTeaser());
if (filmActionPanel.isDontShowSignLanguage())
if (filterActionPanel.isDontShowSignLanguage())
stream = stream.filter(film -> !film.isSignLanguage());
if (filmActionPanel.isDontShowAudioVersions())
if (filterActionPanel.isDontShowAudioVersions())
stream = stream.filter(film -> !film.isAudioVersion());
if (filmActionPanel.isDontShowAbos())
if (filterActionPanel.isDontShowAbos())
stream = stream.filter(film -> film.getAbo() == null);
if (filmActionPanel.isShowSubtitlesOnly()) {
if (filterActionPanel.isShowSubtitlesOnly()) {
stream = stream.filter(this::subtitleCheck);
}
if (!filterThema.isEmpty()) {
Expand All @@ -107,7 +107,7 @@ private void performTableFiltering() {
if (maxLength < FilmLengthSlider.UNLIMITED_VALUE) {
stream = stream.filter(this::maxLengthCheck);
}
if (filmActionPanel.isShowUnseenOnly()) {
if (filterActionPanel.isShowUnseenOnly()) {
stream = stream.filter(this::seenCheck);
}
//perform min length filtering after all others may have reduced the available entries...
Expand All @@ -128,7 +128,7 @@ private void performTableFiltering() {

list.clear();

if (filmActionPanel.isShowUnseenOnly())
if (filterActionPanel.isShowUnseenOnly())
historyController.emptyMemoryCache();
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,15 +3,15 @@
import mediathek.controller.history.SeenHistoryController;
import mediathek.daten.DatenFilm;
import mediathek.gui.tabs.tab_film.SearchFieldData;
import mediathek.javafx.filterpanel.FilmActionPanel;
import mediathek.javafx.filterpanel.FilterActionPanel;

import javax.swing.table.TableModel;
import java.util.concurrent.TimeUnit;

public abstract class GuiModelHelper {
protected SliderRange sliderRange;
protected long maxLength;
protected FilmActionPanel filmActionPanel;
protected FilterActionPanel filterActionPanel;
protected SeenHistoryController historyController;
protected SearchFieldData searchFieldData;

Expand Down Expand Up @@ -41,8 +41,8 @@ protected boolean seenCheck(DatenFilm film) {
}

protected void calculateFilmLengthSliderValues() {
final long minLength = (long) filmActionPanel.getFilmLengthSlider().getLowValue();
maxLength = (long) filmActionPanel.getFilmLengthSlider().getHighValue();
final long minLength = (long) filterActionPanel.getFilmLengthSlider().getLowValue();
maxLength = (long) filterActionPanel.getFilmLengthSlider().getHighValue();
var minLengthInSeconds = TimeUnit.SECONDS.convert(minLength, TimeUnit.MINUTES);
var maxLengthInSeconds = TimeUnit.SECONDS.convert(maxLength, TimeUnit.MINUTES);
sliderRange = new SliderRange(minLengthInSeconds, maxLengthInSeconds);
Expand Down
Loading

0 comments on commit 987e904

Please sign in to comment.